{"answer": "def delimiters_ok(text):\n pairs = {\")\": \"(\", \"]\": \"[\", \"}\": \"{\"}\n stack = []\n for ch in text:\n if ch in \"([{\":\n stack.append(ch)\n elif ch in \")]}\":\n if not stack or stack[-1] != pairs[ch]:\n return False\n stack.pop()\n return not stack", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def delimiters_ok(text):\n pairs = {\")\": \"(\", \"]\": \"[\", \"}\": \"{\"}\n stack = []\n for ch in text:\n if ch in \"([{\":\n stack.append(ch)\n elif ch in \")]}\":\n if not stack or stack[-1] != pairs[ch]:\n return False\n stack.pop()\n return not stack\n", "test_solution.py": "import unittest\nfrom solution import delimiters_ok\n\nclass Test(unittest.TestCase):\n def test_mixed(self):\n self.assertTrue(delimiters_ok(\"fn(a[i], {x: 1})\"))\n def test_crossed(self):\n self.assertFalse(delimiters_ok(\"([)]\"))\n def test_extra_close(self):\n self.assertFalse(delimiters_ok(\"ok)\"))\n def test_ignore_other(self):\n self.assertTrue(delimiters_ok(\"\"))\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-nested-delimiter-scan-85bd9022ad05", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.75, "tests": 0.0, "total": 4.35}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "nested_delimiter_scan", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `delimiters_ok(text: str) -> bool`.\n\nReturn True if every round, square, and curly bracket in `text` is correctly\nnested and matched. All other characters are ignored. Empty input is valid.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:25Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def delimiters_ok(text):\n pairs = {\")\": \"(\", \"]\": \"[\", \"}\": \"{\"}\n stack = []\n for ch in text:\n if ch in \"([{\":\n stack.append(ch)\n elif ch in \")]}\":\n if not stack or stack[-1] != pairs[ch]:\n return False\n stack.pop()\n return not stack", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_crossed (test_solution.Test.test_crossed) ... ok\ntest_extra_close (test_solution.Test.test_extra_close) ... ok\ntest_ignore_other (test_solution.Test.test_ignore_other) ... ok\ntest_mixed (test_solution.Test.test_mixed) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i] - values[i - k]\n if current > best:\n best = current\n return best", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i] - values[i - k]\n if current > best:\n best = current\n return best\n", "test_solution.py": "import unittest\nfrom solution import max_window_sum\n\nclass Test(unittest.TestCase):\n def test_example(self):\n self.assertEqual(max_window_sum([2, 1, 5, 1, 3, 2], 3), 9)\n def test_k_one(self):\n self.assertEqual(max_window_sum([-4, 8, -1], 1), 8)\n def test_bad(self):\n with self.assertRaises(ValueError):\n max_window_sum([1, 2], 3)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-window-max-sum-6217a2479b07", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.5}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "window_max_sum", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `max_window_sum(values, k)` returning the maximum sum of any\ncontiguous subarray of length `k`. If `k` is larger than the list, raise ValueError.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i] - values[i - k]\n if current > best:\n best = current\n return best", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_example (test_solution.Test.test_example) ... ok\ntest_k_one (test_solution.Test.test_k_one) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i] - values[i - k]\n if current > best:\n best = current\n return best", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_bad (test_solution.Test.test_bad) ... ok\ntest_example (test_solution.Test.test_example) ... FAIL\ntest_k_one (test_solution.Test.test_k_one) ... FAIL\n\n======================================================================\nFAIL: test_example (test_solution.Test.test_example)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-vb8pc209\\test_solution.py\", line 6, in test_example\n self.assertEqual(max_window_sum([2, 1, 5, 1, 3, 2], 3), 9)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 14 != 9\n\n======================================================================\nFAIL: test_k_one (test_solution.Test.test_k_one)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-vb8pc209\\test_solution.py\", line 8, in test_k_one\n self.assertEqual(max_window_sum([-4, 8, -1], 1), 8)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 4 != 8\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=2)\n"}, "language": "python", "repository": {"files": {"solution.py": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i]\n if current > best:\n best = current\n return best\n", "test_solution.py": "import unittest\nfrom solution import max_window_sum\n\nclass Test(unittest.TestCase):\n def test_example(self):\n self.assertEqual(max_window_sum([2, 1, 5, 1, 3, 2], 3), 9)\n def test_k_one(self):\n self.assertEqual(max_window_sum([-4, 8, -1], 1), 8)\n def test_bad(self):\n with self.assertRaises(ValueError):\n max_window_sum([1, 2], 3)\n"}}, "topic": "algorithms"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-window-max-sum-f631254a0e69", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.875}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 2, "passed": false, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_example (test_solution.Test.test_example) ... FAIL\ntest_k_one (test_solution.Test.test_k_one) ... FAIL\n\n======================================================================\nFAIL: test_example (test_solution.Test.test_example)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-vb8pc209\\test_solution.py\", line 6, in test_example\n self.assertEqual(max_window_sum([2, 1, 5, 1, 3, 2], 3), 9)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 14 != 9\n\n======================================================================\nFAIL: test_k_one (test_solution.Test.test_k_one)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-vb8pc209\\test_solution.py\", line 8, in test_k_one\n self.assertEqual(max_window_sum([-4, 8, -1], 1), 8)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 4 != 8\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=2)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 2, "tests_passed": 1}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "window_max_sum", "tests_passed_after_fix": 3, "topic": "algorithms"}, "natural_language": "en", "observations": ["Forgets to subtract the value leaving the window."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `max_window_sum(values, k)` returning the maximum sum of any\ncontiguous subarray of length `k`. If `k` is larger than the list, raise ValueError.\n\n--- solution.py (buggy) ---\ndef max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i]\n if current > best:\n best = current\n return best\n\n--- test_solution.py ---\nimport unittest\nfrom solution import max_window_sum\n\nclass Test(unittest.TestCase):\n def test_example(self):\n self.assertEqual(max_window_sum([2, 1, 5, 1, 3, 2], 3), 9)\n def test_k_one(self):\n self.assertEqual(max_window_sum([-4, 8, -1], 1), 8)\n def test_bad(self):\n with self.assertRaises(ValueError):\n max_window_sum([1, 2], 3)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_bad (test_solution.Test.test_bad) ... ok\ntest_example (test_solution.Test.test_example) ... FAIL\ntest_k_one (test_solution.Test.test_k_one) ... FAIL\n\n======================================================================\nFAIL: test_example (test_solution.Test.test_example)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-vb8pc209\\test_solution.py\", line 6, in test_example\n self.assertEqual(max_window_sum([2, 1, 5, 1, 3, 2], 3), 9)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 14 != 9\n\n======================================================================\nFAIL: test_k_one (test_solution.Test.test_k_one)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-vb8pc209\\test_solution.py\", line 8, in test_k_one\n self.assertEqual(max_window_sum([-4, 8, -1], 1), 8)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 4 != 8\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=2)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def max_window_sum(values, k):\n if k <= 0 or k > len(values):\n raise ValueError(\"invalid window\")\n current = sum(values[:k])\n best = current\n for i in range(k, len(values)):\n current += values[i] - values[i - k]\n if current > best:\n best = current\n return best", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_example (test_solution.Test.test_example) ... ok\ntest_k_one (test_solution.Test.test_k_one) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def group_in_order(items, key_fn):\n order = []\n buckets = {}\n for item in items:\n key = key_fn(item)\n if key not in buckets:\n buckets[key] = []\n order.append(key)\n buckets[key].append(item)\n return [(key, buckets[key]) for key in order]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def group_in_order(items, key_fn):\n order = []\n buckets = {}\n for item in items:\n key = key_fn(item)\n if key not in buckets:\n buckets[key] = []\n order.append(key)\n buckets[key].append(item)\n return [(key, buckets[key]) for key in order]\n", "test_solution.py": "import unittest\nfrom solution import group_in_order\n\nclass Test(unittest.TestCase):\n def test_order(self):\n data = [\"apple\", \"apricot\", \"banana\", \"avocado\"]\n got = group_in_order(data, lambda s: s[0])\n self.assertEqual([k for k, _ in got], [\"a\", \"b\"])\n self.assertEqual(got[0][1], [\"apple\", \"apricot\", \"avocado\"])\n"}}, "topic": "data_structures"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-stable-group-by-af1de6dd3bd2", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.825, "tests": 0.0, "total": 4.324999999999999}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "stable_group_by", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `group_in_order(items, key_fn)` that groups consecutive items with\nthe same key, preserving first-seen group order for non-consecutive keys as well\n(like an insertion-ordered map of lists). Return a list of (key, group_list) pairs.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def group_in_order(items, key_fn):\n order = []\n buckets = {}\n for item in items:\n key = key_fn(item)\n if key not in buckets:\n buckets[key] = []\n order.append(key)\n buckets[key].append(item)\n return [(key, buckets[key]) for key in order]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_order (test_solution.Test.test_order) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n if capacity < 1:\n raise ValueError(\"capacity\")\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n if key not in self._data:\n return None\n self._data.move_to_end(key)\n return self._data[key]\n\n def put(self, key, value):\n if key in self._data:\n self._data.move_to_end(key)\n self._data[key] = value\n else:\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n if capacity < 1:\n raise ValueError(\"capacity\")\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n if key not in self._data:\n return None\n self._data.move_to_end(key)\n return self._data[key]\n\n def put(self, key, value):\n if key in self._data:\n self._data.move_to_end(key)\n self._data[key] = value\n else:\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)\n", "test_solution.py": "import unittest\nfrom solution import TinyLRU\n\nclass Test(unittest.TestCase):\n def test_evict(self):\n c = TinyLRU(2)\n c.put(\"a\", 1)\n c.put(\"b\", 2)\n c.get(\"a\")\n c.put(\"c\", 3)\n self.assertIsNone(c.get(\"b\"))\n self.assertEqual(c.get(\"a\"), 1)\n self.assertEqual(c.get(\"c\"), 3)\n"}}, "topic": "data_structures"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-lru-cache-map-5dfd0b972649", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.95, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.7, "tests": 0.0, "total": 4.25}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "lru_cache_map", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement class `TinyLRU(capacity)` with `get(key)` (return None if missing)\nand `put(key, value)`. Evict the least recently used entry when over capacity.\nBoth get and put count as use.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n if capacity < 1:\n raise ValueError(\"capacity\")\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n if key not in self._data:\n return None\n self._data.move_to_end(key)\n return self._data[key]\n\n def put(self, key, value):\n if key in self._data:\n self._data.move_to_end(key)\n self._data[key] = value\n else:\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_evict (test_solution.Test.test_evict) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n if capacity < 1:\n raise ValueError(\"capacity\")\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n if key not in self._data:\n return None\n self._data.move_to_end(key)\n return self._data[key]\n\n def put(self, key, value):\n if key in self._data:\n self._data.move_to_end(key)\n self._data[key] = value\n else:\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_evict (test_solution.Test.test_evict) ... FAIL\n\n======================================================================\nFAIL: test_evict (test_solution.Test.test_evict)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-v9sxhjaz\\test_solution.py\", line 11, in test_evict\n self.assertIsNone(c.get(\"b\"))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: 2 is not None\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n return self._data.get(key)\n\n def put(self, key, value):\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)\n", "test_solution.py": "import unittest\nfrom solution import TinyLRU\n\nclass Test(unittest.TestCase):\n def test_evict(self):\n c = TinyLRU(2)\n c.put(\"a\", 1)\n c.put(\"b\", 2)\n c.get(\"a\")\n c.put(\"c\", 3)\n self.assertIsNone(c.get(\"b\"))\n self.assertEqual(c.get(\"a\"), 1)\n self.assertEqual(c.get(\"c\"), 3)\n"}}, "topic": "data_structures"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-lru-cache-map-dd703ee47a0f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.725, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.925, "tests": 0.0, "total": 10.95}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_evict (test_solution.Test.test_evict) ... FAIL\n\n======================================================================\nFAIL: test_evict (test_solution.Test.test_evict)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-v9sxhjaz\\test_solution.py\", line 11, in test_evict\n self.assertIsNone(c.get(\"b\"))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: 2 is not None\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "lru_cache_map", "tests_passed_after_fix": 1, "topic": "data_structures"}, "natural_language": "en", "observations": ["get() does not refresh recency."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement class `TinyLRU(capacity)` with `get(key)` (return None if missing)\nand `put(key, value)`. Evict the least recently used entry when over capacity.\nBoth get and put count as use.\n\n--- solution.py (buggy) ---\nfrom collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n return self._data.get(key)\n\n def put(self, key, value):\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import TinyLRU\n\nclass Test(unittest.TestCase):\n def test_evict(self):\n c = TinyLRU(2)\n c.put(\"a\", 1)\n c.put(\"b\", 2)\n c.get(\"a\")\n c.put(\"c\", 3)\n self.assertIsNone(c.get(\"b\"))\n self.assertEqual(c.get(\"a\"), 1)\n self.assertEqual(c.get(\"c\"), 3)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_evict (test_solution.Test.test_evict) ... FAIL\n\n======================================================================\nFAIL: test_evict (test_solution.Test.test_evict)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-v9sxhjaz\\test_solution.py\", line 11, in test_evict\n self.assertIsNone(c.get(\"b\"))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: 2 is not None\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import OrderedDict\n\nclass TinyLRU:\n def __init__(self, capacity):\n if capacity < 1:\n raise ValueError(\"capacity\")\n self.capacity = capacity\n self._data = OrderedDict()\n\n def get(self, key):\n if key not in self._data:\n return None\n self._data.move_to_end(key)\n return self._data[key]\n\n def put(self, key, value):\n if key in self._data:\n self._data.move_to_end(key)\n self._data[key] = value\n else:\n self._data[key] = value\n if len(self._data) > self.capacity:\n self._data.popitem(last=False)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_evict (test_solution.Test.test_evict) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def first_ge(sorted_values, target):\n lo, hi = 0, len(sorted_values)\n while lo < hi:\n mid = (lo + hi) // 2\n if sorted_values[mid] < target:\n lo = mid + 1\n else:\n hi = mid\n return lo", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def first_ge(sorted_values, target):\n lo, hi = 0, len(sorted_values)\n while lo < hi:\n mid = (lo + hi) // 2\n if sorted_values[mid] < target:\n lo = mid + 1\n else:\n hi = mid\n return lo\n", "test_solution.py": "import unittest\nfrom solution import first_ge\n\nclass Test(unittest.TestCase):\n def test_mid(self):\n self.assertEqual(first_ge([1, 3, 3, 7, 9], 3), 1)\n def test_end(self):\n self.assertEqual(first_ge([1, 2, 4], 5), 3)\n def test_first(self):\n self.assertEqual(first_ge([2, 4, 6], 0), 0)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-binary-search-first-4a8714ec195f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.824999999999999}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "binary_search_first", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `first_ge(sorted_values, target)` returning the smallest index i\nsuch that sorted_values[i] >= target, or len(sorted_values) if none exists.\nThe list is sorted non-decreasing.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def first_ge(sorted_values, target):\n lo, hi = 0, len(sorted_values)\n while lo < hi:\n mid = (lo + hi) // 2\n if sorted_values[mid] < target:\n lo = mid + 1\n else:\n hi = mid\n return lo", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_end (test_solution.Test.test_end) ... ok\ntest_first (test_solution.Test.test_first) ... ok\ntest_mid (test_solution.Test.test_mid) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start <= out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start <= out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out\n", "test_solution.py": "import unittest\nfrom solution import merge_ranges\n\nclass Test(unittest.TestCase):\n def test_overlap(self):\n self.assertEqual(merge_ranges([[1, 3], [2, 6], [8, 10]]), [[1, 6], [8, 10]])\n def test_touch(self):\n self.assertEqual(merge_ranges([[1, 2], [2, 3]]), [[1, 3]])\n def test_empty(self):\n self.assertEqual(merge_ranges([]), [])\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-merge-intervals-cc5bc5fd01ac", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.5}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "merge_intervals", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `merge_ranges(ranges)` where each range is [start, end] with\nstart <= end. Return a new list of disjoint merged ranges sorted by start.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start <= out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_empty (test_solution.Test.test_empty) ... ok\ntest_overlap (test_solution.Test.test_overlap) ... ok\ntest_touch (test_solution.Test.test_touch) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start <= out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_empty (test_solution.Test.test_empty) ... ok\ntest_overlap (test_solution.Test.test_overlap) ... ok\ntest_touch (test_solution.Test.test_touch) ... FAIL\n\n======================================================================\nFAIL: test_touch (test_solution.Test.test_touch)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ajewpy74\\test_solution.py\", line 8, in test_touch\n self.assertEqual(merge_ranges([[1, 2], [2, 3]]), [[1, 3]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [[1, 2], [2, 3]] != [[1, 3]]\n\nFirst differing element 0:\n[1, 2]\n[1, 3]\n\nFirst list contains 1 additional elements.\nFirst extra element 1:\n[2, 3]\n\n- [[1, 2], [2, 3]]\n+ [[1, 3]]\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start < out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out\n", "test_solution.py": "import unittest\nfrom solution import merge_ranges\n\nclass Test(unittest.TestCase):\n def test_overlap(self):\n self.assertEqual(merge_ranges([[1, 3], [2, 6], [8, 10]]), [[1, 6], [8, 10]])\n def test_touch(self):\n self.assertEqual(merge_ranges([[1, 2], [2, 3]]), [[1, 3]])\n def test_empty(self):\n self.assertEqual(merge_ranges([]), [])\n"}}, "topic": "algorithms"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-merge-intervals-c50347851e38", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.875}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_empty (test_solution.Test.test_empty) ... ok\ntest_overlap (test_solution.Test.test_overlap) ... ok\ntest_touch (test_solution.Test.test_touch) ... FAIL\n\n======================================================================\nFAIL: test_touch (test_solution.Test.test_touch)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ajewpy74\\test_solution.py\", line 8, in test_touch\n self.assertEqual(merge_ranges([[1, 2], [2, 3]]), [[1, 3]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [[1, 2], [2, 3]] != [[1, 3]]\n\nFirst differing element 0:\n[1, 2]\n[1, 3]\n\nFirst list contains 1 additional elements.\nFirst extra element 1:\n[2, 3]\n\n- [[1, 2], [2, 3]]\n+ [[1, 3]]\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 2}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "merge_intervals", "tests_passed_after_fix": 3, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `merge_ranges(ranges)` where each range is [start, end] with\nstart <= end. Return a new list of disjoint merged ranges sorted by start.\n\n--- solution.py (buggy) ---\ndef merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start < out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import merge_ranges\n\nclass Test(unittest.TestCase):\n def test_overlap(self):\n self.assertEqual(merge_ranges([[1, 3], [2, 6], [8, 10]]), [[1, 6], [8, 10]])\n def test_touch(self):\n self.assertEqual(merge_ranges([[1, 2], [2, 3]]), [[1, 3]])\n def test_empty(self):\n self.assertEqual(merge_ranges([]), [])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_empty (test_solution.Test.test_empty) ... ok\ntest_overlap (test_solution.Test.test_overlap) ... ok\ntest_touch (test_solution.Test.test_touch) ... FAIL\n\n======================================================================\nFAIL: test_touch (test_solution.Test.test_touch)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ajewpy74\\test_solution.py\", line 8, in test_touch\n self.assertEqual(merge_ranges([[1, 2], [2, 3]]), [[1, 3]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [[1, 2], [2, 3]] != [[1, 3]]\n\nFirst differing element 0:\n[1, 2]\n[1, 3]\n\nFirst list contains 1 additional elements.\nFirst extra element 1:\n[2, 3]\n\n- [[1, 2], [2, 3]]\n+ [[1, 3]]\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def merge_ranges(ranges):\n if not ranges:\n return []\n ordered = sorted(ranges, key=lambda r: r[0])\n out = [list(ordered[0])]\n for start, end in ordered[1:]:\n if start <= out[-1][1]:\n out[-1][1] = max(out[-1][1], end)\n else:\n out.append([start, end])\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_empty (test_solution.Test.test_empty) ... ok\ntest_overlap (test_solution.Test.test_overlap) ... ok\ntest_touch (test_solution.Test.test_touch) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) == 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "assumptions": [], "concept_id": "python.collections", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) == 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order\n", "test_solution.py": "import unittest\nfrom solution import topo_sort\n\nclass Test(unittest.TestCase):\n def test_chain(self):\n order = topo_sort([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\")])\n self.assertEqual(order, [\"a\", \"b\", \"c\"])\n def test_cycle(self):\n with self.assertRaises(ValueError):\n topo_sort([\"a\", \"b\"], [(\"a\", \"b\"), (\"b\", \"a\")])\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-topo-order-50c5ec8cdc24", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.825, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.975, "tests": 0.0, "total": 4.9}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "topo_order", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `topo_sort(nodes, edges)` for a directed acyclic graph.\n`nodes` is a list of hashable ids. `edges` is a list of (src, dst) meaning\nsrc must come before dst. Return any valid topological order. Raise ValueError\nif a cycle exists.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) == 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_chain (test_solution.Test.test_chain) ... ok\ntest_cycle (test_solution.Test.test_cycle) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) == 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "assumptions": [], "concept_id": "python.collections", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_chain (test_solution.Test.test_chain) ... FAIL\ntest_cycle (test_solution.Test.test_cycle) ... ok\n\n======================================================================\nFAIL: test_chain (test_solution.Test.test_chain)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ucrcq27c\\test_solution.py\", line 7, in test_chain\n self.assertEqual(order, [\"a\", \"b\", \"c\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['b', 'c', 'c'] != ['a', 'b', 'c']\n\nFirst differing element 0:\n'b'\n'a'\n\n- ['b', 'c', 'c']\n+ ['a', 'b', 'c']\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) != 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order\n", "test_solution.py": "import unittest\nfrom solution import topo_sort\n\nclass Test(unittest.TestCase):\n def test_chain(self):\n order = topo_sort([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\")])\n self.assertEqual(order, [\"a\", \"b\", \"c\"])\n def test_cycle(self):\n with self.assertRaises(ValueError):\n topo_sort([\"a\", \"b\"], [(\"a\", \"b\"), (\"b\", \"a\")])\n"}}, "topic": "algorithms"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-topo-order-4b5906ec6df5", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.825, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.125}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_chain (test_solution.Test.test_chain) ... FAIL\ntest_cycle (test_solution.Test.test_cycle) ... ok\n\n======================================================================\nFAIL: test_chain (test_solution.Test.test_chain)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ucrcq27c\\test_solution.py\", line 7, in test_chain\n self.assertEqual(order, [\"a\", \"b\", \"c\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['b', 'c', 'c'] != ['a', 'b', 'c']\n\nFirst differing element 0:\n'b'\n'a'\n\n- ['b', 'c', 'c']\n+ ['a', 'b', 'c']\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 1}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "topo_order", "tests_passed_after_fix": 2, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `topo_sort(nodes, edges)` for a directed acyclic graph.\n`nodes` is a list of hashable ids. `edges` is a list of (src, dst) meaning\nsrc must come before dst. Return any valid topological order. Raise ValueError\nif a cycle exists.\n\n--- solution.py (buggy) ---\nfrom collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) != 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order\n\n--- test_solution.py ---\nimport unittest\nfrom solution import topo_sort\n\nclass Test(unittest.TestCase):\n def test_chain(self):\n order = topo_sort([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\")])\n self.assertEqual(order, [\"a\", \"b\", \"c\"])\n def test_cycle(self):\n with self.assertRaises(ValueError):\n topo_sort([\"a\", \"b\"], [(\"a\", \"b\"), (\"b\", \"a\")])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_chain (test_solution.Test.test_chain) ... FAIL\ntest_cycle (test_solution.Test.test_cycle) ... ok\n\n======================================================================\nFAIL: test_chain (test_solution.Test.test_chain)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ucrcq27c\\test_solution.py\", line 7, in test_chain\n self.assertEqual(order, [\"a\", \"b\", \"c\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['b', 'c', 'c'] != ['a', 'b', 'c']\n\nFirst differing element 0:\n'b'\n'a'\n\n- ['b', 'c', 'c']\n+ ['a', 'b', 'c']\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import defaultdict, deque\n\ndef topo_sort(nodes, edges):\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for src, dst in edges:\n graph[src].append(dst)\n incoming[dst] = incoming.get(dst, 0) + 1\n incoming.setdefault(src, incoming.get(src, 0))\n ready = deque([n for n in nodes if incoming.get(n, 0) == 0])\n order = []\n while ready:\n node = ready.popleft()\n order.append(node)\n for nxt in graph[node]:\n incoming[nxt] -= 1\n if incoming[nxt] == 0:\n ready.append(nxt)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_chain (test_solution.Test.test_chain) ... ok\ntest_cycle (test_solution.Test.test_cycle) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node == goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None", "assumptions": [], "concept_id": "python.loops", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node == goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None\n", "test_solution.py": "import unittest\nfrom solution import shortest_cost\n\nclass Test(unittest.TestCase):\n def test_path(self):\n g = {\"s\": [(\"a\", 2), (\"b\", 5)], \"a\": [(\"g\", 2)], \"b\": [(\"g\", 1)], \"g\": []}\n self.assertEqual(shortest_cost(g, \"s\", \"g\"), 4)\n def test_missing(self):\n self.assertIsNone(shortest_cost({\"s\": []}, \"s\", \"z\"))\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-dijkstra-hops-3cc79c98ed19", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 4.4}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dijkstra_hops", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `shortest_cost(graph, start, goal)` where graph maps node ->\nlist of (neighbor, weight) with non-negative weights. Return the minimum cost\nor None if unreachable.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node == goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_missing (test_solution.Test.test_missing) ... ok\ntest_path (test_solution.Test.test_path) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node == goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_missing (test_solution.Test.test_missing) ... FAIL\ntest_path (test_solution.Test.test_path) ... FAIL\n\n======================================================================\nFAIL: test_missing (test_solution.Test.test_missing)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4tt_bkpa\\test_solution.py\", line 9, in test_missing\n self.assertIsNone(shortest_cost({\"s\": []}, \"s\", \"z\"))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 is not None\n\n======================================================================\nFAIL: test_path (test_solution.Test.test_path)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4tt_bkpa\\test_solution.py\", line 7, in test_path\n self.assertEqual(shortest_cost(g, \"s\", \"g\"), 4)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 != 4\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=2)\n"}, "language": "python", "repository": {"files": {"solution.py": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node != goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None\n", "test_solution.py": "import unittest\nfrom solution import shortest_cost\n\nclass Test(unittest.TestCase):\n def test_path(self):\n g = {\"s\": [(\"a\", 2), (\"b\", 5)], \"a\": [(\"g\", 2)], \"b\": [(\"g\", 1)], \"g\": []}\n self.assertEqual(shortest_cost(g, \"s\", \"g\"), 4)\n def test_missing(self):\n self.assertIsNone(shortest_cost({\"s\": []}, \"s\", \"z\"))\n"}}, "topic": "algorithms"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-dijkstra-hops-2b627cabae14", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 2, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_missing (test_solution.Test.test_missing) ... FAIL\ntest_path (test_solution.Test.test_path) ... FAIL\n\n======================================================================\nFAIL: test_missing (test_solution.Test.test_missing)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4tt_bkpa\\test_solution.py\", line 9, in test_missing\n self.assertIsNone(shortest_cost({\"s\": []}, \"s\", \"z\"))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 is not None\n\n======================================================================\nFAIL: test_path (test_solution.Test.test_path)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4tt_bkpa\\test_solution.py\", line 7, in test_path\n self.assertEqual(shortest_cost(g, \"s\", \"g\"), 4)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 != 4\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=2)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 2, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dijkstra_hops", "tests_passed_after_fix": 2, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `shortest_cost(graph, start, goal)` where graph maps node ->\nlist of (neighbor, weight) with non-negative weights. Return the minimum cost\nor None if unreachable.\n\n--- solution.py (buggy) ---\nimport heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node != goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None\n\n--- test_solution.py ---\nimport unittest\nfrom solution import shortest_cost\n\nclass Test(unittest.TestCase):\n def test_path(self):\n g = {\"s\": [(\"a\", 2), (\"b\", 5)], \"a\": [(\"g\", 2)], \"b\": [(\"g\", 1)], \"g\": []}\n self.assertEqual(shortest_cost(g, \"s\", \"g\"), 4)\n def test_missing(self):\n self.assertIsNone(shortest_cost({\"s\": []}, \"s\", \"z\"))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_missing (test_solution.Test.test_missing) ... FAIL\ntest_path (test_solution.Test.test_path) ... FAIL\n\n======================================================================\nFAIL: test_missing (test_solution.Test.test_missing)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4tt_bkpa\\test_solution.py\", line 9, in test_missing\n self.assertIsNone(shortest_cost({\"s\": []}, \"s\", \"z\"))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 is not None\n\n======================================================================\nFAIL: test_path (test_solution.Test.test_path)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4tt_bkpa\\test_solution.py\", line 7, in test_path\n self.assertEqual(shortest_cost(g, \"s\", \"g\"), 4)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 != 4\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=2)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import heapq\n\ndef shortest_cost(graph, start, goal):\n best = {start: 0}\n heap = [(0, start)]\n while heap:\n cost, node = heapq.heappop(heap)\n if cost != best.get(node, None):\n continue\n if node == goal:\n return cost\n for nxt, weight in graph.get(node, []):\n cand = cost + weight\n if cand < best.get(nxt, float(\"inf\")):\n best[nxt] = cand\n heapq.heappush(heap, (cand, nxt))\n return None", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_missing (test_solution.Test.test_missing) ... ok\ntest_path (test_solution.Test.test_path) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import heapq\n\nclass RunningMedian:\n def __init__(self):\n self.low = []\n self.high = []\n\n def add(self, x):\n if not self.low or x <= -self.low[0]:\n heapq.heappush(self.low, -x)\n else:\n heapq.heappush(self.high, x)\n if len(self.low) > len(self.high) + 1:\n heapq.heappush(self.high, -heapq.heappop(self.low))\n elif len(self.high) > len(self.low):\n heapq.heappush(self.low, -heapq.heappop(self.high))\n\n def median(self):\n if not self.low:\n raise ValueError(\"empty\")\n if len(self.low) > len(self.high):\n return float(-self.low[0])\n return (-self.low[0] + self.high[0]) / 2.0", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import heapq\n\nclass RunningMedian:\n def __init__(self):\n self.low = []\n self.high = []\n\n def add(self, x):\n if not self.low or x <= -self.low[0]:\n heapq.heappush(self.low, -x)\n else:\n heapq.heappush(self.high, x)\n if len(self.low) > len(self.high) + 1:\n heapq.heappush(self.high, -heapq.heappop(self.low))\n elif len(self.high) > len(self.low):\n heapq.heappush(self.low, -heapq.heappop(self.high))\n\n def median(self):\n if not self.low:\n raise ValueError(\"empty\")\n if len(self.low) > len(self.high):\n return float(-self.low[0])\n return (-self.low[0] + self.high[0]) / 2.0\n", "test_solution.py": "import unittest\nfrom solution import RunningMedian\n\nclass Test(unittest.TestCase):\n def test_stream(self):\n r = RunningMedian()\n for x in [5, 2, 8, 1]:\n r.add(x)\n self.assertEqual(r.median(), 3.5)\n"}}, "topic": "data_structures"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-heap-median-ebe3df4f8fd3", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 6.225}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "heap_median", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement class `RunningMedian` with `add(x)` and `median()` (mean of the\ntwo center values when the count is even). Values are numbers.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import heapq\n\nclass RunningMedian:\n def __init__(self):\n self.low = []\n self.high = []\n\n def add(self, x):\n if not self.low or x <= -self.low[0]:\n heapq.heappush(self.low, -x)\n else:\n heapq.heappush(self.high, x)\n if len(self.low) > len(self.high) + 1:\n heapq.heappush(self.high, -heapq.heappop(self.low))\n elif len(self.high) > len(self.low):\n heapq.heappush(self.low, -heapq.heappop(self.high))\n\n def median(self):\n if not self.low:\n raise ValueError(\"empty\")\n if len(self.low) > len(self.high):\n return float(-self.low[0])\n return (-self.low[0] + self.high[0]) / 2.0", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_stream (test_solution.Test.test_stream) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def parse_kv(text):\n result = {}\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n if \"=\" not in line:\n raise ValueError(line)\n key, value = line.split(\"=\", 1)\n result[key.strip()] = value.strip()\n return result", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def parse_kv(text):\n result = {}\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n if \"=\" not in line:\n raise ValueError(line)\n key, value = line.split(\"=\", 1)\n result[key.strip()] = value.strip()\n return result\n", "test_solution.py": "import unittest\nfrom solution import parse_kv\n\nclass Test(unittest.TestCase):\n def test_parse(self):\n text = \"# c\\nport = 80\\nhost = a=b\\nport = 8080\\n\"\n self.assertEqual(parse_kv(text), {\"port\": \"8080\", \"host\": \"a=b\"})\n def test_bad(self):\n with self.assertRaises(ValueError):\n parse_kv(\"oops\")\n"}}, "topic": "configuration"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-parse-kv-config-761c659cab58", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 1.05, "tests": 0.0, "total": 4.6000000000000005}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "parse_kv_config", "topic": "configuration"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `parse_kv(text)` for a tiny config language:\n- ignore blank lines and lines starting with `#`\n- remaining lines are `key = value` (value trimmed, may contain =)\n- duplicate keys: last wins\nReturn a dict. Raise ValueError on lines without `=`.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:26Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def parse_kv(text):\n result = {}\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n if \"=\" not in line:\n raise ValueError(line)\n key, value = line.split(\"=\", 1)\n result[key.strip()] = value.strip()\n return result", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_parse (test_solution.Test.test_parse) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def cmp_semver(a, b):\n def parts(s):\n bits = s.split(\".\")\n if len(bits) != 3 or not all(p.isdigit() for p in bits):\n raise ValueError(s)\n return tuple(int(p) for p in bits)\n left, right = parts(a), parts(b)\n return (left > right) - (left < right)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def cmp_semver(a, b):\n def parts(s):\n bits = s.split(\".\")\n if len(bits) != 3 or not all(p.isdigit() for p in bits):\n raise ValueError(s)\n return tuple(int(p) for p in bits)\n left, right = parts(a), parts(b)\n return (left > right) - (left < right)\n", "test_solution.py": "import unittest\nfrom solution import cmp_semver\n\nclass Test(unittest.TestCase):\n def test_cmp(self):\n self.assertEqual(cmp_semver(\"1.2.0\", \"1.10.0\"), -1)\n self.assertEqual(cmp_semver(\"2.0.0\", \"2.0.0\"), 0)\n self.assertEqual(cmp_semver(\"1.0.1\", \"1.0.0\"), 1)\n"}}, "topic": "package_management"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-semver-core-cmp-af727ae91767", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.375, "tests": 0.0, "total": 3.9250000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "semver_core_cmp", "topic": "package_management"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `cmp_semver(a, b)` comparing MAJOR.MINOR.PATCH strings (digits\nonly, no pre-release). Return -1, 0, or 1.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def cmp_semver(a, b):\n def parts(s):\n bits = s.split(\".\")\n if len(bits) != 3 or not all(p.isdigit() for p in bits):\n raise ValueError(s)\n return tuple(int(p) for p in bits)\n left, right = parts(a), parts(b)\n return (left > right) - (left < right)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cmp (test_solution.Test.test_cmp) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def cmp_semver(a, b):\n def parts(s):\n bits = s.split(\".\")\n if len(bits) != 3 or not all(p.isdigit() for p in bits):\n raise ValueError(s)\n return tuple(int(p) for p in bits)\n left, right = parts(a), parts(b)\n return (left > right) - (left < right)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_cmp (test_solution.Test.test_cmp) ... FAIL\n\n======================================================================\nFAIL: test_cmp (test_solution.Test.test_cmp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ez7l14g8\\test_solution.py\", line 6, in test_cmp\n self.assertEqual(cmp_semver(\"1.2.0\", \"1.10.0\"), -1)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 1 != -1\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def cmp_semver(a, b):\n return (a > b) - (a < b)\n", "test_solution.py": "import unittest\nfrom solution import cmp_semver\n\nclass Test(unittest.TestCase):\n def test_cmp(self):\n self.assertEqual(cmp_semver(\"1.2.0\", \"1.10.0\"), -1)\n self.assertEqual(cmp_semver(\"2.0.0\", \"2.0.0\"), 0)\n self.assertEqual(cmp_semver(\"1.0.1\", \"1.0.0\"), 1)\n"}}, "topic": "package_management"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-semver-core-cmp-753c78f38a4b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.3, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 2.95, "tests": 0.0, "total": 9.55}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_cmp (test_solution.Test.test_cmp) ... FAIL\n\n======================================================================\nFAIL: test_cmp (test_solution.Test.test_cmp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ez7l14g8\\test_solution.py\", line 6, in test_cmp\n self.assertEqual(cmp_semver(\"1.2.0\", \"1.10.0\"), -1)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 1 != -1\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "semver_core_cmp", "tests_passed_after_fix": 1, "topic": "package_management"}, "natural_language": "en", "observations": ["Compares as strings so 1.10.0 < 1.2.0."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `cmp_semver(a, b)` comparing MAJOR.MINOR.PATCH strings (digits\nonly, no pre-release). Return -1, 0, or 1.\n\n--- solution.py (buggy) ---\ndef cmp_semver(a, b):\n return (a > b) - (a < b)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import cmp_semver\n\nclass Test(unittest.TestCase):\n def test_cmp(self):\n self.assertEqual(cmp_semver(\"1.2.0\", \"1.10.0\"), -1)\n self.assertEqual(cmp_semver(\"2.0.0\", \"2.0.0\"), 0)\n self.assertEqual(cmp_semver(\"1.0.1\", \"1.0.0\"), 1)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_cmp (test_solution.Test.test_cmp) ... FAIL\n\n======================================================================\nFAIL: test_cmp (test_solution.Test.test_cmp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ez7l14g8\\test_solution.py\", line 6, in test_cmp\n self.assertEqual(cmp_semver(\"1.2.0\", \"1.10.0\"), -1)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 1 != -1\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def cmp_semver(a, b):\n def parts(s):\n bits = s.split(\".\")\n if len(bits) != 3 or not all(p.isdigit() for p in bits):\n raise ValueError(s)\n return tuple(int(p) for p in bits)\n left, right = parts(a), parts(b)\n return (left > right) - (left < right)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cmp (test_solution.Test.test_cmp) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return True", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return True\n", "test_solution.py": "import unittest\nfrom solution import pins_ok\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertTrue(pins_ok({\"a\": (1, 2, 0)}, {\"a\": (1, 2, 3), \"b\": (0, 1, 0)}))\n def test_missing(self):\n self.assertFalse(pins_ok({\"a\": (1, 0, 0)}, {}))\n def test_old(self):\n self.assertFalse(pins_ok({\"a\": (2, 0, 0)}, {\"a\": (1, 9, 9)}))\n"}}, "topic": "dependency_resolution"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-dep-resolution-pins-c28ab4b294ab", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.95, "tests": 0.0, "total": 4.2749999999999995}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dep_resolution_pins", "topic": "dependency_resolution"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `pins_ok(declared, locked)` where declared maps package ->\nminimum inclusive version tuple (major, minor, patch) and locked maps package\n-> installed version tuple. Every declared package must be present and\ninstalled >= minimum. Extra locked packages are allowed.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return True", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_missing (test_solution.Test.test_missing) ... ok\ntest_ok (test_solution.Test.test_ok) ... ok\ntest_old (test_solution.Test.test_old) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return True", "assumptions": [], "concept_id": "python.modules", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_missing (test_solution.Test.test_missing) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\ntest_old (test_solution.Test.test_old) ... ok\n\n======================================================================\nFAIL: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-70mezklv\\test_solution.py\", line 6, in test_ok\n self.assertTrue(pins_ok({\"a\": (1, 2, 0)}, {\"a\": (1, 2, 3), \"b\": (0, 1, 0)}))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return False\n", "test_solution.py": "import unittest\nfrom solution import pins_ok\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertTrue(pins_ok({\"a\": (1, 2, 0)}, {\"a\": (1, 2, 3), \"b\": (0, 1, 0)}))\n def test_missing(self):\n self.assertFalse(pins_ok({\"a\": (1, 0, 0)}, {}))\n def test_old(self):\n self.assertFalse(pins_ok({\"a\": (2, 0, 0)}, {\"a\": (1, 9, 9)}))\n"}}, "topic": "dependency_resolution"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-dep-resolution-pins-207430cc282d", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_missing (test_solution.Test.test_missing) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\ntest_old (test_solution.Test.test_old) ... ok\n\n======================================================================\nFAIL: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-70mezklv\\test_solution.py\", line 6, in test_ok\n self.assertTrue(pins_ok({\"a\": (1, 2, 0)}, {\"a\": (1, 2, 3), \"b\": (0, 1, 0)}))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 2}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dep_resolution_pins", "tests_passed_after_fix": 3, "topic": "dependency_resolution"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `pins_ok(declared, locked)` where declared maps package ->\nminimum inclusive version tuple (major, minor, patch) and locked maps package\n-> installed version tuple. Every declared package must be present and\ninstalled >= minimum. Extra locked packages are allowed.\n\n--- solution.py (buggy) ---\ndef pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return False\n\n--- test_solution.py ---\nimport unittest\nfrom solution import pins_ok\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertTrue(pins_ok({\"a\": (1, 2, 0)}, {\"a\": (1, 2, 3), \"b\": (0, 1, 0)}))\n def test_missing(self):\n self.assertFalse(pins_ok({\"a\": (1, 0, 0)}, {}))\n def test_old(self):\n self.assertFalse(pins_ok({\"a\": (2, 0, 0)}, {\"a\": (1, 9, 9)}))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_missing (test_solution.Test.test_missing) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\ntest_old (test_solution.Test.test_old) ... ok\n\n======================================================================\nFAIL: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-70mezklv\\test_solution.py\", line 6, in test_ok\n self.assertTrue(pins_ok({\"a\": (1, 2, 0)}, {\"a\": (1, 2, 3), \"b\": (0, 1, 0)}))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def pins_ok(declared, locked):\n for name, minimum in declared.items():\n if name not in locked:\n return False\n if locked[name] < minimum:\n return False\n return True", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_missing (test_solution.Test.test_missing) ... ok\ntest_ok (test_solution.Test.test_ok) ... ok\ntest_old (test_solution.Test.test_old) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' + name.replace('\"', '\"\"') + '\"'", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' + name.replace('\"', '\"\"') + '\"'\n", "test_solution.py": "import unittest\nfrom solution import quote_ident\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertEqual(quote_ident(\"user_id\"), '\"user_id\"')\n def test_reject(self):\n with self.assertRaises(ValueError):\n quote_ident(\"user-id\")\n with self.assertRaises(ValueError):\n quote_ident(\"1x\")\n"}}, "topic": "databases"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-sql-ident-quote-d0a22efbb77f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 6.625}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "sql_ident_quote", "topic": "databases"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `quote_ident(name)` for a conservative SQL identifier:\naccept only `[A-Za-z_][A-Za-z0-9_]*` and wrap in double quotes with internal\nquotes doubled. Raise ValueError otherwise. This is defensive quoting, not a\nparser for arbitrary SQL.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' + name.replace('\"', '\"\"') + '\"'", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ok (test_solution.Test.test_ok) ... ok\ntest_reject (test_solution.Test.test_reject) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' + name.replace('\"', '\"\"') + '\"'", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_ok (test_solution.Test.test_ok) ... ERROR\ntest_reject (test_solution.Test.test_reject) ... ok\n\n======================================================================\nERROR: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-o5h0j4in\\test_solution.py\", line 6, in test_ok\n self.assertEqual(quote_ident(\"user_id\"), '\"user_id\"')\n ~~~~~~~~~~~^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-o5h0j4in\\solution.py\", line 6, in quote_ident\n return '\"' - name.replace('\"', '\"\"') + '\"'\n ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (errors=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' - name.replace('\"', '\"\"') + '\"'\n", "test_solution.py": "import unittest\nfrom solution import quote_ident\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertEqual(quote_ident(\"user_id\"), '\"user_id\"')\n def test_reject(self):\n with self.assertRaises(ValueError):\n quote_ident(\"user-id\")\n with self.assertRaises(ValueError):\n quote_ident(\"1x\")\n"}}, "topic": "databases"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-sql-ident-quote-641bd19a2c68", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 1, "failures": 0, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_ok (test_solution.Test.test_ok) ... ERROR\ntest_reject (test_solution.Test.test_reject) ... ok\n\n======================================================================\nERROR: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-o5h0j4in\\test_solution.py\", line 6, in test_ok\n self.assertEqual(quote_ident(\"user_id\"), '\"user_id\"')\n ~~~~~~~~~~~^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-o5h0j4in\\solution.py\", line 6, in quote_ident\n return '\"' - name.replace('\"', '\"\"') + '\"'\n ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (errors=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 1}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "sql_ident_quote", "tests_passed_after_fix": 2, "topic": "databases"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `quote_ident(name)` for a conservative SQL identifier:\naccept only `[A-Za-z_][A-Za-z0-9_]*` and wrap in double quotes with internal\nquotes doubled. Raise ValueError otherwise. This is defensive quoting, not a\nparser for arbitrary SQL.\n\n--- solution.py (buggy) ---\nimport re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' - name.replace('\"', '\"\"') + '\"'\n\n--- test_solution.py ---\nimport unittest\nfrom solution import quote_ident\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertEqual(quote_ident(\"user_id\"), '\"user_id\"')\n def test_reject(self):\n with self.assertRaises(ValueError):\n quote_ident(\"user-id\")\n with self.assertRaises(ValueError):\n quote_ident(\"1x\")\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_ok (test_solution.Test.test_ok) ... ERROR\ntest_reject (test_solution.Test.test_reject) ... ok\n\n======================================================================\nERROR: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-o5h0j4in\\test_solution.py\", line 6, in test_ok\n self.assertEqual(quote_ident(\"user_id\"), '\"user_id\"')\n ~~~~~~~~~~~^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-o5h0j4in\\solution.py\", line 6, in quote_ident\n return '\"' - name.replace('\"', '\"\"') + '\"'\n ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~\nTypeError: unsupported operand type(s) for -: 'str' and 'str'\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (errors=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef quote_ident(name):\n if not re.fullmatch(r\"[A-Za-z_][A-Za-z0-9_]*\", name):\n raise ValueError(\"invalid identifier\")\n return '\"' + name.replace('\"', '\"\"') + '\"'", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ok (test_solution.Test.test_ok) ... ok\ntest_reject (test_solution.Test.test_reject) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import re\n\ndef safe_select_by_id(conn, table, row_id):\n if not re.fullmatch(r\"[a-z_]+\", table):\n raise ValueError(\"table\")\n sql = f'SELECT * FROM \"{table}\" WHERE id = ?'\n return list(conn.execute(sql, (row_id,)))", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef safe_select_by_id(conn, table, row_id):\n if not re.fullmatch(r\"[a-z_]+\", table):\n raise ValueError(\"table\")\n sql = f'SELECT * FROM \"{table}\" WHERE id = ?'\n return list(conn.execute(sql, (row_id,)))\n", "test_solution.py": "import sqlite3\nimport unittest\nfrom solution import safe_select_by_id\n\nclass Test(unittest.TestCase):\n def setUp(self):\n self.conn = sqlite3.connect(\":memory:\")\n self.conn.execute(\"CREATE TABLE items (id INTEGER, name TEXT)\")\n self.conn.execute(\"INSERT INTO items VALUES (1, 'a'), (2, 'b')\")\n\n def test_param(self):\n rows = safe_select_by_id(self.conn, \"items\", 2)\n self.assertEqual(rows, [(2, \"b\")])\n\n def test_injection_value(self):\n rows = safe_select_by_id(self.conn, \"items\", \"2 OR 1=1\")\n self.assertEqual(rows, [])\n\n def test_bad_table(self):\n with self.assertRaises(ValueError):\n safe_select_by_id(self.conn, \"items;drop\", 1)\n"}}, "topic": "defensive_security"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-parameterized-filter-2992f1833ac8", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.75, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.875, "tests": 0.0, "total": 5.35}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "parameterized_filter", "topic": "defensive_security"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `safe_select_by_id(conn, table, row_id)` using sqlite3.\n`table` must match `[a-z_]+`. Execute a parameterized query\n`SELECT * FROM {table} WHERE id = ?` and return the list of rows.\nNever interpolate `row_id` into the SQL string.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef safe_select_by_id(conn, table, row_id):\n if not re.fullmatch(r\"[a-z_]+\", table):\n raise ValueError(\"table\")\n sql = f'SELECT * FROM \"{table}\" WHERE id = ?'\n return list(conn.execute(sql, (row_id,)))", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad_table (test_solution.Test.test_bad_table) ... ok\ntest_injection_value (test_solution.Test.test_injection_value) ... ok\ntest_param (test_solution.Test.test_param) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.001s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "from pathlib import Path\n\ndef resolve_under(root, relative):\n base = Path(root).resolve()\n target = (base / relative).resolve()\n try:\n target.relative_to(base)\n except ValueError as exc:\n raise ValueError(\"escape\") from exc\n return str(target)", "assumptions": [], "concept_id": "python.exceptions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from pathlib import Path\n\ndef resolve_under(root, relative):\n base = Path(root).resolve()\n target = (base / relative).resolve()\n try:\n target.relative_to(base)\n except ValueError as exc:\n raise ValueError(\"escape\") from exc\n return str(target)\n", "test_solution.py": "import tempfile\nimport unittest\nfrom pathlib import Path\nfrom solution import resolve_under\n\nclass Test(unittest.TestCase):\n def test_inside(self):\n with tempfile.TemporaryDirectory() as td:\n p = resolve_under(td, \"a/b.txt\")\n self.assertTrue(p.startswith(str(Path(td).resolve())))\n def test_escape(self):\n with tempfile.TemporaryDirectory() as td:\n with self.assertRaises(ValueError):\n resolve_under(td, \"../secret\")\n"}}, "topic": "defensive_security"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-path-confine-9bfc484ac11f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.7, "tests": 0.0, "total": 4.199999999999999}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "path_confine", "topic": "defensive_security"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `resolve_under(root, relative)` that joins `relative` to `root`\nand returns the resolved path only if it stays inside `root`. Reject `..`\nescapes. Use pathlib. Raise ValueError on escape.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from pathlib import Path\n\ndef resolve_under(root, relative):\n base = Path(root).resolve()\n target = (base / relative).resolve()\n try:\n target.relative_to(base)\n except ValueError as exc:\n raise ValueError(\"escape\") from exc\n return str(target)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_escape (test_solution.Test.test_escape) ... ok\ntest_inside (test_solution.Test.test_inside) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.004s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import ipaddress\n\ndef ipv4_in_cidr(ip, cidr):\n return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import ipaddress\n\ndef ipv4_in_cidr(ip, cidr):\n return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False)\n", "test_solution.py": "import unittest\nfrom solution import ipv4_in_cidr\n\nclass Test(unittest.TestCase):\n def test_in(self):\n self.assertTrue(ipv4_in_cidr(\"10.1.2.3\", \"10.0.0.0/8\"))\n def test_out(self):\n self.assertFalse(ipv4_in_cidr(\"11.0.0.1\", \"10.0.0.0/8\"))\n def test_exact(self):\n self.assertTrue(ipv4_in_cidr(\"192.0.2.1\", \"192.0.2.1/32\"))\n"}}, "topic": "networking"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-cidr-contains-880e214734b6", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.675, "tests": 0.0, "total": 3.8000000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "cidr_contains", "topic": "networking"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `ipv4_in_cidr(ip, cidr)` where ip is dotted IPv4 and cidr is\nlike `10.0.0.0/8`. Return True iff the address is in the prefix. No extra\nlibraries beyond stdlib.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import ipaddress\n\ndef ipv4_in_cidr(ip, cidr):\n return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_exact (test_solution.Test.test_exact) ... ok\ntest_in (test_solution.Test.test_in) ... ok\ntest_out (test_solution.Test.test_out) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) + burst\n done.append(time)\n return done", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) + burst\n done.append(time)\n return done\n", "test_solution.py": "import unittest\nfrom solution import fcfs_completion\n\nclass Test(unittest.TestCase):\n def test_idle(self):\n self.assertEqual(fcfs_completion([(0, 3), (5, 2)]), [3, 7])\n def test_queue(self):\n self.assertEqual(fcfs_completion([(0, 2), (1, 2)]), [2, 4])\n"}}, "topic": "operating_systems"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-fcfs-finish-72e6ead16506", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 1.0, "tests": 0.0, "total": 4.275}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "fcfs_finish", "topic": "operating_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `fcfs_completion(jobs)` where each job is (arrival, burst) and\njobs are already ordered by arrival time (ties keep given order). Return a list\nof completion times in the same order. The CPU is idle until the next arrival\nif needed.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) + burst\n done.append(time)\n return done", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_idle (test_solution.Test.test_idle) ... ok\ntest_queue (test_solution.Test.test_queue) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) + burst\n done.append(time)\n return done", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_idle (test_solution.Test.test_idle) ... FAIL\ntest_queue (test_solution.Test.test_queue) ... FAIL\n\n======================================================================\nFAIL: test_idle (test_solution.Test.test_idle)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0uak84hz\\test_solution.py\", line 6, in test_idle\n self.assertEqual(fcfs_completion([(0, 3), (5, 2)]), [3, 7])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [-3, 3] != [3, 7]\n\nFirst differing element 0:\n-3\n3\n\n- [-3, 3]\n? - ^\n\n+ [3, 7]\n? ^\n\n\n======================================================================\nFAIL: test_queue (test_solution.Test.test_queue)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0uak84hz\\test_solution.py\", line 8, in test_queue\n self.assertEqual(fcfs_completion([(0, 2), (1, 2)]), [2, 4])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [-2, -1] != [2, 4]\n\nFirst differing element 0:\n-2\n2\n\n- [-2, -1]\n+ [2, 4]\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=2)\n"}, "language": "python", "repository": {"files": {"solution.py": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) - burst\n done.append(time)\n return done\n", "test_solution.py": "import unittest\nfrom solution import fcfs_completion\n\nclass Test(unittest.TestCase):\n def test_idle(self):\n self.assertEqual(fcfs_completion([(0, 3), (5, 2)]), [3, 7])\n def test_queue(self):\n self.assertEqual(fcfs_completion([(0, 2), (1, 2)]), [2, 4])\n"}}, "topic": "operating_systems"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-fcfs-finish-66f11bf0a1aa", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.725}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 2, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_idle (test_solution.Test.test_idle) ... FAIL\ntest_queue (test_solution.Test.test_queue) ... FAIL\n\n======================================================================\nFAIL: test_idle (test_solution.Test.test_idle)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0uak84hz\\test_solution.py\", line 6, in test_idle\n self.assertEqual(fcfs_completion([(0, 3), (5, 2)]), [3, 7])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [-3, 3] != [3, 7]\n\nFirst differing element 0:\n-3\n3\n\n- [-3, 3]\n? - ^\n\n+ [3, 7]\n? ^\n\n\n======================================================================\nFAIL: test_queue (test_solution.Test.test_queue)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0uak84hz\\test_solution.py\", line 8, in test_queue\n self.assertEqual(fcfs_completion([(0, 2), (1, 2)]), [2, 4])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [-2, -1] != [2, 4]\n\nFirst differing element 0:\n-2\n2\n\n- [-2, -1]\n+ [2, 4]\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=2)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 2, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "fcfs_finish", "tests_passed_after_fix": 2, "topic": "operating_systems"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `fcfs_completion(jobs)` where each job is (arrival, burst) and\njobs are already ordered by arrival time (ties keep given order). Return a list\nof completion times in the same order. The CPU is idle until the next arrival\nif needed.\n\n--- solution.py (buggy) ---\ndef fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) - burst\n done.append(time)\n return done\n\n--- test_solution.py ---\nimport unittest\nfrom solution import fcfs_completion\n\nclass Test(unittest.TestCase):\n def test_idle(self):\n self.assertEqual(fcfs_completion([(0, 3), (5, 2)]), [3, 7])\n def test_queue(self):\n self.assertEqual(fcfs_completion([(0, 2), (1, 2)]), [2, 4])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 2, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_idle (test_solution.Test.test_idle) ... FAIL\ntest_queue (test_solution.Test.test_queue) ... FAIL\n\n======================================================================\nFAIL: test_idle (test_solution.Test.test_idle)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0uak84hz\\test_solution.py\", line 6, in test_idle\n self.assertEqual(fcfs_completion([(0, 3), (5, 2)]), [3, 7])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [-3, 3] != [3, 7]\n\nFirst differing element 0:\n-3\n3\n\n- [-3, 3]\n? - ^\n\n+ [3, 7]\n? ^\n\n\n======================================================================\nFAIL: test_queue (test_solution.Test.test_queue)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0uak84hz\\test_solution.py\", line 8, in test_queue\n self.assertEqual(fcfs_completion([(0, 2), (1, 2)]), [2, 4])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [-2, -1] != [2, 4]\n\nFirst differing element 0:\n-2\n2\n\n- [-2, -1]\n+ [2, 4]\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=2)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def fcfs_completion(jobs):\n time = 0\n done = []\n for arrival, burst in jobs:\n time = max(time, arrival) + burst\n done.append(time)\n return done", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_idle (test_solution.Test.test_idle) ... ok\ntest_queue (test_solution.Test.test_queue) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] == 0:\n finish[i] = t\n else:\n q.append(i)\n return finish", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] == 0:\n finish[i] = t\n else:\n q.append(i)\n return finish\n", "test_solution.py": "import unittest\nfrom solution import rr_finish\n\nclass Test(unittest.TestCase):\n def test_rr(self):\n self.assertEqual(rr_finish([5, 3, 1], 2), [9, 8, 5])\n"}}, "topic": "operating_systems"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-round-robin-trace-992838c315ea", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 3.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 7.8}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "round_robin_trace", "topic": "operating_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `rr_finish(bursts, quantum)` for processes all arriving at 0,\nindexed 0..n-1, using a FIFO ready queue. Return completion times list.\nIgnore context-switch cost.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] == 0:\n finish[i] = t\n else:\n q.append(i)\n return finish", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_rr (test_solution.Test.test_rr) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] == 0:\n finish[i] = t\n else:\n q.append(i)\n return finish", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "\ntest_rr (test_solution.Test.test_rr) ... "}, "language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] != 0:\n finish[i] = t\n else:\n q.append(i)\n return finish\n", "test_solution.py": "import unittest\nfrom solution import rr_finish\n\nclass Test(unittest.TestCase):\n def test_rr(self):\n self.assertEqual(rr_finish([5, 3, 1], 2), [9, 8, 5])\n"}}, "topic": "operating_systems"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-round-robin-trace-426b74f925fc", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 3.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 2.9, "tests": 0.0, "total": 12.825}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {}, "timed_out": true}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_rr (test_solution.Test.test_rr) ... ", "stdout": "", "tests_failed": null, "tests_passed": null}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "round_robin_trace", "tests_passed_after_fix": 1, "topic": "operating_systems"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `rr_finish(bursts, quantum)` for processes all arriving at 0,\nindexed 0..n-1, using a FIFO ready queue. Return completion times list.\nIgnore context-switch cost.\n\n--- solution.py (buggy) ---\nfrom collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] != 0:\n finish[i] = t\n else:\n q.append(i)\n return finish\n\n--- test_solution.py ---\nimport unittest\nfrom solution import rr_finish\n\nclass Test(unittest.TestCase):\n def test_rr(self):\n self.assertEqual(rr_finish([5, 3, 1], 2), [9, 8, 5])\n\n--- failure ---\n\ntest_rr (test_solution.Test.test_rr) ...", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:27Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\ndef rr_finish(bursts, quantum):\n remaining = list(bursts)\n finish = [None] * len(bursts)\n q = deque(range(len(bursts)))\n t = 0\n while q:\n i = q.popleft()\n run = min(quantum, remaining[i])\n remaining[i] -= run\n t += run\n if remaining[i] == 0:\n finish[i] = t\n else:\n q.append(i)\n return finish", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_rr (test_solution.Test.test_rr) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def lru_faults(pages, frames):\n slot = []\n used = []\n faults = 0\n for page in pages:\n if page in slot:\n used.remove(page)\n used.append(page)\n continue\n faults += 1\n if len(slot) < frames:\n slot.append(page)\n else:\n victim = used.pop(0)\n idx = slot.index(victim)\n slot[idx] = page\n used.append(page)\n return faults", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def lru_faults(pages, frames):\n slot = []\n used = []\n faults = 0\n for page in pages:\n if page in slot:\n used.remove(page)\n used.append(page)\n continue\n faults += 1\n if len(slot) < frames:\n slot.append(page)\n else:\n victim = used.pop(0)\n idx = slot.index(victim)\n slot[idx] = page\n used.append(page)\n return faults\n", "test_solution.py": "import unittest\nfrom solution import lru_faults\n\nclass Test(unittest.TestCase):\n def test_classic(self):\n self.assertEqual(lru_faults([1, 2, 3, 1, 4, 2], 3), 5)\n"}}, "topic": "operating_systems"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-lru-page-faults-e1513d15e836", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 3.9}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "lru_page_faults", "topic": "operating_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `lru_faults(pages, frames)` counting page faults with LRU\nreplacement among `frames` slots. Empty frames fill first.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:39Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def lru_faults(pages, frames):\n slot = []\n used = []\n faults = 0\n for page in pages:\n if page in slot:\n used.remove(page)\n used.append(page)\n continue\n faults += 1\n if len(slot) < frames:\n slot.append(page)\n else:\n victim = used.pop(0)\n idx = slot.index(victim)\n slot[idx] = page\n used.append(page)\n return faults", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_classic (test_solution.Test.test_classic) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def is_safe(available, allocation, need):\n work = list(available)\n finish = [False] * len(allocation)\n while True:\n progressed = False\n for i, done in enumerate(finish):\n if done:\n continue\n if all(need[i][j] <= work[j] for j in range(len(work))):\n for j in range(len(work)):\n work[j] += allocation[i][j]\n finish[i] = True\n progressed = True\n if not progressed:\n break\n return all(finish)", "assumptions": [], "concept_id": "python.loops", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def is_safe(available, allocation, need):\n work = list(available)\n finish = [False] * len(allocation)\n while True:\n progressed = False\n for i, done in enumerate(finish):\n if done:\n continue\n if all(need[i][j] <= work[j] for j in range(len(work))):\n for j in range(len(work)):\n work[j] += allocation[i][j]\n finish[i] = True\n progressed = True\n if not progressed:\n break\n return all(finish)\n", "test_solution.py": "import unittest\nfrom solution import is_safe\n\nclass Test(unittest.TestCase):\n def test_safe(self):\n self.assertTrue(is_safe([3], [[0], [1], [1]], [[1], [0], [2]]))\n def test_unsafe(self):\n self.assertFalse(is_safe([0], [[1], [1]], [[1], [1]]))\n"}}, "topic": "operating_systems"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-banker-safe-3b58e6d2a848", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 4.675000000000001}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "banker_safe", "topic": "operating_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `is_safe(available, allocation, need)` for the Banker's algorithm\nsafety check. `available` is a list of resource counts. `allocation` and `need`\nare lists of per-process lists. Return True iff a safe sequence exists.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:39Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def is_safe(available, allocation, need):\n work = list(available)\n finish = [False] * len(allocation)\n while True:\n progressed = False\n for i, done in enumerate(finish):\n if done:\n continue\n if all(need[i][j] <= work[j] for j in range(len(work))):\n for j in range(len(work)):\n work[j] += allocation[i][j]\n finish[i] = True\n progressed = True\n if not progressed:\n break\n return all(finish)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_safe (test_solution.Test.test_safe) ... ok\ntest_unsafe (test_solution.Test.test_unsafe) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return True\n return False", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return True\n return False\n", "test_solution.py": "import unittest\nfrom solution import TokenBucket\n\nclass Test(unittest.TestCase):\n def test_burst_then_refill(self):\n b = TokenBucket(1.0, 2)\n self.assertTrue(b.allow(0))\n self.assertTrue(b.allow(0))\n self.assertFalse(b.allow(0))\n self.assertTrue(b.allow(1.0))\n"}}, "topic": "networking"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-token-bucket-f0a6eaa2b164", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.775, "tests": 0.0, "total": 5.2}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "token_bucket", "topic": "networking"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement class `TokenBucket(rate, burst)` with `allow(time, cost=1)`.\n`rate` is tokens per time unit, `burst` is max tokens. Start full at t=0.\n`time` is non-decreasing. Return True if the request is admitted.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return True\n return False", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_burst_then_refill (test_solution.Test.test_burst_then_refill) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return True\n return False", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_burst_then_refill (test_solution.Test.test_burst_then_refill) ... FAIL\n\n======================================================================\nFAIL: test_burst_then_refill (test_solution.Test.test_burst_then_refill)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xgf9vhaq\\test_solution.py\", line 7, in test_burst_then_refill\n self.assertTrue(b.allow(0))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return False\n return False\n", "test_solution.py": "import unittest\nfrom solution import TokenBucket\n\nclass Test(unittest.TestCase):\n def test_burst_then_refill(self):\n b = TokenBucket(1.0, 2)\n self.assertTrue(b.allow(0))\n self.assertTrue(b.allow(0))\n self.assertFalse(b.allow(0))\n self.assertTrue(b.allow(1.0))\n"}}, "topic": "networking"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-token-bucket-32b0becb1436", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_burst_then_refill (test_solution.Test.test_burst_then_refill) ... FAIL\n\n======================================================================\nFAIL: test_burst_then_refill (test_solution.Test.test_burst_then_refill)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xgf9vhaq\\test_solution.py\", line 7, in test_burst_then_refill\n self.assertTrue(b.allow(0))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "token_bucket", "tests_passed_after_fix": 1, "topic": "networking"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement class `TokenBucket(rate, burst)` with `allow(time, cost=1)`.\n`rate` is tokens per time unit, `burst` is max tokens. Start full at t=0.\n`time` is non-decreasing. Return True if the request is admitted.\n\n--- solution.py (buggy) ---\nclass TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return False\n return False\n\n--- test_solution.py ---\nimport unittest\nfrom solution import TokenBucket\n\nclass Test(unittest.TestCase):\n def test_burst_then_refill(self):\n b = TokenBucket(1.0, 2)\n self.assertTrue(b.allow(0))\n self.assertTrue(b.allow(0))\n self.assertFalse(b.allow(0))\n self.assertTrue(b.allow(1.0))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_burst_then_refill (test_solution.Test.test_burst_then_refill) ... FAIL\n\n======================================================================\nFAIL: test_burst_then_refill (test_solution.Test.test_burst_then_refill)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xgf9vhaq\\test_solution.py\", line 7, in test_burst_then_refill\n self.assertTrue(b.allow(0))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class TokenBucket:\n def __init__(self, rate, burst):\n self.rate = rate\n self.burst = burst\n self.tokens = float(burst)\n self.t = 0.0\n\n def allow(self, time, cost=1):\n if time < self.t:\n raise ValueError(\"time\")\n self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)\n self.t = time\n if self.tokens >= cost:\n self.tokens -= cost\n return True\n return False", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_burst_then_refill (test_solution.Test.test_burst_then_refill) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared == \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared == \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)\n", "test_solution.py": "import unittest\nfrom solution import missing_required\n\nclass Test(unittest.TestCase):\n def test_types(self):\n schema = {\n \"required\": [\"id\", \"ok\"],\n \"properties\": {\"id\": {\"type\": \"number\"}, \"ok\": {\"type\": \"boolean\"}},\n }\n self.assertEqual(missing_required(schema, {\"id\": True, \"ok\": True}), [\"id\"])\n self.assertEqual(missing_required(schema, {\"id\": 1, \"ok\": True}), [])\n"}}, "topic": "api_design"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-openapi-required-d4f6731d64e0", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.725, "tests": 0.0, "total": 4.0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "openapi_required", "topic": "api_design"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `missing_required(schema, payload)` where schema is\n`{\"required\": [...], \"properties\": {name: {\"type\": \"string\"|\"number\"|\"boolean\"}}}`.\nReturn sorted names that are missing or have the wrong JSON type.\nExtra payload keys are ignored.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared == \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_types (test_solution.Test.test_types) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared == \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_types (test_solution.Test.test_types) ... FAIL\n\n======================================================================\nFAIL: test_types (test_solution.Test.test_types)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-qvs7oov5\\test_solution.py\", line 10, in test_types\n self.assertEqual(missing_required(schema, {\"id\": True, \"ok\": True}), [\"id\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['ok'] != ['id']\n\nFirst differing element 0:\n'ok'\n'id'\n\n- ['ok']\n+ ['id']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared != \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)\n", "test_solution.py": "import unittest\nfrom solution import missing_required\n\nclass Test(unittest.TestCase):\n def test_types(self):\n schema = {\n \"required\": [\"id\", \"ok\"],\n \"properties\": {\"id\": {\"type\": \"number\"}, \"ok\": {\"type\": \"boolean\"}},\n }\n self.assertEqual(missing_required(schema, {\"id\": True, \"ok\": True}), [\"id\"])\n self.assertEqual(missing_required(schema, {\"id\": 1, \"ok\": True}), [])\n"}}, "topic": "api_design"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-openapi-required-85f994fd302e", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.975}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_types (test_solution.Test.test_types) ... FAIL\n\n======================================================================\nFAIL: test_types (test_solution.Test.test_types)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-qvs7oov5\\test_solution.py\", line 10, in test_types\n self.assertEqual(missing_required(schema, {\"id\": True, \"ok\": True}), [\"id\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['ok'] != ['id']\n\nFirst differing element 0:\n'ok'\n'id'\n\n- ['ok']\n+ ['id']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "openapi_required", "tests_passed_after_fix": 1, "topic": "api_design"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `missing_required(schema, payload)` where schema is\n`{\"required\": [...], \"properties\": {name: {\"type\": \"string\"|\"number\"|\"boolean\"}}}`.\nReturn sorted names that are missing or have the wrong JSON type.\nExtra payload keys are ignored.\n\n--- solution.py (buggy) ---\ndef missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared != \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import missing_required\n\nclass Test(unittest.TestCase):\n def test_types(self):\n schema = {\n \"required\": [\"id\", \"ok\"],\n \"properties\": {\"id\": {\"type\": \"number\"}, \"ok\": {\"type\": \"boolean\"}},\n }\n self.assertEqual(missing_required(schema, {\"id\": True, \"ok\": True}), [\"id\"])\n self.assertEqual(missing_required(schema, {\"id\": 1, \"ok\": True}), [])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_types (test_solution.Test.test_types) ... FAIL\n\n======================================================================\nFAIL: test_types (test_solution.Test.test_types)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-qvs7oov5\\test_solution.py\", line 10, in test_types\n self.assertEqual(missing_required(schema, {\"id\": True, \"ok\": True}), [\"id\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['ok'] != ['id']\n\nFirst differing element 0:\n'ok'\n'id'\n\n- ['ok']\n+ ['id']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def missing_required(schema, payload):\n types = {\"string\": str, \"number\": (int, float), \"boolean\": bool}\n bad = []\n for name in schema.get(\"required\", []):\n if name not in payload:\n bad.append(name)\n continue\n declared = schema[\"properties\"][name][\"type\"]\n if declared == \"number\" and isinstance(payload[name], bool):\n bad.append(name)\n continue\n if not isinstance(payload[name], types[declared]):\n bad.append(name)\n return sorted(bad)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_types (test_solution.Test.test_types) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return True\n allowed = set(rules)\n return (from_layer, to_layer) in allowed", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return True\n allowed = set(rules)\n return (from_layer, to_layer) in allowed\n", "test_solution.py": "import unittest\nfrom solution import allowed_import\n\nclass Test(unittest.TestCase):\n def test_hex(self):\n rules = [(\"app\", \"domain\"), (\"infra\", \"domain\")]\n self.assertTrue(allowed_import(\"app\", \"domain\", rules))\n self.assertFalse(allowed_import(\"domain\", \"infra\", rules))\n self.assertTrue(allowed_import(\"domain\", \"domain\", rules))\n"}}, "topic": "architecture"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-layer-ports-b6582f00b6e8", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.85, "tests": 0.0, "total": 3.85}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "layer_ports", "topic": "architecture"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `allowed_import(from_layer, to_layer, rules)` where layers are\nstrings and rules is a list of (src, dst) allowed edges. A module may always\nimport from its own layer. Return True iff the import is permitted.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return True\n allowed = set(rules)\n return (from_layer, to_layer) in allowed", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_hex (test_solution.Test.test_hex) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return True\n allowed = set(rules)\n return (from_layer, to_layer) in allowed", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_hex (test_solution.Test.test_hex) ... FAIL\n\n======================================================================\nFAIL: test_hex (test_solution.Test.test_hex)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-1ukbywm_\\test_solution.py\", line 9, in test_hex\n self.assertTrue(allowed_import(\"domain\", \"domain\", rules))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return False\n allowed = set(rules)\n return (from_layer, to_layer) in allowed\n", "test_solution.py": "import unittest\nfrom solution import allowed_import\n\nclass Test(unittest.TestCase):\n def test_hex(self):\n rules = [(\"app\", \"domain\"), (\"infra\", \"domain\")]\n self.assertTrue(allowed_import(\"app\", \"domain\", rules))\n self.assertFalse(allowed_import(\"domain\", \"infra\", rules))\n self.assertTrue(allowed_import(\"domain\", \"domain\", rules))\n"}}, "topic": "architecture"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-layer-ports-1c09feebbfcc", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.775, "tests": 0.0, "total": 10.475}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_hex (test_solution.Test.test_hex) ... FAIL\n\n======================================================================\nFAIL: test_hex (test_solution.Test.test_hex)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-1ukbywm_\\test_solution.py\", line 9, in test_hex\n self.assertTrue(allowed_import(\"domain\", \"domain\", rules))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "layer_ports", "tests_passed_after_fix": 1, "topic": "architecture"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `allowed_import(from_layer, to_layer, rules)` where layers are\nstrings and rules is a list of (src, dst) allowed edges. A module may always\nimport from its own layer. Return True iff the import is permitted.\n\n--- solution.py (buggy) ---\ndef allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return False\n allowed = set(rules)\n return (from_layer, to_layer) in allowed\n\n--- test_solution.py ---\nimport unittest\nfrom solution import allowed_import\n\nclass Test(unittest.TestCase):\n def test_hex(self):\n rules = [(\"app\", \"domain\"), (\"infra\", \"domain\")]\n self.assertTrue(allowed_import(\"app\", \"domain\", rules))\n self.assertFalse(allowed_import(\"domain\", \"infra\", rules))\n self.assertTrue(allowed_import(\"domain\", \"domain\", rules))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_hex (test_solution.Test.test_hex) ... FAIL\n\n======================================================================\nFAIL: test_hex (test_solution.Test.test_hex)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-1ukbywm_\\test_solution.py\", line 9, in test_hex\n self.assertTrue(allowed_import(\"domain\", \"domain\", rules))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def allowed_import(from_layer, to_layer, rules):\n if from_layer == to_layer:\n return True\n allowed = set(rules)\n return (from_layer, to_layer) in allowed", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_hex (test_solution.Test.test_hex) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a + b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a + b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]\n", "test_solution.py": "import unittest\nfrom solution import eval_rpn\n\nclass Test(unittest.TestCase):\n def test_expr(self):\n self.assertEqual(eval_rpn([\"2\", \"3\", \"4\", \"*\", \"+\"]), 14)\n def test_div(self):\n self.assertEqual(eval_rpn([\"7\", \"2\", \"/\"]), 3)\n"}}, "topic": "interpreters"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-infix-rpn-eval-24d19ffbb57b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 6.9}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "infix_rpn_eval", "topic": "interpreters"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `eval_rpn(tokens)` for integers and + - * / (integer division\ntoward zero is NOT required: use Python `//` toward -inf). Tokens are strings.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a + b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_div (test_solution.Test.test_div) ... ok\ntest_expr (test_solution.Test.test_expr) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a + b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_div (test_solution.Test.test_div) ... ok\ntest_expr (test_solution.Test.test_expr) ... FAIL\n\n======================================================================\nFAIL: test_expr (test_solution.Test.test_expr)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-x9yaho2a\\test_solution.py\", line 6, in test_expr\n self.assertEqual(eval_rpn([\"2\", \"3\", \"4\", \"*\", \"+\"]), 14)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: -10 != 14\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a - b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]\n", "test_solution.py": "import unittest\nfrom solution import eval_rpn\n\nclass Test(unittest.TestCase):\n def test_expr(self):\n self.assertEqual(eval_rpn([\"2\", \"3\", \"4\", \"*\", \"+\"]), 14)\n def test_div(self):\n self.assertEqual(eval_rpn([\"7\", \"2\", \"/\"]), 3)\n"}}, "topic": "interpreters"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-infix-rpn-eval-e3dae1ab943e", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_div (test_solution.Test.test_div) ... ok\ntest_expr (test_solution.Test.test_expr) ... FAIL\n\n======================================================================\nFAIL: test_expr (test_solution.Test.test_expr)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-x9yaho2a\\test_solution.py\", line 6, in test_expr\n self.assertEqual(eval_rpn([\"2\", \"3\", \"4\", \"*\", \"+\"]), 14)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: -10 != 14\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 1}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "infix_rpn_eval", "tests_passed_after_fix": 2, "topic": "interpreters"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `eval_rpn(tokens)` for integers and + - * / (integer division\ntoward zero is NOT required: use Python `//` toward -inf). Tokens are strings.\n\n--- solution.py (buggy) ---\ndef eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a - b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]\n\n--- test_solution.py ---\nimport unittest\nfrom solution import eval_rpn\n\nclass Test(unittest.TestCase):\n def test_expr(self):\n self.assertEqual(eval_rpn([\"2\", \"3\", \"4\", \"*\", \"+\"]), 14)\n def test_div(self):\n self.assertEqual(eval_rpn([\"7\", \"2\", \"/\"]), 3)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_div (test_solution.Test.test_div) ... ok\ntest_expr (test_solution.Test.test_expr) ... FAIL\n\n======================================================================\nFAIL: test_expr (test_solution.Test.test_expr)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-x9yaho2a\\test_solution.py\", line 6, in test_expr\n self.assertEqual(eval_rpn([\"2\", \"3\", \"4\", \"*\", \"+\"]), 14)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: -10 != 14\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def eval_rpn(tokens):\n stack = []\n ops = {\n \"+\": lambda a, b: a + b,\n \"-\": lambda a, b: a - b,\n \"*\": lambda a, b: a * b,\n \"/\": lambda a, b: a // b,\n }\n for tok in tokens:\n if tok in ops:\n b = stack.pop()\n a = stack.pop()\n stack.append(ops[tok](a, b))\n else:\n stack.append(int(tok))\n if len(stack) != 1:\n raise ValueError(\"rpn\")\n return stack[0]", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_div (test_solution.Test.test_div) ... ok\ntest_expr (test_solution.Test.test_expr) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def occurs(var, typ):\n if typ == var:\n return True\n if isinstance(typ, list):\n return any(occurs(var, part) for part in typ[1:])\n return False\n\ndef apply_sub(sub, typ):\n if isinstance(typ, str):\n return sub.get(typ, typ)\n return [typ[0], *(apply_sub(sub, p) for p in typ[1:])]\n\ndef unify(a, b, sub=None):\n sub = dict(sub or {})\n a, b = apply_sub(sub, a), apply_sub(sub, b)\n if a == b:\n return sub\n if isinstance(a, str) and a.startswith(\"?\"):\n if occurs(a, b):\n return None\n sub[a] = b\n return sub\n if isinstance(b, str) and b.startswith(\"?\"):\n return unify(b, a, sub)\n if isinstance(a, list) and isinstance(b, list) and a[0] == b[0] and len(a) == len(b):\n for x, y in zip(a[1:], b[1:]):\n sub = unify(x, y, sub)\n if sub is None:\n return None\n return sub\n return None", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def occurs(var, typ):\n if typ == var:\n return True\n if isinstance(typ, list):\n return any(occurs(var, part) for part in typ[1:])\n return False\n\ndef apply_sub(sub, typ):\n if isinstance(typ, str):\n return sub.get(typ, typ)\n return [typ[0], *(apply_sub(sub, p) for p in typ[1:])]\n\ndef unify(a, b, sub=None):\n sub = dict(sub or {})\n a, b = apply_sub(sub, a), apply_sub(sub, b)\n if a == b:\n return sub\n if isinstance(a, str) and a.startswith(\"?\"):\n if occurs(a, b):\n return None\n sub[a] = b\n return sub\n if isinstance(b, str) and b.startswith(\"?\"):\n return unify(b, a, sub)\n if isinstance(a, list) and isinstance(b, list) and a[0] == b[0] and len(a) == len(b):\n for x, y in zip(a[1:], b[1:]):\n sub = unify(x, y, sub)\n if sub is None:\n return None\n return sub\n return None\n", "test_solution.py": "import unittest\nfrom solution import unify\n\nclass Test(unittest.TestCase):\n def test_fun(self):\n s = unify([\"Fun\", \"?a\", \"Int\"], [\"Fun\", \"Bool\", \"?b\"])\n self.assertEqual(s[\"?a\"], \"Bool\")\n self.assertEqual(s[\"?b\"], \"Int\")\n def test_fail(self):\n self.assertIsNone(unify(\"Int\", \"Bool\"))\n"}}, "topic": "type_systems"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-mini-typecheck-unify-593cc25f6fe5", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 1.075, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 1.275, "tests": 0.0, "total": 5.325}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "mini_typecheck_unify", "topic": "type_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `unify(a, b)` for a tiny type language: types are strings\n('Int', 'Bool') or lists ['Fun', t1, t2]. Variables are strings starting with\n`?`. Return a dict substitution or None on failure. Do not need occurs-check\nbeyond rejecting assigning a variable to a type that contains it as a nested list.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def occurs(var, typ):\n if typ == var:\n return True\n if isinstance(typ, list):\n return any(occurs(var, part) for part in typ[1:])\n return False\n\ndef apply_sub(sub, typ):\n if isinstance(typ, str):\n return sub.get(typ, typ)\n return [typ[0], *(apply_sub(sub, p) for p in typ[1:])]\n\ndef unify(a, b, sub=None):\n sub = dict(sub or {})\n a, b = apply_sub(sub, a), apply_sub(sub, b)\n if a == b:\n return sub\n if isinstance(a, str) and a.startswith(\"?\"):\n if occurs(a, b):\n return None\n sub[a] = b\n return sub\n if isinstance(b, str) and b.startswith(\"?\"):\n return unify(b, a, sub)\n if isinstance(a, list) and isinstance(b, list) and a[0] == b[0] and len(a) == len(b):\n for x, y in zip(a[1:], b[1:]):\n sub = unify(x, y, sub)\n if sub is None:\n return None\n return sub\n return None", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_fail (test_solution.Test.test_fail) ... ok\ntest_fun (test_solution.Test.test_fun) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "import re\n\ndef unused_assigns(lines):\n assigned = set()\n used = set()\n for line in lines:\n m = re.fullmatch(r\"([a-z]+) = .*\", line.strip())\n if m:\n assigned.add(m.group(1))\n continue\n m = re.fullmatch(r\"use ([a-z]+)\", line.strip())\n if m:\n used.add(m.group(1))\n return sorted(assigned - used)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef unused_assigns(lines):\n assigned = set()\n used = set()\n for line in lines:\n m = re.fullmatch(r\"([a-z]+) = .*\", line.strip())\n if m:\n assigned.add(m.group(1))\n continue\n m = re.fullmatch(r\"use ([a-z]+)\", line.strip())\n if m:\n used.add(m.group(1))\n return sorted(assigned - used)\n", "test_solution.py": "import unittest\nfrom solution import unused_assigns\n\nclass Test(unittest.TestCase):\n def test_unused(self):\n self.assertEqual(unused_assigns([\"a = 1\", \"b = 2\", \"use a\"]), [\"b\"])\n"}}, "topic": "static_analysis"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-static-unused-38afb5319518", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.75, "tests": 0.0, "total": 5.65}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "static_unused", "topic": "static_analysis"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `unused_assigns(lines)` for a toy language: lines are\n`x = ...` or `use x`. Names are `[a-z]+`. Return sorted names assigned at\nleast once and never used. Later use counts.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef unused_assigns(lines):\n assigned = set()\n used = set()\n for line in lines:\n m = re.fullmatch(r\"([a-z]+) = .*\", line.strip())\n if m:\n assigned.add(m.group(1))\n continue\n m = re.fullmatch(r\"use ([a-z]+)\", line.strip())\n if m:\n used.add(m.group(1))\n return sorted(assigned - used)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_unused (test_solution.Test.test_unused) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() == \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() == \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out\n", "test_solution.py": "import unittest\nfrom solution import google_args\n\nclass Test(unittest.TestCase):\n def test_args(self):\n doc = \"\"\"Do a thing.\\n\\nArgs:\\n count: how many\\n name: label\\n\\nReturns:\\n none\\n\"\"\"\n self.assertEqual(google_args(doc), [(\"count\", \"how many\"), (\"name\", \"label\")])\n"}}, "topic": "documentation"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-doc-extract-params-c3a9d5470e58", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 3.95}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "doc_extract_params", "topic": "documentation"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `google_args(docstring)` extracting Args from a Google-style\ndocstring. Return a list of (name, description) for lines indented like\n` name: desc`. Ignore other sections.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() == \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_args (test_solution.Test.test_args) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() == \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_args (test_solution.Test.test_args) ... FAIL\n\n======================================================================\nFAIL: test_args (test_solution.Test.test_args)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-aslyxdgv\\test_solution.py\", line 7, in test_args\n self.assertEqual(google_args(doc), [(\"count\", \"how many\"), (\"name\", \"label\")])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != [('count', 'how many'), ('name', 'label')]\n\nSecond list contains 2 additional elements.\nFirst extra element 0:\n('count', 'how many')\n\n- []\n+ [('count', 'how many'), ('name', 'label')]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() != \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out\n", "test_solution.py": "import unittest\nfrom solution import google_args\n\nclass Test(unittest.TestCase):\n def test_args(self):\n doc = \"\"\"Do a thing.\\n\\nArgs:\\n count: how many\\n name: label\\n\\nReturns:\\n none\\n\"\"\"\n self.assertEqual(google_args(doc), [(\"count\", \"how many\"), (\"name\", \"label\")])\n"}}, "topic": "documentation"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-doc-extract-params-dbee28dc353d", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.925}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_args (test_solution.Test.test_args) ... FAIL\n\n======================================================================\nFAIL: test_args (test_solution.Test.test_args)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-aslyxdgv\\test_solution.py\", line 7, in test_args\n self.assertEqual(google_args(doc), [(\"count\", \"how many\"), (\"name\", \"label\")])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != [('count', 'how many'), ('name', 'label')]\n\nSecond list contains 2 additional elements.\nFirst extra element 0:\n('count', 'how many')\n\n- []\n+ [('count', 'how many'), ('name', 'label')]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "doc_extract_params", "tests_passed_after_fix": 1, "topic": "documentation"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `google_args(docstring)` extracting Args from a Google-style\ndocstring. Return a list of (name, description) for lines indented like\n` name: desc`. Ignore other sections.\n\n--- solution.py (buggy) ---\ndef google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() != \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import google_args\n\nclass Test(unittest.TestCase):\n def test_args(self):\n doc = \"\"\"Do a thing.\\n\\nArgs:\\n count: how many\\n name: label\\n\\nReturns:\\n none\\n\"\"\"\n self.assertEqual(google_args(doc), [(\"count\", \"how many\"), (\"name\", \"label\")])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_args (test_solution.Test.test_args) ... FAIL\n\n======================================================================\nFAIL: test_args (test_solution.Test.test_args)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-aslyxdgv\\test_solution.py\", line 7, in test_args\n self.assertEqual(google_args(doc), [(\"count\", \"how many\"), (\"name\", \"label\")])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != [('count', 'how many'), ('name', 'label')]\n\nSecond list contains 2 additional elements.\nFirst extra element 0:\n('count', 'how many')\n\n- []\n+ [('count', 'how many'), ('name', 'label')]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:40Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def google_args(docstring):\n lines = docstring.splitlines()\n out = []\n in_args = False\n for line in lines:\n if line.strip() == \"Args:\":\n in_args = True\n continue\n if in_args and line.strip().endswith(\":\") and not line.startswith(\" \"):\n break\n if in_args:\n stripped = line.strip()\n if \": \" in stripped:\n name, desc = stripped.split(\": \", 1)\n out.append((name, desc))\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_args (test_solution.Test.test_args) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def migrate_v1_to_v2(payload):\n mapping = {\"userName\": \"username\", \"emailAddress\": \"email\"}\n return {mapping.get(k, k): v for k, v in payload.items()}", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def migrate_v1_to_v2(payload):\n mapping = {\"userName\": \"username\", \"emailAddress\": \"email\"}\n return {mapping.get(k, k): v for k, v in payload.items()}\n", "test_solution.py": "import unittest\nfrom solution import migrate_v1_to_v2\n\nclass Test(unittest.TestCase):\n def test_rename(self):\n self.assertEqual(\n migrate_v1_to_v2({\"userName\": \"a\", \"keep\": 1}),\n {\"username\": \"a\", \"keep\": 1},\n )\n"}}, "topic": "migration"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-migrate-rename-keys-ae57de445432", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.35, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.5500000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "migrate_rename_keys", "topic": "migration"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `migrate_v1_to_v2(payload)` renaming keys `userName`->`username`\nand `emailAddress`->`email`, leaving other keys. Missing keys stay missing.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def migrate_v1_to_v2(payload):\n mapping = {\"userName\": \"username\", \"emailAddress\": \"email\"}\n return {mapping.get(k, k): v for k, v in payload.items()}", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_rename (test_solution.Test.test_rename) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def api_supported(client, server):\n return client[0] == server[0] and client[1] <= server[1]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def api_supported(client, server):\n return client[0] == server[0] and client[1] <= server[1]\n", "test_solution.py": "import unittest\nfrom solution import api_supported\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertTrue(api_supported((1, 2), (1, 4)))\n self.assertFalse(api_supported((1, 5), (1, 4)))\n self.assertFalse(api_supported((2, 0), (1, 9)))\n"}}, "topic": "compatibility"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-compat-flag-23b7947ba53a", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.3, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 3.3}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "compat_flag", "topic": "compatibility"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `api_supported(client, server)` where versions are (major, minor).\nCompatible iff major matches and client.minor <= server.minor.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def api_supported(client, server):\n return client[0] == server[0] and client[1] <= server[1]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ok (test_solution.Test.test_ok) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return True\n return user.lower() == \"root\" or user == \"0\"", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return True\n return user.lower() == \"root\" or user == \"0\"\n", "test_solution.py": "import unittest\nfrom solution import dockerfile_runs_as_root\n\nclass Test(unittest.TestCase):\n def test_last_user(self):\n text = \"FROM alpine\\nUSER root\\nUSER app\\n\"\n self.assertFalse(dockerfile_runs_as_root(text))\n self.assertTrue(dockerfile_runs_as_root(\"FROM alpine\\n\"))\n"}}, "topic": "containers"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-dockerfile-user-99c246d38333", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.725, "tests": 0.0, "total": 4.0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dockerfile_user", "topic": "containers"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `dockerfile_runs_as_root(text)` returning True if the last\nUSER instruction is missing or is `USER root` / `USER 0` (ignoring case on\nroot). Comment lines starting with # are ignored.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return True\n return user.lower() == \"root\" or user == \"0\"", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_last_user (test_solution.Test.test_last_user) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return True\n return user.lower() == \"root\" or user == \"0\"", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_last_user (test_solution.Test.test_last_user) ... FAIL\n\n======================================================================\nFAIL: test_last_user (test_solution.Test.test_last_user)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-z0hsb33r\\test_solution.py\", line 8, in test_last_user\n self.assertTrue(dockerfile_runs_as_root(\"FROM alpine\\n\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return False\n return user.lower() == \"root\" or user == \"0\"\n", "test_solution.py": "import unittest\nfrom solution import dockerfile_runs_as_root\n\nclass Test(unittest.TestCase):\n def test_last_user(self):\n text = \"FROM alpine\\nUSER root\\nUSER app\\n\"\n self.assertFalse(dockerfile_runs_as_root(text))\n self.assertTrue(dockerfile_runs_as_root(\"FROM alpine\\n\"))\n"}}, "topic": "containers"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-dockerfile-user-937ebe0d0713", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.85}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_last_user (test_solution.Test.test_last_user) ... FAIL\n\n======================================================================\nFAIL: test_last_user (test_solution.Test.test_last_user)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-z0hsb33r\\test_solution.py\", line 8, in test_last_user\n self.assertTrue(dockerfile_runs_as_root(\"FROM alpine\\n\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dockerfile_user", "tests_passed_after_fix": 1, "topic": "containers"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `dockerfile_runs_as_root(text)` returning True if the last\nUSER instruction is missing or is `USER root` / `USER 0` (ignoring case on\nroot). Comment lines starting with # are ignored.\n\n--- solution.py (buggy) ---\ndef dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return False\n return user.lower() == \"root\" or user == \"0\"\n\n--- test_solution.py ---\nimport unittest\nfrom solution import dockerfile_runs_as_root\n\nclass Test(unittest.TestCase):\n def test_last_user(self):\n text = \"FROM alpine\\nUSER root\\nUSER app\\n\"\n self.assertFalse(dockerfile_runs_as_root(text))\n self.assertTrue(dockerfile_runs_as_root(\"FROM alpine\\n\"))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_last_user (test_solution.Test.test_last_user) ... FAIL\n\n======================================================================\nFAIL: test_last_user (test_solution.Test.test_last_user)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-z0hsb33r\\test_solution.py\", line 8, in test_last_user\n self.assertTrue(dockerfile_runs_as_root(\"FROM alpine\\n\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def dockerfile_runs_as_root(text):\n user = None\n for raw in text.splitlines():\n line = raw.strip()\n if not line or line.startswith(\"#\"):\n continue\n parts = line.split()\n if parts[0].upper() == \"USER\":\n user = parts[1] if len(parts) > 1 else \"\"\n if user is None:\n return True\n return user.lower() == \"root\" or user == \"0\"", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_last_user (test_solution.Test.test_last_user) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] == 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "assumptions": [], "concept_id": "python.collections", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] == 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order\n", "test_solution.py": "import unittest\nfrom solution import startup_order\n\nclass Test(unittest.TestCase):\n def test_order(self):\n order = startup_order({\"web\": [\"api\"], \"api\": [\"db\"], \"db\": []})\n self.assertEqual(order[:1], [\"db\"])\n self.assertLess(order.index(\"api\"), order.index(\"web\"))\n"}}, "topic": "distributed_systems"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-compose-depends-cf786caf91fe", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 4.6}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "compose_depends", "topic": "distributed_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `startup_order(depends)` where depends maps service -> list of\nservices it needs first. Return a topological order. Raise ValueError on cycles.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] == 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_order (test_solution.Test.test_order) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] == 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "assumptions": [], "concept_id": "python.collections", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_order (test_solution.Test.test_order) ... FAIL\n\n======================================================================\nFAIL: test_order (test_solution.Test.test_order)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ine8x9qi\\test_solution.py\", line 7, in test_order\n self.assertEqual(order[:1], [\"db\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['api'] != ['db']\n\nFirst differing element 0:\n'api'\n'db'\n\n- ['api']\n+ ['db']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] != 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order\n", "test_solution.py": "import unittest\nfrom solution import startup_order\n\nclass Test(unittest.TestCase):\n def test_order(self):\n order = startup_order({\"web\": [\"api\"], \"api\": [\"db\"], \"db\": []})\n self.assertEqual(order[:1], [\"db\"])\n self.assertLess(order.index(\"api\"), order.index(\"web\"))\n"}}, "topic": "distributed_systems"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-compose-depends-a666e0dc128e", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.15}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_order (test_solution.Test.test_order) ... FAIL\n\n======================================================================\nFAIL: test_order (test_solution.Test.test_order)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ine8x9qi\\test_solution.py\", line 7, in test_order\n self.assertEqual(order[:1], [\"db\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['api'] != ['db']\n\nFirst differing element 0:\n'api'\n'db'\n\n- ['api']\n+ ['db']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "compose_depends", "tests_passed_after_fix": 1, "topic": "distributed_systems"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `startup_order(depends)` where depends maps service -> list of\nservices it needs first. Return a topological order. Raise ValueError on cycles.\n\n--- solution.py (buggy) ---\nfrom collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] != 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order\n\n--- test_solution.py ---\nimport unittest\nfrom solution import startup_order\n\nclass Test(unittest.TestCase):\n def test_order(self):\n order = startup_order({\"web\": [\"api\"], \"api\": [\"db\"], \"db\": []})\n self.assertEqual(order[:1], [\"db\"])\n self.assertLess(order.index(\"api\"), order.index(\"web\"))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_order (test_solution.Test.test_order) ... FAIL\n\n======================================================================\nFAIL: test_order (test_solution.Test.test_order)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ine8x9qi\\test_solution.py\", line 7, in test_order\n self.assertEqual(order[:1], [\"db\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['api'] != ['db']\n\nFirst differing element 0:\n'api'\n'db'\n\n- ['api']\n+ ['db']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import defaultdict, deque\n\ndef startup_order(depends):\n nodes = set(depends)\n for deps in depends.values():\n nodes.update(deps)\n incoming = {n: 0 for n in nodes}\n graph = defaultdict(list)\n for svc, deps in depends.items():\n for dep in deps:\n graph[dep].append(svc)\n incoming[svc] += 1\n ready = deque([n for n in nodes if incoming[n] == 0])\n order = []\n while ready:\n n = ready.popleft()\n order.append(n)\n for m in graph[n]:\n incoming[m] -= 1\n if incoming[m] == 0:\n ready.append(m)\n if len(order) != len(nodes):\n raise ValueError(\"cycle\")\n return order", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_order (test_solution.Test.test_order) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def first_true(predicates):\n for i, fn in enumerate(predicates):\n if fn():\n return i\n return -1", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def first_true(predicates):\n for i, fn in enumerate(predicates):\n if fn():\n return i\n return -1\n", "test_solution.py": "import unittest\nfrom solution import first_true\n\nclass Test(unittest.TestCase):\n def test_short(self):\n calls = []\n def a():\n calls.append(\"a\")\n return False\n def b():\n calls.append(\"b\")\n return True\n def c():\n calls.append(\"c\")\n return True\n self.assertEqual(first_true([a, b, c]), 1)\n self.assertEqual(calls, [\"a\", \"b\"])\n"}}, "topic": "asynchronous_programming"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-async-gather-ok-95298ce50108", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.6, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 4.625}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "async_gather_ok", "topic": "asynchronous_programming"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `first_true(predicates)` where predicates is a list of zero-arg\ncallables. Return the index of the first that returns a truthy value, or -1.\nLater predicates must not be called after success (short-circuit).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def first_true(predicates):\n for i, fn in enumerate(predicates):\n if fn():\n return i\n return -1", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_short (test_solution.Test.test_short) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "import threading\n\ndef threaded_increment(n_threads, n_each):\n lock = threading.Lock()\n value = {\"n\": 0}\n\n def worker():\n for _ in range(n_each):\n with lock:\n value[\"n\"] += 1\n\n threads = [threading.Thread(target=worker) for _ in range(n_threads)]\n for t in threads:\n t.start()\n for t in threads:\n t.join()\n return value[\"n\"]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import threading\n\ndef threaded_increment(n_threads, n_each):\n lock = threading.Lock()\n value = {\"n\": 0}\n\n def worker():\n for _ in range(n_each):\n with lock:\n value[\"n\"] += 1\n\n threads = [threading.Thread(target=worker) for _ in range(n_threads)]\n for t in threads:\n t.start()\n for t in threads:\n t.join()\n return value[\"n\"]\n", "test_solution.py": "import unittest\nfrom solution import threaded_increment\n\nclass Test(unittest.TestCase):\n def test_count(self):\n self.assertEqual(threaded_increment(4, 50), 200)\n"}}, "topic": "concurrency"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-mutex-counter-52c971c4e6a9", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.65, "tests": 0.0, "total": 4.25}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "mutex_counter", "topic": "concurrency"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `threaded_increment(n_threads, n_each)` that starts n_threads\nthreads each adding n_each to a shared integer behind a threading.Lock.\nReturn the final count (must equal n_threads * n_each).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import threading\n\ndef threaded_increment(n_threads, n_each):\n lock = threading.Lock()\n value = {\"n\": 0}\n\n def worker():\n for _ in range(n_each):\n with lock:\n value[\"n\"] += 1\n\n threads = [threading.Thread(target=worker) for _ in range(n_threads)]\n for t in threads:\n t.start()\n for t in threads:\n t.join()\n return value[\"n\"]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_count (test_solution.Test.test_count) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def pair_indices(nums, target):\n seen = {}\n best = None\n for i, value in enumerate(nums):\n need = target - value\n if need in seen:\n cand = (seen[need], i)\n if best is None or cand < best:\n best = cand\n if value not in seen:\n seen[value] = i\n return best", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def pair_indices(nums, target):\n seen = {}\n best = None\n for i, value in enumerate(nums):\n need = target - value\n if need in seen:\n cand = (seen[need], i)\n if best is None or cand < best:\n best = cand\n if value not in seen:\n seen[value] = i\n return best\n", "test_solution.py": "import unittest\nfrom solution import pair_indices\n\nclass Test(unittest.TestCase):\n def test_pair(self):\n self.assertEqual(pair_indices([2, 7, 11, 15], 9), (0, 1))\n def test_none(self):\n self.assertIsNone(pair_indices([1, 2, 3], 100))\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-two-sum-index-9c2e41fc19d9", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.675, "tests": 0.0, "total": 4.2}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "two_sum_index", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `pair_indices(nums, target)` returning a pair of distinct indices\ni < j such that nums[i] + nums[j] == target, or None. Prefer the lexicographically\nsmallest (i, j).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def pair_indices(nums, target):\n seen = {}\n best = None\n for i, value in enumerate(nums):\n need = target - value\n if need in seen:\n cand = (seen[need], i)\n if best is None or cand < best:\n best = cand\n if value not in seen:\n seen[value] = i\n return best", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_none (test_solution.Test.test_none) ... ok\ntest_pair (test_solution.Test.test_pair) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def within_edit(a, b, k):\n if abs(len(a) - len(b)) > k:\n return False\n prev = list(range(len(b) + 1))\n for i, ca in enumerate(a, start=1):\n row = [i]\n for j, cb in enumerate(b, start=1):\n cost = 0 if ca == cb else 1\n row.append(min(row[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost))\n prev = row\n return prev[-1] <= k", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def within_edit(a, b, k):\n if abs(len(a) - len(b)) > k:\n return False\n prev = list(range(len(b) + 1))\n for i, ca in enumerate(a, start=1):\n row = [i]\n for j, cb in enumerate(b, start=1):\n cost = 0 if ca == cb else 1\n row.append(min(row[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost))\n prev = row\n return prev[-1] <= k\n", "test_solution.py": "import unittest\nfrom solution import within_edit\n\nclass Test(unittest.TestCase):\n def test_k(self):\n self.assertTrue(within_edit(\"kitten\", \"sitting\", 3))\n self.assertFalse(within_edit(\"kitten\", \"sitting\", 2))\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-edit-distance-k-d9911a04d868", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 5.550000000000001}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "edit_distance_k", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `within_edit(a, b, k)` True iff Levenshtein distance(a, b) <= k.\nYou may use DP. Strings are short.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def within_edit(a, b, k):\n if abs(len(a) - len(b)) > k:\n return False\n prev = list(range(len(b) + 1))\n for i, ca in enumerate(a, start=1):\n row = [i]\n for j, cb in enumerate(b, start=1):\n cost = 0 if ca == cb else 1\n row.append(min(row[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost))\n prev = row\n return prev[-1] <= k", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_k (test_solution.Test.test_k) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return True\n return False", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return True\n return False\n", "test_solution.py": "import unittest\nfrom solution import has_cycle\n\nclass Test(unittest.TestCase):\n def test_cycle(self):\n a = {\"v\": 1, \"n\": None}\n b = {\"v\": 2, \"n\": None}\n c = {\"v\": 3, \"n\": None}\n a[\"n\"], b[\"n\"], c[\"n\"] = b, c, b\n self.assertTrue(has_cycle(a))\n d = {\"v\": 1, \"n\": {\"v\": 2, \"n\": None}}\n self.assertFalse(has_cycle(d))\n"}}, "topic": "data_structures"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-cycle-list-4961dd97c673", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 3.625}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "cycle_list", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Represent a singly linked list as nodes `{\"v\": value, \"n\": next_or_None}`.\nImplement `has_cycle(head)` using constant extra memory (Floyd).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return True\n return False", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cycle (test_solution.Test.test_cycle) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return True\n return False", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_cycle (test_solution.Test.test_cycle) ... FAIL\n\n======================================================================\nFAIL: test_cycle (test_solution.Test.test_cycle)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-tedosbbj\\test_solution.py\", line 10, in test_cycle\n self.assertTrue(has_cycle(a))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return False\n return False\n", "test_solution.py": "import unittest\nfrom solution import has_cycle\n\nclass Test(unittest.TestCase):\n def test_cycle(self):\n a = {\"v\": 1, \"n\": None}\n b = {\"v\": 2, \"n\": None}\n c = {\"v\": 3, \"n\": None}\n a[\"n\"], b[\"n\"], c[\"n\"] = b, c, b\n self.assertTrue(has_cycle(a))\n d = {\"v\": 1, \"n\": {\"v\": 2, \"n\": None}}\n self.assertFalse(has_cycle(d))\n"}}, "topic": "data_structures"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-cycle-list-79cf4e96398f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.875}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_cycle (test_solution.Test.test_cycle) ... FAIL\n\n======================================================================\nFAIL: test_cycle (test_solution.Test.test_cycle)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-tedosbbj\\test_solution.py\", line 10, in test_cycle\n self.assertTrue(has_cycle(a))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "cycle_list", "tests_passed_after_fix": 1, "topic": "data_structures"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nRepresent a singly linked list as nodes `{\"v\": value, \"n\": next_or_None}`.\nImplement `has_cycle(head)` using constant extra memory (Floyd).\n\n--- solution.py (buggy) ---\ndef has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return False\n return False\n\n--- test_solution.py ---\nimport unittest\nfrom solution import has_cycle\n\nclass Test(unittest.TestCase):\n def test_cycle(self):\n a = {\"v\": 1, \"n\": None}\n b = {\"v\": 2, \"n\": None}\n c = {\"v\": 3, \"n\": None}\n a[\"n\"], b[\"n\"], c[\"n\"] = b, c, b\n self.assertTrue(has_cycle(a))\n d = {\"v\": 1, \"n\": {\"v\": 2, \"n\": None}}\n self.assertFalse(has_cycle(d))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_cycle (test_solution.Test.test_cycle) ... FAIL\n\n======================================================================\nFAIL: test_cycle (test_solution.Test.test_cycle)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-tedosbbj\\test_solution.py\", line 10, in test_cycle\n self.assertTrue(has_cycle(a))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def has_cycle(head):\n slow = head\n fast = head\n while fast and fast[\"n\"]:\n slow = slow[\"n\"]\n fast = fast[\"n\"][\"n\"]\n if slow is fast:\n return True\n return False", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cycle (test_solution.Test.test_cycle) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return True\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return True\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)\n", "test_solution.py": "import unittest\nfrom solution import is_bst\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n tree = {\"v\": 2, \"l\": {\"v\": 1, \"l\": None, \"r\": None}, \"r\": {\"v\": 3, \"l\": None, \"r\": None}}\n self.assertTrue(is_bst(tree))\n def test_bad(self):\n tree = {\"v\": 1, \"l\": {\"v\": 2, \"l\": None, \"r\": None}, \"r\": None}\n self.assertFalse(is_bst(tree))\n"}}, "topic": "data_structures"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-bst-validate-4c158319df27", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.55, "tests": 0.0, "total": 3.6750000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "bst_validate", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Nodes are `{\"v\": int, \"l\": node|None, \"r\": node|None}`. Implement\n`is_bst(root)` with strict ordering (left < v < right) for the whole tree.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return True\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return True\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\n\n======================================================================\nFAIL: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xvkxd8ue\\test_solution.py\", line 7, in test_ok\n self.assertTrue(is_bst(tree))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return False\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)\n", "test_solution.py": "import unittest\nfrom solution import is_bst\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n tree = {\"v\": 2, \"l\": {\"v\": 1, \"l\": None, \"r\": None}, \"r\": {\"v\": 3, \"l\": None, \"r\": None}}\n self.assertTrue(is_bst(tree))\n def test_bad(self):\n tree = {\"v\": 1, \"l\": {\"v\": 2, \"l\": None, \"r\": None}, \"r\": None}\n self.assertFalse(is_bst(tree))\n"}}, "topic": "data_structures"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-bst-validate-d1688f26fc9f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.825}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\n\n======================================================================\nFAIL: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xvkxd8ue\\test_solution.py\", line 7, in test_ok\n self.assertTrue(is_bst(tree))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 1}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "bst_validate", "tests_passed_after_fix": 2, "topic": "data_structures"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nNodes are `{\"v\": int, \"l\": node|None, \"r\": node|None}`. Implement\n`is_bst(root)` with strict ordering (left < v < right) for the whole tree.\n\n--- solution.py (buggy) ---\ndef is_bst(root, lo=None, hi=None):\n if root is None:\n return False\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import is_bst\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n tree = {\"v\": 2, \"l\": {\"v\": 1, \"l\": None, \"r\": None}, \"r\": {\"v\": 3, \"l\": None, \"r\": None}}\n self.assertTrue(is_bst(tree))\n def test_bad(self):\n tree = {\"v\": 1, \"l\": {\"v\": 2, \"l\": None, \"r\": None}, \"r\": None}\n self.assertFalse(is_bst(tree))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... FAIL\n\n======================================================================\nFAIL: test_ok (test_solution.Test.test_ok)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xvkxd8ue\\test_solution.py\", line 7, in test_ok\n self.assertTrue(is_bst(tree))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:41Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def is_bst(root, lo=None, hi=None):\n if root is None:\n return True\n v = root[\"v\"]\n if lo is not None and v <= lo:\n return False\n if hi is not None and v >= hi:\n return False\n return is_bst(root[\"l\"], lo, v) and is_bst(root[\"r\"], v, hi)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def parse_flags(argv):\n flags = {}\n args = []\n i = 0\n while i < len(argv):\n tok = argv[i]\n if tok == \"--verbose\":\n flags[\"verbose\"] = True\n i += 1\n elif tok.startswith(\"--\"):\n name = tok[2:]\n if i + 1 >= len(argv):\n raise ValueError(\"missing\")\n flags[name] = argv[i + 1]\n i += 2\n else:\n args.append(tok)\n i += 1\n return {\"flags\": flags, \"args\": args}", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def parse_flags(argv):\n flags = {}\n args = []\n i = 0\n while i < len(argv):\n tok = argv[i]\n if tok == \"--verbose\":\n flags[\"verbose\"] = True\n i += 1\n elif tok.startswith(\"--\"):\n name = tok[2:]\n if i + 1 >= len(argv):\n raise ValueError(\"missing\")\n flags[name] = argv[i + 1]\n i += 2\n else:\n args.append(tok)\n i += 1\n return {\"flags\": flags, \"args\": args}\n", "test_solution.py": "import unittest\nfrom solution import parse_flags\n\nclass Test(unittest.TestCase):\n def test_mix(self):\n got = parse_flags([\"--name\", \"or\", \"file\", \"--verbose\"])\n self.assertEqual(got[\"flags\"][\"name\"], \"or\")\n self.assertTrue(got[\"flags\"][\"verbose\"])\n self.assertEqual(got[\"args\"], [\"file\"])\n"}}, "topic": "cli_development"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-cli-argv-1cfeb4dc50c7", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.75, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.65, "tests": 0.0, "total": 7.0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "cli_argv", "topic": "cli_development"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `parse_flags(argv)` for a tiny CLI: flags `--name value` and\nboolean `--verbose` present-or-not. Remaining tokens are positional.\nReturn `{\"flags\": dict, \"args\": list}`. `--verbose` maps to True.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def parse_flags(argv):\n flags = {}\n args = []\n i = 0\n while i < len(argv):\n tok = argv[i]\n if tok == \"--verbose\":\n flags[\"verbose\"] = True\n i += 1\n elif tok.startswith(\"--\"):\n name = tok[2:]\n if i + 1 >= len(argv):\n raise ValueError(\"missing\")\n flags[name] = argv[i + 1]\n i += 2\n else:\n args.append(tok)\n i += 1\n return {\"flags\": flags, \"args\": args}", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_mix (test_solution.Test.test_mix) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def make_targets(text):\n names = []\n for raw in text.splitlines():\n if not raw or raw.startswith(\"\\t\") or raw.startswith(\" \") or raw.startswith(\"#\"):\n continue\n if \":\" not in raw:\n continue\n target = raw.split(\":\", 1)[0].strip()\n if target and target != \".PHONY\":\n names.append(target)\n return names", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def make_targets(text):\n names = []\n for raw in text.splitlines():\n if not raw or raw.startswith(\"\\t\") or raw.startswith(\" \") or raw.startswith(\"#\"):\n continue\n if \":\" not in raw:\n continue\n target = raw.split(\":\", 1)[0].strip()\n if target and target != \".PHONY\":\n names.append(target)\n return names\n", "test_solution.py": "import unittest\nfrom solution import make_targets\n\nclass Test(unittest.TestCase):\n def test_names(self):\n text = \".PHONY: all\\nall: build\\nbuild:\\n\\techo x\\n\"\n self.assertEqual(make_targets(text), [\"all\", \"build\"])\n"}}, "topic": "build_systems"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-makefile-targets-d2abd26b36ee", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 3.6}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "makefile_targets", "topic": "build_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `make_targets(text)` extracting target names from lines matching\n`target: deps` at column 0 (no leading whitespace). Skip `.PHONY` and comments.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def make_targets(text):\n names = []\n for raw in text.splitlines():\n if not raw or raw.startswith(\"\\t\") or raw.startswith(\" \") or raw.startswith(\"#\"):\n continue\n if \":\" not in raw:\n continue\n target = raw.split(\":\", 1)[0].strip()\n if target and target != \".PHONY\":\n names.append(target)\n return names", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_names (test_solution.Test.test_names) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "import re\n\ndef junit_counts(xml):\n m = re.search(r\"]*>\", xml)\n if not m:\n raise ValueError(\"no testsuite\")\n tag = m.group(0)\n tests = int(re.search(r'tests=\"(\\d+)\"', tag).group(1))\n failures = int(re.search(r'failures=\"(\\d+)\"', tag).group(1))\n return {\"tests\": tests, \"failures\": failures}", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef junit_counts(xml):\n m = re.search(r\"]*>\", xml)\n if not m:\n raise ValueError(\"no testsuite\")\n tag = m.group(0)\n tests = int(re.search(r'tests=\"(\\d+)\"', tag).group(1))\n failures = int(re.search(r'failures=\"(\\d+)\"', tag).group(1))\n return {\"tests\": tests, \"failures\": failures}\n", "test_solution.py": "import unittest\nfrom solution import junit_counts\n\nclass Test(unittest.TestCase):\n def test_parse(self):\n xml = ''\n self.assertEqual(junit_counts(xml), {\"tests\": 10, \"failures\": 2})\n"}}, "topic": "ci_cd"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-ci-junit-counts-bd792f4e3f79", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 4.65}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "ci_junit_counts", "topic": "ci_cd"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `junit_counts(xml)` for a tiny subset: count `failures=` and\n`tests=` on the first `` tag using regex. Return\n`{\"tests\": int, \"failures\": int}`.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef junit_counts(xml):\n m = re.search(r\"]*>\", xml)\n if not m:\n raise ValueError(\"no testsuite\")\n tag = m.group(0)\n tests = int(re.search(r'tests=\"(\\d+)\"', tag).group(1))\n failures = int(re.search(r'failures=\"(\\d+)\"', tag).group(1))\n return {\"tests\": tests, \"failures\": failures}", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_parse (test_solution.Test.test_parse) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def backoff_delays(retries, base, cap):\n return [min(cap, base * (2 ** i)) for i in range(retries)]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def backoff_delays(retries, base, cap):\n return [min(cap, base * (2 ** i)) for i in range(retries)]\n", "test_solution.py": "import unittest\nfrom solution import backoff_delays\n\nclass Test(unittest.TestCase):\n def test_cap(self):\n self.assertEqual(backoff_delays(5, 1, 8), [1, 2, 4, 8, 8])\n"}}, "topic": "devops"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-healthcheck-backoff-7f8970814d92", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.25, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.550000000000001}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "healthcheck_backoff", "topic": "devops"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `backoff_delays(retries, base, cap)` returning a list of length\n`retries` with delays min(cap, base * 2**i) for i=0..retries-1.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def backoff_delays(retries, base, cap):\n return [min(cap, base * (2 ** i)) for i in range(retries)]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cap (test_solution.Test.test_cap) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def majority(nums):\n vote = 0\n cand = None\n for x in nums:\n if vote == 0:\n cand = x\n vote += 1 if x == cand else -1\n return cand", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def majority(nums):\n vote = 0\n cand = None\n for x in nums:\n if vote == 0:\n cand = x\n vote += 1 if x == cand else -1\n return cand\n", "test_solution.py": "import unittest\nfrom solution import majority\n\nclass Test(unittest.TestCase):\n def test_maj(self):\n self.assertEqual(majority([1, 2, 1, 1, 3, 1, 1]), 1)\n"}}, "topic": "performance_optimization"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-hot-path-count-07accf47237f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.775, "tests": 0.0, "total": 4.525}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "hot_path_count", "topic": "performance_optimization"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `majority_nlogn_forbidden(nums)` finding the element that\nappears more than n/2 times. Use Boyer-Moore. Guarantee O(n) time, O(1) extra\nmemory aside from the input. The input is guaranteed to have a majority.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def majority(nums):\n vote = 0\n cand = None\n for x in nums:\n if vote == 0:\n cand = x\n vote += 1 if x == cand else -1\n return cand", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_maj (test_solution.Test.test_maj) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset + n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset + n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0\n", "test_solution.py": "import unittest\nfrom solution import BumpArena\n\nclass Test(unittest.TestCase):\n def test_alloc(self):\n a = BumpArena(10)\n self.assertEqual(a.alloc(4), 0)\n self.assertEqual(a.alloc(4), 4)\n self.assertIsNone(a.alloc(4))\n a.reset()\n self.assertEqual(a.alloc(10), 0)\n"}}, "topic": "memory_management"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-arena-bump-f435a0b50f59", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.7, "tests": 0.0, "total": 4.475}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "arena_bump", "topic": "memory_management"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement class `BumpArena(size)` with `alloc(n)` returning the start\noffset of n contiguous bytes or None if it will not fit, and `reset()` to\nfree everything. No coalescing needed.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset + n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_alloc (test_solution.Test.test_alloc) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset + n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_alloc (test_solution.Test.test_alloc) ... FAIL\n\n======================================================================\nFAIL: test_alloc (test_solution.Test.test_alloc)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-oeyqmzwt\\test_solution.py\", line 9, in test_alloc\n self.assertIsNone(a.alloc(4))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: 8 is not None\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset - n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0\n", "test_solution.py": "import unittest\nfrom solution import BumpArena\n\nclass Test(unittest.TestCase):\n def test_alloc(self):\n a = BumpArena(10)\n self.assertEqual(a.alloc(4), 0)\n self.assertEqual(a.alloc(4), 4)\n self.assertIsNone(a.alloc(4))\n a.reset()\n self.assertEqual(a.alloc(10), 0)\n"}}, "topic": "memory_management"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-arena-bump-0a164922164a", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.975}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_alloc (test_solution.Test.test_alloc) ... FAIL\n\n======================================================================\nFAIL: test_alloc (test_solution.Test.test_alloc)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-oeyqmzwt\\test_solution.py\", line 9, in test_alloc\n self.assertIsNone(a.alloc(4))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: 8 is not None\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "arena_bump", "tests_passed_after_fix": 1, "topic": "memory_management"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement class `BumpArena(size)` with `alloc(n)` returning the start\noffset of n contiguous bytes or None if it will not fit, and `reset()` to\nfree everything. No coalescing needed.\n\n--- solution.py (buggy) ---\nclass BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset - n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0\n\n--- test_solution.py ---\nimport unittest\nfrom solution import BumpArena\n\nclass Test(unittest.TestCase):\n def test_alloc(self):\n a = BumpArena(10)\n self.assertEqual(a.alloc(4), 0)\n self.assertEqual(a.alloc(4), 4)\n self.assertIsNone(a.alloc(4))\n a.reset()\n self.assertEqual(a.alloc(10), 0)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_alloc (test_solution.Test.test_alloc) ... FAIL\n\n======================================================================\nFAIL: test_alloc (test_solution.Test.test_alloc)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-oeyqmzwt\\test_solution.py\", line 9, in test_alloc\n self.assertIsNone(a.alloc(4))\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: 8 is not None\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class BumpArena:\n def __init__(self, size):\n self.size = size\n self.offset = 0\n\n def alloc(self, n):\n if n < 0 or self.offset + n > self.size:\n return None\n start = self.offset\n self.offset += n\n return start\n\n def reset(self):\n self.offset = 0", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_alloc (test_solution.Test.test_alloc) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch == '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch == '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out\n", "test_solution.py": "import unittest\nfrom solution import c_idents\n\nclass Test(unittest.TestCase):\n def test_skip_string(self):\n src = 'int x = \"not_an_ident\"; y = 1;'\n self.assertEqual(c_idents(src), [\"int\", \"x\", \"y\"])\n"}}, "topic": "compiler_development"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-tokenize-c-idents-85906e6bb602", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.95, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.65, "tests": 0.0, "total": 6.575}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "tokenize_c_idents", "topic": "compiler_development"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `c_idents(source)` returning identifiers matching\n`[A-Za-z_][A-Za-z0-9_]*` in order, skipping those inside double-quoted strings.\nDo not handle escapes other than `\\\\` and `\\\"`. Comments are not supported.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch == '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_skip_string (test_solution.Test.test_skip_string) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch == '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_skip_string (test_solution.Test.test_skip_string) ... FAIL\n\n======================================================================\nFAIL: test_skip_string (test_solution.Test.test_skip_string)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-lqx9jx_r\\test_solution.py\", line 7, in test_skip_string\n self.assertEqual(c_idents(src), [\"int\", \"x\", \"y\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != ['int', 'x', 'y']\n\nSecond list contains 3 additional elements.\nFirst extra element 0:\n'int'\n\n- []\n+ ['int', 'x', 'y']\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch != '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out\n", "test_solution.py": "import unittest\nfrom solution import c_idents\n\nclass Test(unittest.TestCase):\n def test_skip_string(self):\n src = 'int x = \"not_an_ident\"; y = 1;'\n self.assertEqual(c_idents(src), [\"int\", \"x\", \"y\"])\n"}}, "topic": "compiler_development"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-tokenize-c-idents-965f39a6d8db", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.95, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.25}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_skip_string (test_solution.Test.test_skip_string) ... FAIL\n\n======================================================================\nFAIL: test_skip_string (test_solution.Test.test_skip_string)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-lqx9jx_r\\test_solution.py\", line 7, in test_skip_string\n self.assertEqual(c_idents(src), [\"int\", \"x\", \"y\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != ['int', 'x', 'y']\n\nSecond list contains 3 additional elements.\nFirst extra element 0:\n'int'\n\n- []\n+ ['int', 'x', 'y']\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "tokenize_c_idents", "tests_passed_after_fix": 1, "topic": "compiler_development"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `c_idents(source)` returning identifiers matching\n`[A-Za-z_][A-Za-z0-9_]*` in order, skipping those inside double-quoted strings.\nDo not handle escapes other than `\\\\` and `\\\"`. Comments are not supported.\n\n--- solution.py (buggy) ---\ndef c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch != '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import c_idents\n\nclass Test(unittest.TestCase):\n def test_skip_string(self):\n src = 'int x = \"not_an_ident\"; y = 1;'\n self.assertEqual(c_idents(src), [\"int\", \"x\", \"y\"])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_skip_string (test_solution.Test.test_skip_string) ... FAIL\n\n======================================================================\nFAIL: test_skip_string (test_solution.Test.test_skip_string)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-lqx9jx_r\\test_solution.py\", line 7, in test_skip_string\n self.assertEqual(c_idents(src), [\"int\", \"x\", \"y\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != ['int', 'x', 'y']\n\nSecond list contains 3 additional elements.\nFirst extra element 0:\n'int'\n\n- []\n+ ['int', 'x', 'y']\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def c_idents(source):\n ident = []\n out = []\n i = 0\n n = len(source)\n while i < n:\n ch = source[i]\n if ch == '\"':\n i += 1\n while i < n:\n if source[i] == \"\\\\\":\n i += 2\n continue\n if source[i] == '\"':\n i += 1\n break\n i += 1\n continue\n if ch.isalnum() or ch == \"_\":\n j = i\n while j < n and (source[j].isalnum() or source[j] == \"_\"):\n j += 1\n token = source[i:j]\n if token[0].isalpha() or token[0] == \"_\":\n out.append(token)\n i = j\n continue\n i += 1\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_skip_string (test_solution.Test.test_skip_string) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class Rc:\n def __init__(self):\n self.count = 1\n\n def inc(self):\n self.count += 1\n\n def dec(self):\n if self.count <= 0:\n raise ValueError(\"underflow\")\n self.count -= 1\n\n def alive(self):\n return self.count > 0", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "class Rc:\n def __init__(self):\n self.count = 1\n\n def inc(self):\n self.count += 1\n\n def dec(self):\n if self.count <= 0:\n raise ValueError(\"underflow\")\n self.count -= 1\n\n def alive(self):\n return self.count > 0\n", "test_solution.py": "import unittest\nfrom solution import Rc\n\nclass Test(unittest.TestCase):\n def test_rc(self):\n r = Rc()\n r.inc()\n r.dec()\n self.assertTrue(r.alive())\n r.dec()\n self.assertFalse(r.alive())\n"}}, "topic": "language_design"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-refcount-toy-e57fc477513c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 4.275}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "refcount_toy", "topic": "language_design"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement class `Rc` with `inc()`, `dec()`, and `alive()` for a toy\nrefcount. `dec` below zero raises ValueError. Start at 1.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class Rc:\n def __init__(self):\n self.count = 1\n\n def inc(self):\n self.count += 1\n\n def dec(self):\n if self.count <= 0:\n raise ValueError(\"underflow\")\n self.count -= 1\n\n def alive(self):\n return self.count > 0", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_rc (test_solution.Test.test_rc) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def zip_fill(*seqs, fill=None):\n seqs = [list(s) for s in seqs]\n if not seqs:\n return []\n n = max(len(s) for s in seqs)\n out = []\n for i in range(n):\n out.append(tuple(s[i] if i < len(s) else fill for s in seqs))\n return out", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def zip_fill(*seqs, fill=None):\n seqs = [list(s) for s in seqs]\n if not seqs:\n return []\n n = max(len(s) for s in seqs)\n out = []\n for i in range(n):\n out.append(tuple(s[i] if i < len(s) else fill for s in seqs))\n return out\n", "test_solution.py": "import unittest\nfrom solution import zip_fill\n\nclass Test(unittest.TestCase):\n def test_pad(self):\n self.assertEqual(zip_fill([1, 2], [\"a\"], fill=\"?\"), [(1, \"a\"), (2, \"?\")])\n"}}, "topic": "refactoring"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-zip-longest-fill-fa335858e41a", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 3.875}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "zip_longest_fill", "topic": "refactoring"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `zip_fill(*seqs, fill=None)` equivalent to padding all sequences\nto the longest length then zipping. Return a list of tuples.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def zip_fill(*seqs, fill=None):\n seqs = [list(s) for s in seqs]\n if not seqs:\n return []\n n = max(len(s) for s in seqs)\n out = []\n for i in range(n):\n out.append(tuple(s[i] if i < len(s) else fill for s in seqs))\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_pad (test_solution.Test.test_pad) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def uncovered(lines, hit):\n seen = set(hit)\n return sorted(n for n in lines if n not in seen)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def uncovered(lines, hit):\n seen = set(hit)\n return sorted(n for n in lines if n not in seen)\n", "test_solution.py": "import unittest\nfrom solution import uncovered\n\nclass Test(unittest.TestCase):\n def test_gap(self):\n self.assertEqual(uncovered({1, 2, 3, 4}, [1, 1, 3]), [2, 4])\n"}}, "topic": "test_generation"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-coverage-uncovered-0981a6b7636b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.275, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.8, "tests": 0.0, "total": 3.6750000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "coverage_uncovered", "topic": "test_generation"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `uncovered(lines, hit)` where `lines` is a set of executable line\nnumbers and `hit` is a list of line numbers executed (with duplicates). Return\nsorted executable lines that never appear in `hit`.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:42Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def uncovered(lines, hit):\n seen = set(hit)\n return sorted(n for n in lines if n not in seen)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_gap (test_solution.Test.test_gap) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def classify_flaky(results):\n if not results:\n raise ValueError(\"empty\")\n if all(results):\n return \"pass\"\n if not any(results):\n return \"fail\"\n return \"flaky\"", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def classify_flaky(results):\n if not results:\n raise ValueError(\"empty\")\n if all(results):\n return \"pass\"\n if not any(results):\n return \"fail\"\n return \"flaky\"\n", "test_solution.py": "import unittest\nfrom solution import classify_flaky\n\nclass Test(unittest.TestCase):\n def test_kinds(self):\n self.assertEqual(classify_flaky([True, True]), \"pass\")\n self.assertEqual(classify_flaky([False, False]), \"fail\")\n self.assertEqual(classify_flaky([True, False, True]), \"flaky\")\n"}}, "topic": "test_debugging"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-flake-rerun-0082fc318002", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.625, "tests": 0.0, "total": 3.8000000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "flake_rerun", "topic": "test_debugging"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `classify_flaky(results)` where results is a list of bool pass/fail\nfor the same test. Return `pass` if all True, `fail` if all False, `flaky` otherwise.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def classify_flaky(results):\n if not results:\n raise ValueError(\"empty\")\n if all(results):\n return \"pass\"\n if not any(results):\n return \"fail\"\n return \"flaky\"", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_kinds (test_solution.Test.test_kinds) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent + 1)\n return best", "assumptions": [], "concept_id": "python.loops", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent + 1)\n return best\n", "test_solution.py": "import unittest\nfrom solution import nested_loop_depth\n\nclass Test(unittest.TestCase):\n def test_depth(self):\n src = \"for a in x:\\n for b in y:\\n z()\\n\"\n self.assertEqual(nested_loop_depth(src), 2)\n"}}, "topic": "code_review"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-review-complexity-8e95f6406df3", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.775, "tests": 0.0, "total": 4.975}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "review_complexity", "topic": "code_review"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `nested_loop_depth(source)` counting the maximum nesting of\nlines that strip-start with `for ` or `while ` based on leading indent (4 spaces).\nThis is a review heuristic, not a Python parser.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent + 1)\n return best", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_depth (test_solution.Test.test_depth) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent + 1)\n return best", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_depth (test_solution.Test.test_depth) ... FAIL\n\n======================================================================\nFAIL: test_depth (test_solution.Test.test_depth)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0nqc8nks\\test_solution.py\", line 7, in test_depth\n self.assertEqual(nested_loop_depth(src), 2)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 != 2\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent - 1)\n return best\n", "test_solution.py": "import unittest\nfrom solution import nested_loop_depth\n\nclass Test(unittest.TestCase):\n def test_depth(self):\n src = \"for a in x:\\n for b in y:\\n z()\\n\"\n self.assertEqual(nested_loop_depth(src), 2)\n"}}, "topic": "code_review"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-review-complexity-64bf08596207", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_depth (test_solution.Test.test_depth) ... FAIL\n\n======================================================================\nFAIL: test_depth (test_solution.Test.test_depth)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0nqc8nks\\test_solution.py\", line 7, in test_depth\n self.assertEqual(nested_loop_depth(src), 2)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 != 2\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "review_complexity", "tests_passed_after_fix": 1, "topic": "code_review"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `nested_loop_depth(source)` counting the maximum nesting of\nlines that strip-start with `for ` or `while ` based on leading indent (4 spaces).\nThis is a review heuristic, not a Python parser.\n\n--- solution.py (buggy) ---\ndef nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent - 1)\n return best\n\n--- test_solution.py ---\nimport unittest\nfrom solution import nested_loop_depth\n\nclass Test(unittest.TestCase):\n def test_depth(self):\n src = \"for a in x:\\n for b in y:\\n z()\\n\"\n self.assertEqual(nested_loop_depth(src), 2)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_depth (test_solution.Test.test_depth) ... FAIL\n\n======================================================================\nFAIL: test_depth (test_solution.Test.test_depth)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0nqc8nks\\test_solution.py\", line 7, in test_depth\n self.assertEqual(nested_loop_depth(src), 2)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 != 2\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def nested_loop_depth(source):\n best = 0\n for raw in source.splitlines():\n if not raw.strip():\n continue\n indent = (len(raw) - len(raw.lstrip(\" \"))) // 4\n stripped = raw.strip()\n if stripped.startswith(\"for \") or stripped.startswith(\"while \"):\n best = max(best, indent + 1)\n return best", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_depth (test_solution.Test.test_depth) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 == 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 == 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")\n", "test_solution.py": "import unittest\nfrom solution import decode_uleb128\n\nclass Test(unittest.TestCase):\n def test_small(self):\n self.assertEqual(decode_uleb128(bytes([127])), (127, 1))\n def test_multi(self):\n self.assertEqual(decode_uleb128(bytes([0xE5, 0x8E, 0x26])), (624485, 3))\n"}}, "topic": "language_design"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-wasm-leb-u32-d0df71ce4311", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 4.05}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "wasm_leb_u32", "topic": "language_design"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `decode_uleb128(data: bytes)` decoding one unsigned LEB128\ninteger from the start of data and returning (value, bytes_consumed).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 == 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_multi (test_solution.Test.test_multi) ... ok\ntest_small (test_solution.Test.test_small) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 == 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_multi (test_solution.Test.test_multi) ... FAIL\ntest_small (test_solution.Test.test_small) ... ERROR\n\n======================================================================\nERROR: test_small (test_solution.Test.test_small)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\test_solution.py\", line 6, in test_small\n self.assertEqual(decode_uleb128(bytes([127])), (127, 1))\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\solution.py\", line 11, in decode_uleb128\n raise ValueError(\"truncated\")\nValueError: truncated\n\n======================================================================\nFAIL: test_multi (test_solution.Test.test_multi)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\test_solution.py\", line 8, in test_multi\n self.assertEqual(decode_uleb128(bytes([0xE5, 0x8E, 0x26])), (624485, 3))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Tuples differ: (101, 1) != (624485, 3)\n\nFirst differing element 0:\n101\n624485\n\n- (101, 1)\n+ (624485, 3)\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=1, errors=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 != 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")\n", "test_solution.py": "import unittest\nfrom solution import decode_uleb128\n\nclass Test(unittest.TestCase):\n def test_small(self):\n self.assertEqual(decode_uleb128(bytes([127])), (127, 1))\n def test_multi(self):\n self.assertEqual(decode_uleb128(bytes([0xE5, 0x8E, 0x26])), (624485, 3))\n"}}, "topic": "language_design"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-wasm-leb-u32-e9afe132cbaf", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.825}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 1, "failures": 1, "passed": false, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_multi (test_solution.Test.test_multi) ... FAIL\ntest_small (test_solution.Test.test_small) ... ERROR\n\n======================================================================\nERROR: test_small (test_solution.Test.test_small)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\test_solution.py\", line 6, in test_small\n self.assertEqual(decode_uleb128(bytes([127])), (127, 1))\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\solution.py\", line 11, in decode_uleb128\n raise ValueError(\"truncated\")\nValueError: truncated\n\n======================================================================\nFAIL: test_multi (test_solution.Test.test_multi)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\test_solution.py\", line 8, in test_multi\n self.assertEqual(decode_uleb128(bytes([0xE5, 0x8E, 0x26])), (624485, 3))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Tuples differ: (101, 1) != (624485, 3)\n\nFirst differing element 0:\n101\n624485\n\n- (101, 1)\n+ (624485, 3)\n\n----------------------------------------------------------------------\nRan 2 tests in 0.001s\n\nFAILED (failures=1, errors=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 2, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "wasm_leb_u32", "tests_passed_after_fix": 2, "topic": "language_design"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `decode_uleb128(data: bytes)` decoding one unsigned LEB128\ninteger from the start of data and returning (value, bytes_consumed).\n\n--- solution.py (buggy) ---\ndef decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 != 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")\n\n--- test_solution.py ---\nimport unittest\nfrom solution import decode_uleb128\n\nclass Test(unittest.TestCase):\n def test_small(self):\n self.assertEqual(decode_uleb128(bytes([127])), (127, 1))\n def test_multi(self):\n self.assertEqual(decode_uleb128(bytes([0xE5, 0x8E, 0x26])), (624485, 3))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 1, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_multi (test_solution.Test.test_multi) ... FAIL\ntest_small (test_solution.Test.test_small) ... ERROR\n\n======================================================================\nERROR: test_small (test_solution.Test.test_small)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\test_solution.py\", line 6, in test_small\n self.assertEqual(decode_uleb128(bytes([127])), (127, 1))\n ~~~~~~~~~~~~~~^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\solution.py\", line 11, in decode_uleb128\n raise ValueError(\"truncated\")\nValueError: truncated\n\n======================================================================\nFAIL: test_multi (test_solution.Test.test_multi)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-0xe2v5mf\\test_solution.py\", line 8, in test_multi\n self.assertEqual(decode_uleb128(bytes([0xE5, 0x8E, 0x26])), (624485, 3))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Tuples differ: (101, 1) != (624485, 3)\n\nFirst differing element 0:\n101\n624485\n\n- (101, 1)\n+ (624485, 3)\n\n------------------------------------------------------------------", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def decode_uleb128(data):\n result = 0\n shift = 0\n for i, byte in enumerate(data):\n result |= (byte & 0x7F) << shift\n if byte & 0x80 == 0:\n return result, i + 1\n shift += 7\n if shift > 35:\n raise ValueError(\"overflow\")\n raise ValueError(\"truncated\")", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_multi (test_solution.Test.test_multi) ... ok\ntest_small (test_solution.Test.test_small) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return False\n return rec(0, 0)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return False\n return rec(0, 0)\n", "test_solution.py": "import unittest\nfrom solution import glob_match\n\nclass Test(unittest.TestCase):\n def test_star(self):\n self.assertTrue(glob_match(\"a*c\", \"abbbc\"))\n self.assertFalse(glob_match(\"a*c\", \"abbbd\"))\n self.assertTrue(glob_match(\"*\", \"\"))\n"}}, "topic": "shell"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-glob-match-star-9bbfe8b3863c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.925000000000001}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "glob_match_star", "topic": "shell"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `glob_match(pat, name)` supporting only `*` (any sequence) and\nliteral characters. No character classes. Match the whole name.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return False\n return rec(0, 0)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_star (test_solution.Test.test_star) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return False\n return rec(0, 0)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_star (test_solution.Test.test_star) ... FAIL\n\n======================================================================\nFAIL: test_star (test_solution.Test.test_star)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-dogezzxx\\test_solution.py\", line 7, in test_star\n self.assertFalse(glob_match(\"a*c\", \"abbbd\"))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: True is not false\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return True\n return rec(0, 0)\n", "test_solution.py": "import unittest\nfrom solution import glob_match\n\nclass Test(unittest.TestCase):\n def test_star(self):\n self.assertTrue(glob_match(\"a*c\", \"abbbc\"))\n self.assertFalse(glob_match(\"a*c\", \"abbbd\"))\n self.assertTrue(glob_match(\"*\", \"\"))\n"}}, "topic": "shell"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-glob-match-star-97f6075b33ec", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.5, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.975, "tests": 0.0, "total": 10.775}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_star (test_solution.Test.test_star) ... FAIL\n\n======================================================================\nFAIL: test_star (test_solution.Test.test_star)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-dogezzxx\\test_solution.py\", line 7, in test_star\n self.assertFalse(glob_match(\"a*c\", \"abbbd\"))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: True is not false\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "glob_match_star", "tests_passed_after_fix": 1, "topic": "shell"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `glob_match(pat, name)` supporting only `*` (any sequence) and\nliteral characters. No character classes. Match the whole name.\n\n--- solution.py (buggy) ---\ndef glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return True\n return rec(0, 0)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import glob_match\n\nclass Test(unittest.TestCase):\n def test_star(self):\n self.assertTrue(glob_match(\"a*c\", \"abbbc\"))\n self.assertFalse(glob_match(\"a*c\", \"abbbd\"))\n self.assertTrue(glob_match(\"*\", \"\"))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_star (test_solution.Test.test_star) ... FAIL\n\n======================================================================\nFAIL: test_star (test_solution.Test.test_star)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-dogezzxx\\test_solution.py\", line 7, in test_star\n self.assertFalse(glob_match(\"a*c\", \"abbbd\"))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: True is not false\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def glob_match(pat, name):\n def rec(i, j):\n if i == len(pat):\n return j == len(name)\n if pat[i] == \"*\":\n return rec(i + 1, j) or (j < len(name) and rec(i, j + 1))\n if j < len(name) and pat[i] == name[j]:\n return rec(i + 1, j + 1)\n return False\n return rec(0, 0)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_star (test_solution.Test.test_star) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "import re\n\nTOKEN = re.compile(r\"\\$({)?([A-Z_][A-Z0-9_]*)(?(1)})\")\n\ndef expand_vars(text, env):\n out = []\n i = 0\n in_single = False\n while i < len(text):\n ch = text[i]\n if ch == \"'\" :\n in_single = not in_single\n out.append(ch)\n i += 1\n continue\n if not in_single and ch == \"$\":\n m = TOKEN.match(text, i)\n if m:\n out.append(env.get(m.group(2), \"\"))\n i = m.end()\n continue\n out.append(ch)\n i += 1\n return \"\".join(out)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\nTOKEN = re.compile(r\"\\$({)?([A-Z_][A-Z0-9_]*)(?(1)})\")\n\ndef expand_vars(text, env):\n out = []\n i = 0\n in_single = False\n while i < len(text):\n ch = text[i]\n if ch == \"'\" :\n in_single = not in_single\n out.append(ch)\n i += 1\n continue\n if not in_single and ch == \"$\":\n m = TOKEN.match(text, i)\n if m:\n out.append(env.get(m.group(2), \"\"))\n i = m.end()\n continue\n out.append(ch)\n i += 1\n return \"\".join(out)\n", "test_solution.py": "import unittest\nfrom solution import expand_vars\n\nclass Test(unittest.TestCase):\n def test_expand(self):\n env = {\"HOME\": \"/u\", \"A\": \"x\"}\n self.assertEqual(expand_vars(\"$HOME/${A}\", env), \"/u/x\")\n self.assertEqual(expand_vars(\"'$HOME'\", env), \"'$HOME'\")\n"}}, "topic": "configuration"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-env-expand-56b651320e58", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.575, "tests": 0.0, "total": 6.0249999999999995}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "env_expand", "topic": "configuration"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `expand_vars(text, env)` replacing `$NAME` and `${NAME}` where NAME\nis `[A-Z_][A-Z0-9_]*`. Unknown names become empty string. Do not expand inside\nsingle quotes `'...'`.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\nTOKEN = re.compile(r\"\\$({)?([A-Z_][A-Z0-9_]*)(?(1)})\")\n\ndef expand_vars(text, env):\n out = []\n i = 0\n in_single = False\n while i < len(text):\n ch = text[i]\n if ch == \"'\" :\n in_single = not in_single\n out.append(ch)\n i += 1\n continue\n if not in_single and ch == \"$\":\n m = TOKEN.match(text, i)\n if m:\n out.append(env.get(m.group(2), \"\"))\n i = m.end()\n continue\n out.append(ch)\n i += 1\n return \"\".join(out)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_expand (test_solution.Test.test_expand) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section == \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section == \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted\n", "test_solution.py": "import unittest\nfrom solution import parse_wantedby\n\nclass Test(unittest.TestCase):\n def test_install(self):\n text = \"[Unit]\\n[Install]\\nWantedBy=multi-user.target\\n\"\n self.assertEqual(parse_wantedby(text), \"multi-user.target\")\n"}}, "topic": "deployment"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-systemd-wanted-cbf71b9551eb", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 3.8500000000000005}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "systemd_wanted", "topic": "deployment"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `parse_wantedby(unit_text)` returning the WantedBy= value from an\n`[Install]` section, or None. Last matching line wins. Ignore comments.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section == \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_install (test_solution.Test.test_install) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section == \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_install (test_solution.Test.test_install) ... FAIL\n\n======================================================================\nFAIL: test_install (test_solution.Test.test_install)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xlarccy8\\test_solution.py\", line 7, in test_install\n self.assertEqual(parse_wantedby(text), \"multi-user.target\")\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: None != 'multi-user.target'\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section != \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted\n", "test_solution.py": "import unittest\nfrom solution import parse_wantedby\n\nclass Test(unittest.TestCase):\n def test_install(self):\n text = \"[Unit]\\n[Install]\\nWantedBy=multi-user.target\\n\"\n self.assertEqual(parse_wantedby(text), \"multi-user.target\")\n"}}, "topic": "deployment"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-systemd-wanted-fcf39d041b97", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.65, "tests": 0.0, "total": 10.5}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_install (test_solution.Test.test_install) ... FAIL\n\n======================================================================\nFAIL: test_install (test_solution.Test.test_install)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xlarccy8\\test_solution.py\", line 7, in test_install\n self.assertEqual(parse_wantedby(text), \"multi-user.target\")\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: None != 'multi-user.target'\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "systemd_wanted", "tests_passed_after_fix": 1, "topic": "deployment"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `parse_wantedby(unit_text)` returning the WantedBy= value from an\n`[Install]` section, or None. Last matching line wins. Ignore comments.\n\n--- solution.py (buggy) ---\ndef parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section != \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted\n\n--- test_solution.py ---\nimport unittest\nfrom solution import parse_wantedby\n\nclass Test(unittest.TestCase):\n def test_install(self):\n text = \"[Unit]\\n[Install]\\nWantedBy=multi-user.target\\n\"\n self.assertEqual(parse_wantedby(text), \"multi-user.target\")\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_install (test_solution.Test.test_install) ... FAIL\n\n======================================================================\nFAIL: test_install (test_solution.Test.test_install)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-xlarccy8\\test_solution.py\", line 7, in test_install\n self.assertEqual(parse_wantedby(text), \"multi-user.target\")\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: None != 'multi-user.target'\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def parse_wantedby(unit_text):\n section = None\n wanted = None\n for raw in unit_text.splitlines():\n line = raw.split(\";\", 1)[0].split(\"#\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n continue\n if section == \"Install\" and line.startswith(\"WantedBy=\"):\n wanted = line.split(\"=\", 1)[1].strip()\n return wanted", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_install (test_solution.Test.test_install) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def parse_cpu(value):\n if value.endswith(\"m\") and value[:-1].isdigit():\n return int(value[:-1]) / 1000.0\n if value.replace(\".\", \"\", 1).isdigit():\n return float(value)\n raise ValueError(value)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def parse_cpu(value):\n if value.endswith(\"m\") and value[:-1].isdigit():\n return int(value[:-1]) / 1000.0\n if value.replace(\".\", \"\", 1).isdigit():\n return float(value)\n raise ValueError(value)\n", "test_solution.py": "import unittest\nfrom solution import parse_cpu\n\nclass Test(unittest.TestCase):\n def test_cpu(self):\n self.assertEqual(parse_cpu(\"100m\"), 0.1)\n self.assertEqual(parse_cpu(\"2\"), 2.0)\n"}}, "topic": "deployment"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-k8s-resource-parse-75bda9ed0cce", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.375, "tests": 0.0, "total": 4.35}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "k8s_resource_parse", "topic": "deployment"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `parse_cpu(value)` converting Kubernetes CPU strings: `100m` -> 0.1,\n`2` -> 2.0. Raise ValueError otherwise.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def parse_cpu(value):\n if value.endswith(\"m\") and value[:-1].isdigit():\n return int(value[:-1]) / 1000.0\n if value.replace(\".\", \"\", 1).isdigit():\n return float(value)\n raise ValueError(value)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cpu (test_solution.Test.test_cpu) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i + 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i + 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]\n", "test_solution.py": "import unittest\nfrom solution import Ring\n\nclass Test(unittest.TestCase):\n def test_wrap(self):\n r = Ring(3)\n for x in range(5):\n r.push(x)\n self.assertEqual(r.snapshot(), [2, 3, 4])\n"}}, "topic": "data_structures"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-ring-buffer-180e5d3a925c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.325, "tests": 0.0, "total": 5.125}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "ring_buffer", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `Ring(n)` with `push(x)` (overwrite oldest when full) and\n`snapshot()` returning items oldest-to-newest.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i + 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_wrap (test_solution.Test.test_wrap) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i + 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_wrap (test_solution.Test.test_wrap) ... FAIL\n\n======================================================================\nFAIL: test_wrap (test_solution.Test.test_wrap)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-byeo4lnf\\test_solution.py\", line 9, in test_wrap\n self.assertEqual(r.snapshot(), [2, 3, 4])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [2, 4, 3] != [2, 3, 4]\n\nFirst differing element 1:\n4\n3\n\n- [2, 4, 3]\n+ [2, 3, 4]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i - 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]\n", "test_solution.py": "import unittest\nfrom solution import Ring\n\nclass Test(unittest.TestCase):\n def test_wrap(self):\n r = Ring(3)\n for x in range(5):\n r.push(x)\n self.assertEqual(r.snapshot(), [2, 3, 4])\n"}}, "topic": "data_structures"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-ring-buffer-649ece92c6c6", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.7, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_wrap (test_solution.Test.test_wrap) ... FAIL\n\n======================================================================\nFAIL: test_wrap (test_solution.Test.test_wrap)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-byeo4lnf\\test_solution.py\", line 9, in test_wrap\n self.assertEqual(r.snapshot(), [2, 3, 4])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [2, 4, 3] != [2, 3, 4]\n\nFirst differing element 1:\n4\n3\n\n- [2, 4, 3]\n+ [2, 3, 4]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "ring_buffer", "tests_passed_after_fix": 1, "topic": "data_structures"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `Ring(n)` with `push(x)` (overwrite oldest when full) and\n`snapshot()` returning items oldest-to-newest.\n\n--- solution.py (buggy) ---\nclass Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i - 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]\n\n--- test_solution.py ---\nimport unittest\nfrom solution import Ring\n\nclass Test(unittest.TestCase):\n def test_wrap(self):\n r = Ring(3)\n for x in range(5):\n r.push(x)\n self.assertEqual(r.snapshot(), [2, 3, 4])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_wrap (test_solution.Test.test_wrap) ... FAIL\n\n======================================================================\nFAIL: test_wrap (test_solution.Test.test_wrap)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-byeo4lnf\\test_solution.py\", line 9, in test_wrap\n self.assertEqual(r.snapshot(), [2, 3, 4])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [2, 4, 3] != [2, 3, 4]\n\nFirst differing element 1:\n4\n3\n\n- [2, 4, 3]\n+ [2, 3, 4]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class Ring:\n def __init__(self, n):\n if n < 1:\n raise ValueError(\"n\")\n self.buf = [None] * n\n self.n = n\n self.i = 0\n self.size = 0\n\n def push(self, x):\n self.buf[self.i] = x\n self.i = (self.i + 1) % self.n\n self.size = min(self.size + 1, self.n)\n\n def snapshot(self):\n start = (self.i - self.size) % self.n\n return [self.buf[(start + k) % self.n] for k in range(self.size)]", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_wrap (test_solution.Test.test_wrap) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return True", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return True\n", "test_solution.py": "import unittest\nfrom solution import UnionFind\n\nclass Test(unittest.TestCase):\n def test_uf(self):\n u = UnionFind(4)\n self.assertTrue(u.union(0, 1))\n self.assertTrue(u.union(2, 3))\n self.assertFalse(u.union(0, 1))\n self.assertEqual(u.find(0), u.find(1))\n self.assertNotEqual(u.find(0), u.find(2))\n"}}, "topic": "data_structures"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-union-find-39864eb16b6c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.55, "tests": 0.0, "total": 4.625}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "union_find", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `UnionFind(n)` with 0..n-1 elements, `find(i)`, `union(i,j)`\nreturning True if they were in different sets. Use path compression and union by rank.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return True", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_uf (test_solution.Test.test_uf) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return True", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_uf (test_solution.Test.test_uf) ... FAIL\n\n======================================================================\nFAIL: test_uf (test_solution.Test.test_uf)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-06_ablgo\\test_solution.py\", line 7, in test_uf\n self.assertTrue(u.union(0, 1))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return False\n", "test_solution.py": "import unittest\nfrom solution import UnionFind\n\nclass Test(unittest.TestCase):\n def test_uf(self):\n u = UnionFind(4)\n self.assertTrue(u.union(0, 1))\n self.assertTrue(u.union(2, 3))\n self.assertFalse(u.union(0, 1))\n self.assertEqual(u.find(0), u.find(1))\n self.assertNotEqual(u.find(0), u.find(2))\n"}}, "topic": "data_structures"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-union-find-a0fd676c4519", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.85, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.15}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_uf (test_solution.Test.test_uf) ... FAIL\n\n======================================================================\nFAIL: test_uf (test_solution.Test.test_uf)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-06_ablgo\\test_solution.py\", line 7, in test_uf\n self.assertTrue(u.union(0, 1))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "union_find", "tests_passed_after_fix": 1, "topic": "data_structures"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `UnionFind(n)` with 0..n-1 elements, `find(i)`, `union(i,j)`\nreturning True if they were in different sets. Use path compression and union by rank.\n\n--- solution.py (buggy) ---\nclass UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return False\n\n--- test_solution.py ---\nimport unittest\nfrom solution import UnionFind\n\nclass Test(unittest.TestCase):\n def test_uf(self):\n u = UnionFind(4)\n self.assertTrue(u.union(0, 1))\n self.assertTrue(u.union(2, 3))\n self.assertFalse(u.union(0, 1))\n self.assertEqual(u.find(0), u.find(1))\n self.assertNotEqual(u.find(0), u.find(2))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_uf (test_solution.Test.test_uf) ... FAIL\n\n======================================================================\nFAIL: test_uf (test_solution.Test.test_uf)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-06_ablgo\\test_solution.py\", line 7, in test_uf\n self.assertTrue(u.union(0, 1))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:43Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "class UnionFind:\n def __init__(self, n):\n self.p = list(range(n))\n self.r = [0] * n\n\n def find(self, i):\n while self.p[i] != i:\n self.p[i] = self.p[self.p[i]]\n i = self.p[i]\n return i\n\n def union(self, i, j):\n a, b = self.find(i), self.find(j)\n if a == b:\n return False\n if self.r[a] < self.r[b]:\n a, b = b, a\n self.p[b] = a\n if self.r[a] == self.r[b]:\n self.r[a] += 1\n return True", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_uf (test_solution.Test.test_uf) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def knapsack(weights, values, cap):\n dp = [0] * (cap + 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def knapsack(weights, values, cap):\n dp = [0] * (cap + 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]\n", "test_solution.py": "import unittest\nfrom solution import knapsack\n\nclass Test(unittest.TestCase):\n def test_ks(self):\n self.assertEqual(knapsack([2, 3, 4], [3, 4, 5], 5), 7)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-knapsack-01-5de1ee8eaac8", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.35, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.625, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.2, "tests": 0.0, "total": 4.775}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "knapsack_01", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `knapsack(weights, values, cap)` 0/1 knapsack maximum value.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def knapsack(weights, values, cap):\n dp = [0] * (cap + 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ks (test_solution.Test.test_ks) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def knapsack(weights, values, cap):\n dp = [0] * (cap + 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_ks (test_solution.Test.test_ks) ... ERROR\n\n======================================================================\nERROR: test_ks (test_solution.Test.test_ks)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ho4m81vl\\test_solution.py\", line 6, in test_ks\n self.assertEqual(knapsack([2, 3, 4], [3, 4, 5], 5), 7)\n ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ho4m81vl\\solution.py\", line 5, in knapsack\n dp[c] = max(dp[c], dp[c - w] + v)\n ~~^^^\nIndexError: list index out of range\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def knapsack(weights, values, cap):\n dp = [0] * (cap - 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]\n", "test_solution.py": "import unittest\nfrom solution import knapsack\n\nclass Test(unittest.TestCase):\n def test_ks(self):\n self.assertEqual(knapsack([2, 3, 4], [3, 4, 5], 5), 7)\n"}}, "topic": "algorithms"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-knapsack-01-52b68fcd2408", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.35, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.9, "tests": 0.0, "total": 10.549999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 1, "failures": 0, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_ks (test_solution.Test.test_ks) ... ERROR\n\n======================================================================\nERROR: test_ks (test_solution.Test.test_ks)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ho4m81vl\\test_solution.py\", line 6, in test_ks\n self.assertEqual(knapsack([2, 3, 4], [3, 4, 5], 5), 7)\n ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ho4m81vl\\solution.py\", line 5, in knapsack\n dp[c] = max(dp[c], dp[c - w] + v)\n ~~^^^\nIndexError: list index out of range\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "knapsack_01", "tests_passed_after_fix": 1, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `knapsack(weights, values, cap)` 0/1 knapsack maximum value.\n\n--- solution.py (buggy) ---\ndef knapsack(weights, values, cap):\n dp = [0] * (cap - 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]\n\n--- test_solution.py ---\nimport unittest\nfrom solution import knapsack\n\nclass Test(unittest.TestCase):\n def test_ks(self):\n self.assertEqual(knapsack([2, 3, 4], [3, 4, 5], 5), 7)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_ks (test_solution.Test.test_ks) ... ERROR\n\n======================================================================\nERROR: test_ks (test_solution.Test.test_ks)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ho4m81vl\\test_solution.py\", line 6, in test_ks\n self.assertEqual(knapsack([2, 3, 4], [3, 4, 5], 5), 7)\n ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-ho4m81vl\\solution.py\", line 5, in knapsack\n dp[c] = max(dp[c], dp[c - w] + v)\n ~~^^^\nIndexError: list index out of range\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def knapsack(weights, values, cap):\n dp = [0] * (cap + 1)\n for w, v in zip(weights, values):\n for c in range(cap, w - 1, -1):\n dp[c] = max(dp[c], dp[c - w] + v)\n return dp[cap]", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ks (test_solution.Test.test_ks) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import deque\n\ndef bfs_order(graph, start):\n seen = {start}\n q = deque([start])\n order = []\n while q:\n node = q.popleft()\n order.append(node)\n for nxt in graph.get(node, []):\n if nxt not in seen:\n seen.add(nxt)\n q.append(nxt)\n return order", "assumptions": [], "concept_id": "python.loops", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\ndef bfs_order(graph, start):\n seen = {start}\n q = deque([start])\n order = []\n while q:\n node = q.popleft()\n order.append(node)\n for nxt in graph.get(node, []):\n if nxt not in seen:\n seen.add(nxt)\n q.append(nxt)\n return order\n", "test_solution.py": "import unittest\nfrom solution import bfs_order\n\nclass Test(unittest.TestCase):\n def test_bfs(self):\n g = {1: [2, 3], 2: [4], 3: [], 4: []}\n self.assertEqual(bfs_order(g, 1), [1, 2, 3, 4])\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-bfs-levels-5c27c81b563d", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 3.7750000000000004}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "bfs_levels", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `bfs_order(graph, start)` returning nodes in BFS order. graph maps\nnode -> iterable of neighbors. Skip missing neighbor keys.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\ndef bfs_order(graph, start):\n seen = {start}\n q = deque([start])\n order = []\n while q:\n node = q.popleft()\n order.append(node)\n for nxt in graph.get(node, []):\n if nxt not in seen:\n seen.add(nxt)\n q.append(nxt)\n return order", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bfs (test_solution.Test.test_bfs) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def covered_length(ranges):\n if not ranges:\n return 0\n ordered = sorted(ranges)\n total = 0\n cs, ce = ordered[0]\n for s, e in ordered[1:]:\n if s > ce:\n total += ce - cs\n cs, ce = s, e\n else:\n ce = max(ce, e)\n total += ce - cs\n return total", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def covered_length(ranges):\n if not ranges:\n return 0\n ordered = sorted(ranges)\n total = 0\n cs, ce = ordered[0]\n for s, e in ordered[1:]:\n if s > ce:\n total += ce - cs\n cs, ce = s, e\n else:\n ce = max(ce, e)\n total += ce - cs\n return total\n", "test_solution.py": "import unittest\nfrom solution import covered_length\n\nclass Test(unittest.TestCase):\n def test_cover(self):\n self.assertEqual(covered_length([(0, 3), (2, 5), (10, 12)]), 7)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-interval-coverage-973204b58c0f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.3, "tests": 0.0, "total": 4.575}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "interval_coverage", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `covered_length(ranges)` total length covered by [start,end]\nhalf-open intervals. Overlaps count once.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def covered_length(ranges):\n if not ranges:\n return 0\n ordered = sorted(ranges)\n total = 0\n cs, ce = ordered[0]\n for s, e in ordered[1:]:\n if s > ce:\n total += ce - cs\n cs, ce = s, e\n else:\n ce = max(ce, e)\n total += ce - cs\n return total", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_cover (test_solution.Test.test_cover) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return True", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return True\n", "test_solution.py": "import unittest\nfrom solution import SlidingWindow\n\nclass Test(unittest.TestCase):\n def test_sw(self):\n s = SlidingWindow(2, 10)\n self.assertTrue(s.allow(0))\n self.assertTrue(s.allow(1))\n self.assertFalse(s.allow(2))\n self.assertTrue(s.allow(11))\n"}}, "topic": "networking"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-rate-limit-sliding-dfd9e3aba9b3", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 4.2}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "rate_limit_sliding", "topic": "networking"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `SlidingWindow(limit, window)` with `allow(t)` where t is\nnon-decreasing time. At most `limit` events in (t-window, t].", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return True", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_sw (test_solution.Test.test_sw) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return True", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_sw (test_solution.Test.test_sw) ... FAIL\n\n======================================================================\nFAIL: test_sw (test_solution.Test.test_sw)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-i_lvhlh9\\test_solution.py\", line 7, in test_sw\n self.assertTrue(s.allow(0))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return False\n", "test_solution.py": "import unittest\nfrom solution import SlidingWindow\n\nclass Test(unittest.TestCase):\n def test_sw(self):\n s = SlidingWindow(2, 10)\n self.assertTrue(s.allow(0))\n self.assertTrue(s.allow(1))\n self.assertFalse(s.allow(2))\n self.assertTrue(s.allow(11))\n"}}, "topic": "networking"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-rate-limit-sliding-d86579ad1ffd", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.675, "tests": 0.0, "total": 10.649999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_sw (test_solution.Test.test_sw) ... FAIL\n\n======================================================================\nFAIL: test_sw (test_solution.Test.test_sw)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-i_lvhlh9\\test_solution.py\", line 7, in test_sw\n self.assertTrue(s.allow(0))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "rate_limit_sliding", "tests_passed_after_fix": 1, "topic": "networking"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `SlidingWindow(limit, window)` with `allow(t)` where t is\nnon-decreasing time. At most `limit` events in (t-window, t].\n\n--- solution.py (buggy) ---\nfrom collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return False\n\n--- test_solution.py ---\nimport unittest\nfrom solution import SlidingWindow\n\nclass Test(unittest.TestCase):\n def test_sw(self):\n s = SlidingWindow(2, 10)\n self.assertTrue(s.allow(0))\n self.assertTrue(s.allow(1))\n self.assertFalse(s.allow(2))\n self.assertTrue(s.allow(11))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_sw (test_solution.Test.test_sw) ... FAIL\n\n======================================================================\nFAIL: test_sw (test_solution.Test.test_sw)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-i_lvhlh9\\test_solution.py\", line 7, in test_sw\n self.assertTrue(s.allow(0))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\nclass SlidingWindow:\n def __init__(self, limit, window):\n self.limit = limit\n self.window = window\n self.q = deque()\n\n def allow(self, t):\n while self.q and self.q[0] <= t - self.window:\n self.q.popleft()\n if len(self.q) >= self.limit:\n return False\n self.q.append(t)\n return True", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_sw (test_solution.Test.test_sw) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def b64_pad(s):\n m = len(s) % 4\n if m == 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def b64_pad(s):\n m = len(s) % 4\n if m == 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s\n", "test_solution.py": "import unittest\nfrom solution import b64_pad\n\nclass Test(unittest.TestCase):\n def test_pad(self):\n self.assertEqual(b64_pad(\"TQ\"), \"TQ==\")\n self.assertEqual(b64_pad(\"TWE\"), \"TWE=\")\n"}}, "topic": "api_usage"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-base64-pad-5ba7bc4c7cea", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 4.15}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "base64_pad", "topic": "api_usage"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `b64_pad(s)` adding the correct `=` padding to a base64 string\nwithout padding. Do not decode.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def b64_pad(s):\n m = len(s) % 4\n if m == 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_pad (test_solution.Test.test_pad) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def b64_pad(s):\n m = len(s) % 4\n if m == 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_pad (test_solution.Test.test_pad) ... ERROR\n\n======================================================================\nERROR: test_pad (test_solution.Test.test_pad)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4jfmh1lq\\test_solution.py\", line 6, in test_pad\n self.assertEqual(b64_pad(\"TQ\"), \"TQ==\")\n ~~~~~~~^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4jfmh1lq\\solution.py\", line 4, in b64_pad\n raise ValueError(\"invalid\")\nValueError: invalid\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def b64_pad(s):\n m = len(s) % 4\n if m != 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s\n", "test_solution.py": "import unittest\nfrom solution import b64_pad\n\nclass Test(unittest.TestCase):\n def test_pad(self):\n self.assertEqual(b64_pad(\"TQ\"), \"TQ==\")\n self.assertEqual(b64_pad(\"TWE\"), \"TWE=\")\n"}}, "topic": "api_usage"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-base64-pad-057c27806a8e", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.3, "tests": 0.0, "total": 10.0}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 1, "failures": 0, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_pad (test_solution.Test.test_pad) ... ERROR\n\n======================================================================\nERROR: test_pad (test_solution.Test.test_pad)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4jfmh1lq\\test_solution.py\", line 6, in test_pad\n self.assertEqual(b64_pad(\"TQ\"), \"TQ==\")\n ~~~~~~~^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4jfmh1lq\\solution.py\", line 4, in b64_pad\n raise ValueError(\"invalid\")\nValueError: invalid\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "base64_pad", "tests_passed_after_fix": 1, "topic": "api_usage"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `b64_pad(s)` adding the correct `=` padding to a base64 string\nwithout padding. Do not decode.\n\n--- solution.py (buggy) ---\ndef b64_pad(s):\n m = len(s) % 4\n if m != 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s\n\n--- test_solution.py ---\nimport unittest\nfrom solution import b64_pad\n\nclass Test(unittest.TestCase):\n def test_pad(self):\n self.assertEqual(b64_pad(\"TQ\"), \"TQ==\")\n self.assertEqual(b64_pad(\"TWE\"), \"TWE=\")\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_pad (test_solution.Test.test_pad) ... ERROR\n\n======================================================================\nERROR: test_pad (test_solution.Test.test_pad)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4jfmh1lq\\test_solution.py\", line 6, in test_pad\n self.assertEqual(b64_pad(\"TQ\"), \"TQ==\")\n ~~~~~~~^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4jfmh1lq\\solution.py\", line 4, in b64_pad\n raise ValueError(\"invalid\")\nValueError: invalid\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def b64_pad(s):\n m = len(s) % 4\n if m == 1:\n raise ValueError(\"invalid\")\n if m:\n s += \"=\" * (4 - m)\n return s", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_pad (test_solution.Test.test_pad) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def retry(fn, retries, retry_on):\n last = None\n for _ in range(retries + 1):\n try:\n return fn()\n except retry_on as exc:\n last = exc\n raise last", "assumptions": [], "concept_id": "python.exceptions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def retry(fn, retries, retry_on):\n last = None\n for _ in range(retries + 1):\n try:\n return fn()\n except retry_on as exc:\n last = exc\n raise last\n", "test_solution.py": "import unittest\nfrom solution import retry\n\nclass Test(unittest.TestCase):\n def test_retry(self):\n n = {\"c\": 0}\n def f():\n n[\"c\"] += 1\n if n[\"c\"] < 3:\n raise ValueError(\"x\")\n return 7\n self.assertEqual(retry(f, 5, ValueError), 7)\n self.assertEqual(n[\"c\"], 3)\n"}}, "topic": "devops"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-retry-predicate-827fb6f0d571", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.575, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.55, "tests": 0.0, "total": 4.2250000000000005}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "retry_predicate", "topic": "devops"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `retry(fn, retries, retry_on)` calling fn until it returns without\nraising an exception in retry_on, up to retries+1 attempts. Re-raise the last.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def retry(fn, retries, retry_on):\n last = None\n for _ in range(retries + 1):\n try:\n return fn()\n except retry_on as exc:\n last = exc\n raise last", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_retry (test_solution.Test.test_retry) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def parse_ini(text):\n data = {}\n section = None\n for raw in text.splitlines():\n line = raw.split(\";\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n data.setdefault(section, {})\n continue\n if section is None or \"=\" not in line:\n raise ValueError(line)\n k, v = line.split(\"=\", 1)\n data[section][k.strip()] = v.strip()\n return data", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def parse_ini(text):\n data = {}\n section = None\n for raw in text.splitlines():\n line = raw.split(\";\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n data.setdefault(section, {})\n continue\n if section is None or \"=\" not in line:\n raise ValueError(line)\n k, v = line.split(\"=\", 1)\n data[section][k.strip()] = v.strip()\n return data\n", "test_solution.py": "import unittest\nfrom solution import parse_ini\n\nclass Test(unittest.TestCase):\n def test_ini(self):\n text = \"[db]\\nhost=localhost\\n; c\\nport=1\\n\"\n self.assertEqual(parse_ini(text), {\"db\": {\"host\": \"localhost\", \"port\": \"1\"}})\n"}}, "topic": "configuration"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-ini-sections-c58ba9a266c7", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.625, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 3.875}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "ini_sections", "topic": "configuration"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `parse_ini(text)` returning dict[str, dict[str, str]] for\n`[section]` and `key=value` lines. Ignore blanks and `;` comments.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def parse_ini(text):\n data = {}\n section = None\n for raw in text.splitlines():\n line = raw.split(\";\", 1)[0].strip()\n if not line:\n continue\n if line.startswith(\"[\") and line.endswith(\"]\"):\n section = line[1:-1]\n data.setdefault(section, {})\n continue\n if section is None or \"=\" not in line:\n raise ValueError(line)\n k, v = line.split(\"=\", 1)\n data[section][k.strip()] = v.strip()\n return data", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ini (test_solution.Test.test_ini) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] == 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())", "assumptions": [], "concept_id": "python.loops", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] == 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())\n", "test_solution.py": "import unittest\nfrom solution import longest_path_dag\n\nclass Test(unittest.TestCase):\n def test_lp(self):\n w = {(\"a\", \"b\"): 2, (\"b\", \"c\"): 3, (\"a\", \"c\"): 4}\n self.assertEqual(longest_path_dag([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\"), (\"a\", \"c\")], w), 5)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-dag-longest-b3d7369135cf", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.775, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.725, "tests": 0.0, "total": 5.1000000000000005}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dag_longest", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `longest_path_dag(nodes, edges, weight)` where edges are (u,v)\nand weight[(u,v)] is a number. Graph is DAG. Return the maximum path weight\n(possibly a single node path of weight 0).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] == 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_lp (test_solution.Test.test_lp) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] == 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_lp (test_solution.Test.test_lp) ... ERROR\n\n======================================================================\nERROR: test_lp (test_solution.Test.test_lp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-c11ranue\\test_solution.py\", line 7, in test_lp\n self.assertEqual(longest_path_dag([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\"), (\"a\", \"c\")], w), 5)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-c11ranue\\solution.py\", line 21, in longest_path_dag\n raise ValueError(\"not a dag\")\nValueError: not a dag\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] != 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())\n", "test_solution.py": "import unittest\nfrom solution import longest_path_dag\n\nclass Test(unittest.TestCase):\n def test_lp(self):\n w = {(\"a\", \"b\"): 2, (\"b\", \"c\"): 3, (\"a\", \"c\"): 4}\n self.assertEqual(longest_path_dag([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\"), (\"a\", \"c\")], w), 5)\n"}}, "topic": "algorithms"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-dag-longest-6cdf248a6ba8", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.775, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.075}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 1, "failures": 0, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_lp (test_solution.Test.test_lp) ... ERROR\n\n======================================================================\nERROR: test_lp (test_solution.Test.test_lp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-c11ranue\\test_solution.py\", line 7, in test_lp\n self.assertEqual(longest_path_dag([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\"), (\"a\", \"c\")], w), 5)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-c11ranue\\solution.py\", line 21, in longest_path_dag\n raise ValueError(\"not a dag\")\nValueError: not a dag\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "dag_longest", "tests_passed_after_fix": 1, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `longest_path_dag(nodes, edges, weight)` where edges are (u,v)\nand weight[(u,v)] is a number. Graph is DAG. Return the maximum path weight\n(possibly a single node path of weight 0).\n\n--- solution.py (buggy) ---\nfrom collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] != 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())\n\n--- test_solution.py ---\nimport unittest\nfrom solution import longest_path_dag\n\nclass Test(unittest.TestCase):\n def test_lp(self):\n w = {(\"a\", \"b\"): 2, (\"b\", \"c\"): 3, (\"a\", \"c\"): 4}\n self.assertEqual(longest_path_dag([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\"), (\"a\", \"c\")], w), 5)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_lp (test_solution.Test.test_lp) ... ERROR\n\n======================================================================\nERROR: test_lp (test_solution.Test.test_lp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-c11ranue\\test_solution.py\", line 7, in test_lp\n self.assertEqual(longest_path_dag([\"a\", \"b\", \"c\"], [(\"a\", \"b\"), (\"b\", \"c\"), (\"a\", \"c\")], w), 5)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-c11ranue\\solution.py\", line 21, in longest_path_dag\n raise ValueError(\"not a dag\")\nValueError: not a dag\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import defaultdict, deque\n\ndef longest_path_dag(nodes, edges, weight):\n graph = defaultdict(list)\n indeg = {n: 0 for n in nodes}\n for u, v in edges:\n graph[u].append(v)\n indeg[v] += 1\n dist = {n: 0 for n in nodes}\n q = deque([n for n in nodes if indeg[n] == 0])\n seen = 0\n while q:\n u = q.popleft()\n seen += 1\n for v in graph[u]:\n dist[v] = max(dist[v], dist[u] + weight[(u, v)])\n indeg[v] -= 1\n if indeg[v] == 0:\n q.append(v)\n if seen != len(nodes):\n raise ValueError(\"not a dag\")\n return max(dist.values())", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_lp (test_solution.Test.test_lp) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "import heapq\n\ndef k_smallest(nums, k):\n if k <= 0:\n return []\n return sorted(heapq.nsmallest(min(k, len(nums)), nums))", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import heapq\n\ndef k_smallest(nums, k):\n if k <= 0:\n return []\n return sorted(heapq.nsmallest(min(k, len(nums)), nums))\n", "test_solution.py": "import unittest\nfrom solution import k_smallest\n\nclass Test(unittest.TestCase):\n def test_k(self):\n self.assertEqual(k_smallest([5, 1, 4, 2], 2), [1, 2])\n self.assertEqual(k_smallest([3], 5), [3])\n"}}, "topic": "data_structures"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-min-heap-k-1732990ad1d2", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 3.5}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "min_heap_k", "topic": "data_structures"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `k_smallest(nums, k)` returning the k smallest values sorted\nascending. k may be 0. If k > n, return all sorted.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import heapq\n\ndef k_smallest(nums, k):\n if k <= 0:\n return []\n return sorted(heapq.nsmallest(min(k, len(nums)), nums))", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_k (test_solution.Test.test_k) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return not diff", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return not diff\n", "test_solution.py": "import unittest\nfrom solution import constant_eq\n\nclass Test(unittest.TestCase):\n def test_eq(self):\n self.assertTrue(constant_eq(\"abc\", \"abc\"))\n self.assertFalse(constant_eq(\"abc\", \"ab\"))\n self.assertFalse(constant_eq(\"abc\", \"abd\"))\n"}}, "topic": "defensive_security"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-sha256-prefix-ac24cc8583f0", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 3.625}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "sha256_prefix", "topic": "defensive_security"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `constant_eq(a, b)` comparing two strings in time that depends\nonly on the length of the longer input (iterate zip_longest). Return True iff equal.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return not diff", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_eq (test_solution.Test.test_eq) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return not diff", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_eq (test_solution.Test.test_eq) ... FAIL\n\n======================================================================\nFAIL: test_eq (test_solution.Test.test_eq)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-zk_iybqw\\test_solution.py\", line 6, in test_eq\n self.assertTrue(constant_eq(\"abc\", \"abc\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return diff\n", "test_solution.py": "import unittest\nfrom solution import constant_eq\n\nclass Test(unittest.TestCase):\n def test_eq(self):\n self.assertTrue(constant_eq(\"abc\", \"abc\"))\n self.assertFalse(constant_eq(\"abc\", \"ab\"))\n self.assertFalse(constant_eq(\"abc\", \"abd\"))\n"}}, "topic": "defensive_security"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-sha256-prefix-988fab958287", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.425, "tests": 0.0, "total": 10.149999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_eq (test_solution.Test.test_eq) ... FAIL\n\n======================================================================\nFAIL: test_eq (test_solution.Test.test_eq)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-zk_iybqw\\test_solution.py\", line 6, in test_eq\n self.assertTrue(constant_eq(\"abc\", \"abc\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "sha256_prefix", "tests_passed_after_fix": 1, "topic": "defensive_security"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `constant_eq(a, b)` comparing two strings in time that depends\nonly on the length of the longer input (iterate zip_longest). Return True iff equal.\n\n--- solution.py (buggy) ---\nfrom itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return diff\n\n--- test_solution.py ---\nimport unittest\nfrom solution import constant_eq\n\nclass Test(unittest.TestCase):\n def test_eq(self):\n self.assertTrue(constant_eq(\"abc\", \"abc\"))\n self.assertFalse(constant_eq(\"abc\", \"ab\"))\n self.assertFalse(constant_eq(\"abc\", \"abd\"))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_eq (test_solution.Test.test_eq) ... FAIL\n\n======================================================================\nFAIL: test_eq (test_solution.Test.test_eq)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-zk_iybqw\\test_solution.py\", line 6, in test_eq\n self.assertTrue(constant_eq(\"abc\", \"abc\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: 0 is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from itertools import zip_longest\n\ndef constant_eq(a, b):\n diff = 0\n for x, y in zip_longest(a, b, fillvalue=None):\n diff |= (x != y)\n return not diff", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_eq (test_solution.Test.test_eq) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) >= threshold:\n out.append(line)\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) >= threshold:\n out.append(line)\n return out\n", "test_solution.py": "import unittest\nfrom solution import filter_logs\n\nclass Test(unittest.TestCase):\n def test_filter(self):\n lines = [\"DEBUG x\", \"INFO y\", \"ERROR z\"]\n self.assertEqual(filter_logs(lines, \"INFO\"), [\"INFO y\", \"ERROR z\"])\n"}}, "topic": "cli_development"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-log-level-filter-c471621f9dc2", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 3.825}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "log_level_filter", "topic": "cli_development"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `filter_logs(lines, min_level)` where each line starts with\nDEBUG|INFO|WARN|ERROR. Levels increase in that order. Keep lines at or above min_level.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) >= threshold:\n out.append(line)\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_filter (test_solution.Test.test_filter) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) >= threshold:\n out.append(line)\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_filter (test_solution.Test.test_filter) ... FAIL\n\n======================================================================\nFAIL: test_filter (test_solution.Test.test_filter)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-y0tloy1c\\test_solution.py\", line 7, in test_filter\n self.assertEqual(filter_logs(lines, \"INFO\"), [\"INFO y\", \"ERROR z\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['ERROR z'] != ['INFO y', 'ERROR z']\n\nFirst differing element 0:\n'ERROR z'\n'INFO y'\n\nSecond list contains 1 additional elements.\nFirst extra element 1:\n'ERROR z'\n\n- ['ERROR z']\n+ ['INFO y', 'ERROR z']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) > threshold:\n out.append(line)\n return out\n", "test_solution.py": "import unittest\nfrom solution import filter_logs\n\nclass Test(unittest.TestCase):\n def test_filter(self):\n lines = [\"DEBUG x\", \"INFO y\", \"ERROR z\"]\n self.assertEqual(filter_logs(lines, \"INFO\"), [\"INFO y\", \"ERROR z\"])\n"}}, "topic": "cli_development"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-log-level-filter-9ff7dd20e9d9", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_filter (test_solution.Test.test_filter) ... FAIL\n\n======================================================================\nFAIL: test_filter (test_solution.Test.test_filter)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-y0tloy1c\\test_solution.py\", line 7, in test_filter\n self.assertEqual(filter_logs(lines, \"INFO\"), [\"INFO y\", \"ERROR z\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['ERROR z'] != ['INFO y', 'ERROR z']\n\nFirst differing element 0:\n'ERROR z'\n'INFO y'\n\nSecond list contains 1 additional elements.\nFirst extra element 1:\n'ERROR z'\n\n- ['ERROR z']\n+ ['INFO y', 'ERROR z']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "log_level_filter", "tests_passed_after_fix": 1, "topic": "cli_development"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `filter_logs(lines, min_level)` where each line starts with\nDEBUG|INFO|WARN|ERROR. Levels increase in that order. Keep lines at or above min_level.\n\n--- solution.py (buggy) ---\nORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) > threshold:\n out.append(line)\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import filter_logs\n\nclass Test(unittest.TestCase):\n def test_filter(self):\n lines = [\"DEBUG x\", \"INFO y\", \"ERROR z\"]\n self.assertEqual(filter_logs(lines, \"INFO\"), [\"INFO y\", \"ERROR z\"])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_filter (test_solution.Test.test_filter) ... FAIL\n\n======================================================================\nFAIL: test_filter (test_solution.Test.test_filter)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-y0tloy1c\\test_solution.py\", line 7, in test_filter\n self.assertEqual(filter_logs(lines, \"INFO\"), [\"INFO y\", \"ERROR z\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['ERROR z'] != ['INFO y', 'ERROR z']\n\nFirst differing element 0:\n'ERROR z'\n'INFO y'\n\nSecond list contains 1 additional elements.\nFirst extra element 1:\n'ERROR z'\n\n- ['ERROR z']\n+ ['INFO y', 'ERROR z']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "ORDER = {\"DEBUG\": 0, \"INFO\": 1, \"WARN\": 2, \"ERROR\": 3}\n\ndef filter_logs(lines, min_level):\n threshold = ORDER[min_level]\n out = []\n for line in lines:\n lvl = line.split(\" \", 1)[0]\n if ORDER.get(lvl, -1) >= threshold:\n out.append(line)\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_filter (test_solution.Test.test_filter) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def matmul(a, b):\n if not a or not b or len(a[0]) != len(b):\n raise ValueError(\"shape\")\n cols = len(b[0])\n out = []\n for row in a:\n out.append([sum(row[k] * b[k][j] for k in range(len(b))) for j in range(cols)])\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def matmul(a, b):\n if not a or not b or len(a[0]) != len(b):\n raise ValueError(\"shape\")\n cols = len(b[0])\n out = []\n for row in a:\n out.append([sum(row[k] * b[k][j] for k in range(len(b))) for j in range(cols)])\n return out\n", "test_solution.py": "import unittest\nfrom solution import matmul\n\nclass Test(unittest.TestCase):\n def test_mul(self):\n self.assertEqual(matmul([[1, 2], [3, 4]], [[5, 6], [7, 8]]), [[19, 22], [43, 50]])\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-matrix-mul-a049547791a6", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.6}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "matrix_mul", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `matmul(a, b)` for lists of lists of numbers. Raise ValueError\non shape mismatch.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def matmul(a, b):\n if not a or not b or len(a[0]) != len(b):\n raise ValueError(\"shape\")\n cols = len(b[0])\n out = []\n for row in a:\n out.append([sum(row[k] * b[k][j] for k in range(len(b))) for j in range(cols)])\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_mul (test_solution.Test.test_mul) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) + 1\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) + 1\n return out\n", "test_solution.py": "import unittest\nfrom solution import char_freq\n\nclass Test(unittest.TestCase):\n def test_freq(self):\n self.assertEqual(char_freq(\"aba\"), {\"a\": 2, \"b\": 1})\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-huffman-freq-895f36a0c647", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.325, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.375, "tests": 0.0, "total": 3.6750000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "huffman_freq", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `char_freq(text)` returning a dict of character -> count,\nomitting zeros. Empty string yields {}.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) + 1\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_freq (test_solution.Test.test_freq) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) + 1\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_freq (test_solution.Test.test_freq) ... FAIL\n\n======================================================================\nFAIL: test_freq (test_solution.Test.test_freq)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4pi401pu\\test_solution.py\", line 6, in test_freq\n self.assertEqual(char_freq(\"aba\"), {\"a\": 2, \"b\": 1})\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: {'a': -2, 'b': -1} != {'a': 2, 'b': 1}\n- {'a': -2, 'b': -1}\n? - -\n\n+ {'a': 2, 'b': 1}\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) - 1\n return out\n", "test_solution.py": "import unittest\nfrom solution import char_freq\n\nclass Test(unittest.TestCase):\n def test_freq(self):\n self.assertEqual(char_freq(\"aba\"), {\"a\": 2, \"b\": 1})\n"}}, "topic": "algorithms"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-huffman-freq-4bebe0b75c56", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.325, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.525, "tests": 0.0, "total": 10.149999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_freq (test_solution.Test.test_freq) ... FAIL\n\n======================================================================\nFAIL: test_freq (test_solution.Test.test_freq)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4pi401pu\\test_solution.py\", line 6, in test_freq\n self.assertEqual(char_freq(\"aba\"), {\"a\": 2, \"b\": 1})\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: {'a': -2, 'b': -1} != {'a': 2, 'b': 1}\n- {'a': -2, 'b': -1}\n? - -\n\n+ {'a': 2, 'b': 1}\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "huffman_freq", "tests_passed_after_fix": 1, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `char_freq(text)` returning a dict of character -> count,\nomitting zeros. Empty string yields {}.\n\n--- solution.py (buggy) ---\ndef char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) - 1\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import char_freq\n\nclass Test(unittest.TestCase):\n def test_freq(self):\n self.assertEqual(char_freq(\"aba\"), {\"a\": 2, \"b\": 1})\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_freq (test_solution.Test.test_freq) ... FAIL\n\n======================================================================\nFAIL: test_freq (test_solution.Test.test_freq)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-4pi401pu\\test_solution.py\", line 6, in test_freq\n self.assertEqual(char_freq(\"aba\"), {\"a\": 2, \"b\": 1})\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: {'a': -2, 'b': -1} != {'a': 2, 'b': 1}\n- {'a': -2, 'b': -1}\n? - -\n\n+ {'a': 2, 'b': 1}\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def char_freq(text):\n out = {}\n for ch in text:\n out[ch] = out.get(ch, 0) + 1\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_freq (test_solution.Test.test_freq) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "import re\n\ndef parse_ymd(s):\n m = re.fullmatch(r\"(\\d{4})-(\\d{2})-(\\d{2})\", s)\n if not m:\n raise ValueError(s)\n y, mo, d = (int(m.group(i)) for i in range(1, 4))\n if not 1 <= mo <= 12 or not 1 <= d <= 31:\n raise ValueError(s)\n return y, mo, d", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef parse_ymd(s):\n m = re.fullmatch(r\"(\\d{4})-(\\d{2})-(\\d{2})\", s)\n if not m:\n raise ValueError(s)\n y, mo, d = (int(m.group(i)) for i in range(1, 4))\n if not 1 <= mo <= 12 or not 1 <= d <= 31:\n raise ValueError(s)\n return y, mo, d\n", "test_solution.py": "import unittest\nfrom solution import parse_ymd\n\nclass Test(unittest.TestCase):\n def test_ok(self):\n self.assertEqual(parse_ymd(\"2026-08-18\"), (2026, 8, 18))\n def test_bad(self):\n with self.assertRaises(ValueError):\n parse_ymd(\"2026-13-01\")\n"}}, "topic": "api_usage"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-iso8601-date-48d56e72db33", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.575}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "iso8601_date", "topic": "api_usage"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `parse_ymd(s)` parsing YYYY-MM-DD into (y,m,d) ints. Validate\nmonth 1-12 and day 1-31 (do not validate month lengths).", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef parse_ymd(s):\n m = re.fullmatch(r\"(\\d{4})-(\\d{2})-(\\d{2})\", s)\n if not m:\n raise ValueError(s)\n y, mo, d = (int(m.group(i)) for i in range(1, 4))\n if not 1 <= mo <= 12 or not 1 <= d <= 31:\n raise ValueError(s)\n return y, mo, d", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 2}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_bad (test_solution.Test.test_bad) ... ok\ntest_ok (test_solution.Test.test_ok) ... ok\n\n----------------------------------------------------------------------\nRan 2 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 2, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 2}} {"answer": "from collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] <= now:\n out.append(self.q.popleft()[1])\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] <= now:\n out.append(self.q.popleft()[1])\n return out\n", "test_solution.py": "import unittest\nfrom solution import ExpiredQueue\n\nclass Test(unittest.TestCase):\n def test_pop(self):\n q = ExpiredQueue()\n q.push(2, \"a\")\n q.push(5, \"b\")\n self.assertEqual(q.pop_ready(3), [\"a\"])\n self.assertEqual(q.pop_ready(4), [])\n self.assertEqual(q.pop_ready(5), [\"b\"])\n"}}, "topic": "distributed_systems"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-queue-ttl-ba54c5273800", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.5, "tests": 0.0, "total": 3.7750000000000004}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "queue_ttl", "topic": "distributed_systems"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `ExpiredQueue` with `push(t, item)` and `pop_ready(now)` returning\nall items with t <= now in insertion order and removing them.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] <= now:\n out.append(self.q.popleft()[1])\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_pop (test_solution.Test.test_pop) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "from collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] <= now:\n out.append(self.q.popleft()[1])\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_pop (test_solution.Test.test_pop) ... FAIL\n\n======================================================================\nFAIL: test_pop (test_solution.Test.test_pop)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-zh86l1rc\\test_solution.py\", line 11, in test_pop\n self.assertEqual(q.pop_ready(5), [\"b\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != ['b']\n\nSecond list contains 1 additional elements.\nFirst extra element 0:\n'b'\n\n- []\n+ ['b']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "from collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] < now:\n out.append(self.q.popleft()[1])\n return out\n", "test_solution.py": "import unittest\nfrom solution import ExpiredQueue\n\nclass Test(unittest.TestCase):\n def test_pop(self):\n q = ExpiredQueue()\n q.push(2, \"a\")\n q.push(5, \"b\")\n self.assertEqual(q.pop_ready(3), [\"a\"])\n self.assertEqual(q.pop_ready(4), [])\n self.assertEqual(q.pop_ready(5), [\"b\"])\n"}}, "topic": "distributed_systems"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-queue-ttl-e8968b2d040c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.975}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_pop (test_solution.Test.test_pop) ... FAIL\n\n======================================================================\nFAIL: test_pop (test_solution.Test.test_pop)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-zh86l1rc\\test_solution.py\", line 11, in test_pop\n self.assertEqual(q.pop_ready(5), [\"b\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != ['b']\n\nSecond list contains 1 additional elements.\nFirst extra element 0:\n'b'\n\n- []\n+ ['b']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "queue_ttl", "tests_passed_after_fix": 1, "topic": "distributed_systems"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `ExpiredQueue` with `push(t, item)` and `pop_ready(now)` returning\nall items with t <= now in insertion order and removing them.\n\n--- solution.py (buggy) ---\nfrom collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] < now:\n out.append(self.q.popleft()[1])\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import ExpiredQueue\n\nclass Test(unittest.TestCase):\n def test_pop(self):\n q = ExpiredQueue()\n q.push(2, \"a\")\n q.push(5, \"b\")\n self.assertEqual(q.pop_ready(3), [\"a\"])\n self.assertEqual(q.pop_ready(4), [])\n self.assertEqual(q.pop_ready(5), [\"b\"])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_pop (test_solution.Test.test_pop) ... FAIL\n\n======================================================================\nFAIL: test_pop (test_solution.Test.test_pop)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-zh86l1rc\\test_solution.py\", line 11, in test_pop\n self.assertEqual(q.pop_ready(5), [\"b\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [] != ['b']\n\nSecond list contains 1 additional elements.\nFirst extra element 0:\n'b'\n\n- []\n+ ['b']\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "from collections import deque\n\nclass ExpiredQueue:\n def __init__(self):\n self.q = deque()\n\n def push(self, t, item):\n self.q.append((t, item))\n\n def pop_ready(self, now):\n out = []\n while self.q and self.q[0][0] <= now:\n out.append(self.q.popleft()[1])\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_pop (test_solution.Test.test_pop) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def wrapping_checksum(data):\n return sum(data) % 256", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def wrapping_checksum(data):\n return sum(data) % 256\n", "test_solution.py": "import unittest\nfrom solution import wrapping_checksum\n\nclass Test(unittest.TestCase):\n def test_sum(self):\n self.assertEqual(wrapping_checksum(bytes([255, 2])), 1)\n"}}, "topic": "networking"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-crc-like-sum-3d708315ebe3", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.25, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.225, "tests": 0.0, "total": 3.075}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "crc_like_sum", "topic": "networking"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `wrapping_checksum(data: bytes)` as (sum of bytes) mod 256.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def wrapping_checksum(data):\n return sum(data) % 256", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_sum (test_solution.Test.test_sum) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def block_depth(lines):\n out = []\n for line in lines:\n if not line.strip():\n continue\n spaces = len(line) - len(line.lstrip(\" \"))\n if spaces % 2:\n raise ValueError(\"indent\")\n out.append(spaces // 2)\n return out", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def block_depth(lines):\n out = []\n for line in lines:\n if not line.strip():\n continue\n spaces = len(line) - len(line.lstrip(\" \"))\n if spaces % 2:\n raise ValueError(\"indent\")\n out.append(spaces // 2)\n return out\n", "test_solution.py": "import unittest\nfrom solution import block_depth\n\nclass Test(unittest.TestCase):\n def test_d(self):\n self.assertEqual(block_depth([\"a\", \" b\", \" c\"]), [0, 1, 2])\n"}}, "topic": "compiler_development"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-indent-blocks-fbfc145d12a1", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 4.65}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "indent_blocks", "topic": "compiler_development"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `block_depth(lines)` using leading 2-space indents. Return a list\nof depths per non-empty line. Raise ValueError if indent is not a multiple of 2.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def block_depth(lines):\n out = []\n for line in lines:\n if not line.strip():\n continue\n spaces = len(line) - len(line.lstrip(\" \"))\n if spaces % 2:\n raise ValueError(\"indent\")\n out.append(spaces // 2)\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_d (test_solution.Test.test_d) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n == 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n == 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out\n", "test_solution.py": "import unittest\nfrom solution import fresh_names\n\nclass Test(unittest.TestCase):\n def test_ren(self):\n self.assertEqual(fresh_names([\"x\", \"y\", \"x\"]), [\"x\", \"y\", \"x#1\"])\n"}}, "topic": "compiler_development"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-ssa-rename-f92239238afb", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.925, "tests": 0.0, "total": 4.300000000000001}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "ssa_rename", "topic": "compiler_development"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `fresh_names(vars)` assigning x, x#1, x#2, ... in order of first\nappearance counts: given a list of variable uses, return a list of renamed\noccurrences where the k-th use of name `v` becomes `v` then `v#1` etc.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n == 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ren (test_solution.Test.test_ren) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n == 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_ren (test_solution.Test.test_ren) ... FAIL\n\n======================================================================\nFAIL: test_ren (test_solution.Test.test_ren)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-wlxnxm_n\\test_solution.py\", line 6, in test_ren\n self.assertEqual(fresh_names([\"x\", \"y\", \"x\"]), [\"x\", \"y\", \"x#1\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['x#0', 'y#0', 'x'] != ['x', 'y', 'x#1']\n\nFirst differing element 0:\n'x#0'\n'x'\n\n- ['x#0', 'y#0', 'x']\n? -- --\n\n+ ['x', 'y', 'x#1']\n? ++\n\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n != 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out\n", "test_solution.py": "import unittest\nfrom solution import fresh_names\n\nclass Test(unittest.TestCase):\n def test_ren(self):\n self.assertEqual(fresh_names([\"x\", \"y\", \"x\"]), [\"x\", \"y\", \"x#1\"])\n"}}, "topic": "compiler_development"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-ssa-rename-d925f21a72dc", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.7}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_ren (test_solution.Test.test_ren) ... FAIL\n\n======================================================================\nFAIL: test_ren (test_solution.Test.test_ren)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-wlxnxm_n\\test_solution.py\", line 6, in test_ren\n self.assertEqual(fresh_names([\"x\", \"y\", \"x\"]), [\"x\", \"y\", \"x#1\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['x#0', 'y#0', 'x'] != ['x', 'y', 'x#1']\n\nFirst differing element 0:\n'x#0'\n'x'\n\n- ['x#0', 'y#0', 'x']\n? -- --\n\n+ ['x', 'y', 'x#1']\n? ++\n\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "ssa_rename", "tests_passed_after_fix": 1, "topic": "compiler_development"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `fresh_names(vars)` assigning x, x#1, x#2, ... in order of first\nappearance counts: given a list of variable uses, return a list of renamed\noccurrences where the k-th use of name `v` becomes `v` then `v#1` etc.\n\n--- solution.py (buggy) ---\ndef fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n != 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out\n\n--- test_solution.py ---\nimport unittest\nfrom solution import fresh_names\n\nclass Test(unittest.TestCase):\n def test_ren(self):\n self.assertEqual(fresh_names([\"x\", \"y\", \"x\"]), [\"x\", \"y\", \"x#1\"])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_ren (test_solution.Test.test_ren) ... FAIL\n\n======================================================================\nFAIL: test_ren (test_solution.Test.test_ren)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-wlxnxm_n\\test_solution.py\", line 6, in test_ren\n self.assertEqual(fresh_names([\"x\", \"y\", \"x\"]), [\"x\", \"y\", \"x#1\"])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: ['x#0', 'y#0', 'x'] != ['x', 'y', 'x#1']\n\nFirst differing element 0:\n'x#0'\n'x'\n\n- ['x#0', 'y#0', 'x']\n? -- --\n\n+ ['x', 'y', 'x#1']\n? ++\n\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def fresh_names(vars):\n seen = {}\n out = []\n for name in vars:\n n = seen.get(name, 0)\n out.append(name if n == 0 else f\"{name}#{n}\")\n seen[name] = n + 1\n return out", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_ren (test_solution.Test.test_ren) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "import re\n\ndef format_pin(name, version):\n if not re.fullmatch(r\"[a-z0-9][a-z0-9._-]*\", name):\n raise ValueError(\"name\")\n if not re.fullmatch(r\"[0-9]+(\\.[0-9]+)*\", version):\n raise ValueError(\"version\")\n return f\"{name}=={version}\"", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\n\ndef format_pin(name, version):\n if not re.fullmatch(r\"[a-z0-9][a-z0-9._-]*\", name):\n raise ValueError(\"name\")\n if not re.fullmatch(r\"[0-9]+(\\.[0-9]+)*\", version):\n raise ValueError(\"version\")\n return f\"{name}=={version}\"\n", "test_solution.py": "import unittest\nfrom solution import format_pin\n\nclass Test(unittest.TestCase):\n def test_pin(self):\n self.assertEqual(format_pin(\"foo.bar\", \"1.2.3\"), \"foo.bar==1.2.3\")\n with self.assertRaises(ValueError):\n format_pin(\"Foo\", \"1\")\n"}}, "topic": "package_management"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-lockfile-pin-515b47124038", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.3, "tests": 0.0, "total": 6.35}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "lockfile_pin", "topic": "package_management"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `format_pin(name, version)` as `name==version` after validating\nname `[a-z0-9][a-z0-9._-]*` and version `[0-9]+(\\.[0-9]+)*`.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\n\ndef format_pin(name, version):\n if not re.fullmatch(r\"[a-z0-9][a-z0-9._-]*\", name):\n raise ValueError(\"name\")\n if not re.fullmatch(r\"[0-9]+(\\.[0-9]+)*\", version):\n raise ValueError(\"version\")\n return f\"{name}=={version}\"", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_pin (test_solution.Test.test_pin) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return True\n i += 1\n return False", "assumptions": [], "concept_id": "python.loops", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return True\n i += 1\n return False\n", "test_solution.py": "import unittest\nfrom solution import tabs_in_indent\n\nclass Test(unittest.TestCase):\n def test_tab(self):\n self.assertTrue(tabs_in_indent(\"a\\n\\tb\\n\"))\n self.assertFalse(tabs_in_indent(\"a\\n b\\n\"))\n"}}, "topic": "configuration"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-yaml-indent-check-53ba00fe9a91", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.625}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "yaml_indent_check", "topic": "configuration"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `tabs_in_indent(text)` returning True if any line uses a tab in\nits leading whitespace.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return True\n i += 1\n return False", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_tab (test_solution.Test.test_tab) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return True\n i += 1\n return False", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_tab (test_solution.Test.test_tab) ... FAIL\n\n======================================================================\nFAIL: test_tab (test_solution.Test.test_tab)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-bl0l6b2x\\test_solution.py\", line 6, in test_tab\n self.assertTrue(tabs_in_indent(\"a\\n\\tb\\n\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return False\n i += 1\n return False\n", "test_solution.py": "import unittest\nfrom solution import tabs_in_indent\n\nclass Test(unittest.TestCase):\n def test_tab(self):\n self.assertTrue(tabs_in_indent(\"a\\n\\tb\\n\"))\n self.assertFalse(tabs_in_indent(\"a\\n b\\n\"))\n"}}, "topic": "configuration"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-yaml-indent-check-54a58f5c0e6c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.2, "tests": 0.0, "total": 9.925}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_tab (test_solution.Test.test_tab) ... FAIL\n\n======================================================================\nFAIL: test_tab (test_solution.Test.test_tab)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-bl0l6b2x\\test_solution.py\", line 6, in test_tab\n self.assertTrue(tabs_in_indent(\"a\\n\\tb\\n\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "yaml_indent_check", "tests_passed_after_fix": 1, "topic": "configuration"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `tabs_in_indent(text)` returning True if any line uses a tab in\nits leading whitespace.\n\n--- solution.py (buggy) ---\ndef tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return False\n i += 1\n return False\n\n--- test_solution.py ---\nimport unittest\nfrom solution import tabs_in_indent\n\nclass Test(unittest.TestCase):\n def test_tab(self):\n self.assertTrue(tabs_in_indent(\"a\\n\\tb\\n\"))\n self.assertFalse(tabs_in_indent(\"a\\n b\\n\"))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_tab (test_solution.Test.test_tab) ... FAIL\n\n======================================================================\nFAIL: test_tab (test_solution.Test.test_tab)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-bl0l6b2x\\test_solution.py\", line 6, in test_tab\n self.assertTrue(tabs_in_indent(\"a\\n\\tb\\n\"))\n ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: False is not true\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def tabs_in_indent(text):\n for line in text.splitlines():\n i = 0\n while i < len(line) and line[i] in \" \\t\":\n if line[i] == \"\\t\":\n return True\n i += 1\n return False", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_tab (test_solution.Test.test_tab) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def overall_health(checks):\n if not checks:\n return \"unknown\"\n return \"fail\" if any(c == \"fail\" for c in checks) else \"ok\"", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def overall_health(checks):\n if not checks:\n return \"unknown\"\n return \"fail\" if any(c == \"fail\" for c in checks) else \"ok\"\n", "test_solution.py": "import unittest\nfrom solution import overall_health\n\nclass Test(unittest.TestCase):\n def test_h(self):\n self.assertEqual(overall_health([\"ok\", \"fail\"]), \"fail\")\n self.assertEqual(overall_health([]), \"unknown\")\n"}}, "topic": "devops"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-health-aggregate-64a07e8dba79", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.325, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.525, "tests": 0.0, "total": 3.45}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "health_aggregate", "topic": "devops"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `overall_health(checks)` where each check is `ok` or `fail`.\nReturn `fail` if any fail, `ok` if all ok, `unknown` if empty.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def overall_health(checks):\n if not checks:\n return \"unknown\"\n return \"fail\" if any(c == \"fail\" for c in checks) else \"ok\"", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_h (test_solution.Test.test_h) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) == n:\n yield buf\n buf = []\n if buf:\n yield buf", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) == n:\n yield buf\n buf = []\n if buf:\n yield buf\n", "test_solution.py": "import unittest\nfrom solution import chunks\n\nclass Test(unittest.TestCase):\n def test_c(self):\n self.assertEqual(list(chunks([1, 2, 3, 4, 5], 2)), [[1, 2], [3, 4], [5]])\n"}}, "topic": "cli_development"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-chunked-read-195ed981691f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 3.5}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "chunked_read", "topic": "cli_development"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `chunks(seq, n)` yielding successive lists of length n, last\npossibly shorter. n must be >= 1.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) == n:\n yield buf\n buf = []\n if buf:\n yield buf", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_c (test_solution.Test.test_c) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) == n:\n yield buf\n buf = []\n if buf:\n yield buf", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_c (test_solution.Test.test_c) ... FAIL\n\n======================================================================\nFAIL: test_c (test_solution.Test.test_c)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-aqu97_k1\\test_solution.py\", line 6, in test_c\n self.assertEqual(list(chunks([1, 2, 3, 4, 5], 2)), [[1, 2], [3, 4], [5]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [[1], [2], [3], [4], [5]] != [[1, 2], [3, 4], [5]]\n\nFirst differing element 0:\n[1]\n[1, 2]\n\nFirst list contains 2 additional elements.\nFirst extra element 3:\n[4]\n\n- [[1], [2], [3], [4], [5]]\n? - - - -\n\n+ [[1, 2], [3, 4], [5]]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) != n:\n yield buf\n buf = []\n if buf:\n yield buf\n", "test_solution.py": "import unittest\nfrom solution import chunks\n\nclass Test(unittest.TestCase):\n def test_c(self):\n self.assertEqual(list(chunks([1, 2, 3, 4, 5], 2)), [[1, 2], [3, 4], [5]])\n"}}, "topic": "cli_development"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-chunked-read-79f2b2a4f399", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.774999999999999}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_c (test_solution.Test.test_c) ... FAIL\n\n======================================================================\nFAIL: test_c (test_solution.Test.test_c)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-aqu97_k1\\test_solution.py\", line 6, in test_c\n self.assertEqual(list(chunks([1, 2, 3, 4, 5], 2)), [[1, 2], [3, 4], [5]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [[1], [2], [3], [4], [5]] != [[1, 2], [3, 4], [5]]\n\nFirst differing element 0:\n[1]\n[1, 2]\n\nFirst list contains 2 additional elements.\nFirst extra element 3:\n[4]\n\n- [[1], [2], [3], [4], [5]]\n? - - - -\n\n+ [[1, 2], [3, 4], [5]]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "chunked_read", "tests_passed_after_fix": 1, "topic": "cli_development"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `chunks(seq, n)` yielding successive lists of length n, last\npossibly shorter. n must be >= 1.\n\n--- solution.py (buggy) ---\ndef chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) != n:\n yield buf\n buf = []\n if buf:\n yield buf\n\n--- test_solution.py ---\nimport unittest\nfrom solution import chunks\n\nclass Test(unittest.TestCase):\n def test_c(self):\n self.assertEqual(list(chunks([1, 2, 3, 4, 5], 2)), [[1, 2], [3, 4], [5]])\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_c (test_solution.Test.test_c) ... FAIL\n\n======================================================================\nFAIL: test_c (test_solution.Test.test_c)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-aqu97_k1\\test_solution.py\", line 6, in test_c\n self.assertEqual(list(chunks([1, 2, 3, 4, 5], 2)), [[1, 2], [3, 4], [5]])\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Lists differ: [[1], [2], [3], [4], [5]] != [[1, 2], [3, 4], [5]]\n\nFirst differing element 0:\n[1]\n[1, 2]\n\nFirst list contains 2 additional elements.\nFirst extra element 3:\n[4]\n\n- [[1], [2], [3], [4], [5]]\n? - - - -\n\n+ [[1, 2], [3, 4], [5]]\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def chunks(seq, n):\n if n < 1:\n raise ValueError(\"n\")\n buf = []\n for item in seq:\n buf.append(item)\n if len(buf) == n:\n yield buf\n buf = []\n if buf:\n yield buf", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_c (test_solution.Test.test_c) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def simplify(node):\n if node[0] == \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def simplify(node):\n if node[0] == \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)\n", "test_solution.py": "import unittest\nfrom solution import simplify\n\nclass Test(unittest.TestCase):\n def test_s(self):\n self.assertEqual(simplify((\"neg\", (\"neg\", (\"num\", 3)))), (\"num\", 3))\n"}}, "topic": "language_design"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-expr-simplify-double-neg-7d6a4d714970", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.325}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "expr_simplify_double_neg", "topic": "language_design"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "AST nodes are tuples: ('neg', node) or ('num', int). Implement `simplify(node)`\ncancelling double negation.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def simplify(node):\n if node[0] == \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_s (test_solution.Test.test_s) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def simplify(node):\n if node[0] == \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_s (test_solution.Test.test_s) ... FAIL\n\n======================================================================\nFAIL: test_s (test_solution.Test.test_s)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-bvukoenz\\test_solution.py\", line 6, in test_s\n self.assertEqual(simplify((\"neg\", (\"neg\", (\"num\", 3)))), (\"num\", 3))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Tuples differ: ('neg', ('neg', ('num', 3))) != ('num', 3)\n\nFirst differing element 0:\n'neg'\n'num'\n\n- ('neg', ('neg', ('num', 3)))\n+ ('num', 3)\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def simplify(node):\n if node[0] != \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)\n", "test_solution.py": "import unittest\nfrom solution import simplify\n\nclass Test(unittest.TestCase):\n def test_s(self):\n self.assertEqual(simplify((\"neg\", (\"neg\", (\"num\", 3)))), (\"num\", 3))\n"}}, "topic": "language_design"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-expr-simplify-double-neg-e89118be551d", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 3.65, "tests": 0.0, "total": 10.325}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_s (test_solution.Test.test_s) ... FAIL\n\n======================================================================\nFAIL: test_s (test_solution.Test.test_s)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-bvukoenz\\test_solution.py\", line 6, in test_s\n self.assertEqual(simplify((\"neg\", (\"neg\", (\"num\", 3)))), (\"num\", 3))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Tuples differ: ('neg', ('neg', ('num', 3))) != ('num', 3)\n\nFirst differing element 0:\n'neg'\n'num'\n\n- ('neg', ('neg', ('num', 3)))\n+ ('num', 3)\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "expr_simplify_double_neg", "tests_passed_after_fix": 1, "topic": "language_design"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nAST nodes are tuples: ('neg', node) or ('num', int). Implement `simplify(node)`\ncancelling double negation.\n\n--- solution.py (buggy) ---\ndef simplify(node):\n if node[0] != \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import simplify\n\nclass Test(unittest.TestCase):\n def test_s(self):\n self.assertEqual(simplify((\"neg\", (\"neg\", (\"num\", 3)))), (\"num\", 3))\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_s (test_solution.Test.test_s) ... FAIL\n\n======================================================================\nFAIL: test_s (test_solution.Test.test_s)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-bvukoenz\\test_solution.py\", line 6, in test_s\n self.assertEqual(simplify((\"neg\", (\"neg\", (\"num\", 3)))), (\"num\", 3))\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: Tuples differ: ('neg', ('neg', ('num', 3))) != ('num', 3)\n\nFirst differing element 0:\n'neg'\n'num'\n\n- ('neg', ('neg', ('num', 3)))\n+ ('num', 3)\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def simplify(node):\n if node[0] == \"num\":\n return node\n inner = simplify(node[1])\n if inner[0] == \"neg\":\n return inner[1]\n return (\"neg\", inner)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_s (test_solution.Test.test_s) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "CHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo == hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "CHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo == hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)\n", "test_solution.py": "import unittest\nfrom solution import spark\n\nclass Test(unittest.TestCase):\n def test_sp(self):\n self.assertEqual(len(spark([0, 5, 10])), 3)\n self.assertEqual(spark([3, 3, 3]), \"@@@\")\n"}}, "topic": "documentation"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-histogram-ascii-619c33b5a4e4", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.6, "tests": 0.0, "total": 6.75}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "histogram_ascii", "topic": "documentation"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `spark(nums)` mapping each value to a bar character from\n` .:-=+*#%@` by min-max scaling. Constant arrays become all last char. Return a string.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "CHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo == hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_sp (test_solution.Test.test_sp) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "CHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo == hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_sp (test_solution.Test.test_sp) ... ERROR\n\n======================================================================\nERROR: test_sp (test_solution.Test.test_sp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-93wn67cd\\test_solution.py\", line 7, in test_sp\n self.assertEqual(spark([3, 3, 3]), \"@@@\")\n ~~~~~^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-93wn67cd\\solution.py\", line 11, in spark\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n ~~~~~~~~~^~~~~~~~~~~\nZeroDivisionError: division by zero\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "CHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo != hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)\n", "test_solution.py": "import unittest\nfrom solution import spark\n\nclass Test(unittest.TestCase):\n def test_sp(self):\n self.assertEqual(len(spark([0, 5, 10])), 3)\n self.assertEqual(spark([3, 3, 3]), \"@@@\")\n"}}, "topic": "documentation"}, "difficulty": "advanced", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-histogram-ascii-449a648454cc", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 10.85}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 1, "failures": 0, "passed": false, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_sp (test_solution.Test.test_sp) ... ERROR\n\n======================================================================\nERROR: test_sp (test_solution.Test.test_sp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-93wn67cd\\test_solution.py\", line 7, in test_sp\n self.assertEqual(spark([3, 3, 3]), \"@@@\")\n ~~~~~^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-93wn67cd\\solution.py\", line 11, in spark\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n ~~~~~~~~~^~~~~~~~~~~\nZeroDivisionError: division by zero\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 0}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "histogram_ascii", "tests_passed_after_fix": 1, "topic": "documentation"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `spark(nums)` mapping each value to a bar character from\n` .:-=+*#%@` by min-max scaling. Constant arrays become all last char. Return a string.\n\n--- solution.py (buggy) ---\nCHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo != hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)\n\n--- test_solution.py ---\nimport unittest\nfrom solution import spark\n\nclass Test(unittest.TestCase):\n def test_sp(self):\n self.assertEqual(len(spark([0, 5, 10])), 3)\n self.assertEqual(spark([3, 3, 3]), \"@@@\")\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 1, \"skipped\": 0, \"passed\": false}\n\ntest_sp (test_solution.Test.test_sp) ... ERROR\n\n======================================================================\nERROR: test_sp (test_solution.Test.test_sp)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-93wn67cd\\test_solution.py\", line 7, in test_sp\n self.assertEqual(spark([3, 3, 3]), \"@@@\")\n ~~~~~^^^^^^^^^^^\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-93wn67cd\\solution.py\", line 11, in spark\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n ~~~~~~~~~^~~~~~~~~~~\nZeroDivisionError: division by zero\n\n----------------------------------------------------------------------\nRan 1 test in 0.001s\n\nFAILED (errors=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "CHARS = \" .:-=+*#%@\"\n\ndef spark(nums):\n if not nums:\n return \"\"\n lo, hi = min(nums), max(nums)\n if lo == hi:\n return CHARS[-1] * len(nums)\n out = []\n for x in nums:\n idx = int((x - lo) / (hi - lo) * (len(CHARS) - 1))\n out.append(CHARS[idx])\n return \"\".join(out)", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 1}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_sp (test_solution.Test.test_sp) ... ok\n\n----------------------------------------------------------------------\nRan 1 test in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 1, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 1}} {"answer": "def tripleneg(n):\n return n*3 if n<0 else n+3", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def tripleneg(n):\n return n*3 if n<0 else n+3\n", "test_solution.py": "import unittest\nfrom solution import tripleneg\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(tripleneg(-4), -12)\n def test_1(self):\n self.assertEqual(tripleneg(-3), -9)\n def test_2(self):\n self.assertEqual(tripleneg(-2), -6)\n def test_3(self):\n self.assertEqual(tripleneg(-1), -3)\n def test_4(self):\n self.assertEqual(tripleneg(0), 3)\n def test_5(self):\n self.assertEqual(tripleneg(1), 4)\n def test_6(self):\n self.assertEqual(tripleneg(2), 5)\n def test_7(self):\n self.assertEqual(tripleneg(3), 6)\n def test_8(self):\n self.assertEqual(tripleneg(4), 7)\n def test_9(self):\n self.assertEqual(tripleneg(5), 8)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-tripleneg-f55c23215c56", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.675, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 4.375}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_tripleneg", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `tripleneg`: Return n*3 if n<0 else n+3. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def tripleneg(n):\n return n*3 if n<0 else n+3", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 10}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 10 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 10, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 10}} {"answer": "def clamp8(n):\n return 0 if n<0 else 8 if n>8 else n", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def clamp8(n):\n return 0 if n<0 else 8 if n>8 else n\n", "test_solution.py": "import unittest\nfrom solution import clamp8\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(clamp8(-2), 0)\n def test_1(self):\n self.assertEqual(clamp8(-1), 0)\n def test_2(self):\n self.assertEqual(clamp8(0), 0)\n def test_3(self):\n self.assertEqual(clamp8(1), 1)\n def test_4(self):\n self.assertEqual(clamp8(2), 2)\n def test_5(self):\n self.assertEqual(clamp8(3), 3)\n def test_6(self):\n self.assertEqual(clamp8(4), 4)\n def test_7(self):\n self.assertEqual(clamp8(5), 5)\n def test_8(self):\n self.assertEqual(clamp8(6), 6)\n def test_9(self):\n self.assertEqual(clamp8(7), 7)\n def test_10(self):\n self.assertEqual(clamp8(8), 8)\n def test_11(self):\n self.assertEqual(clamp8(9), 8)\n def test_12(self):\n self.assertEqual(clamp8(10), 8)\n def test_13(self):\n self.assertEqual(clamp8(11), 8)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-clamp8-45c5ed2a001b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.875, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.325, "tests": 0.0, "total": 3.8000000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_clamp8", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `clamp8`: Clamp n into [0, 8]. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def clamp8(n):\n return 0 if n<0 else 8 if n>8 else n", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 14}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 14 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 14, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 14}} {"answer": "def ones_mod(n):\n return n % 9", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def ones_mod(n):\n return n % 9\n", "test_solution.py": "import unittest\nfrom solution import ones_mod\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(ones_mod(0), 0)\n def test_1(self):\n self.assertEqual(ones_mod(1), 1)\n def test_2(self):\n self.assertEqual(ones_mod(2), 2)\n def test_3(self):\n self.assertEqual(ones_mod(3), 3)\n def test_4(self):\n self.assertEqual(ones_mod(4), 4)\n def test_5(self):\n self.assertEqual(ones_mod(5), 5)\n def test_6(self):\n self.assertEqual(ones_mod(6), 6)\n def test_7(self):\n self.assertEqual(ones_mod(7), 7)\n def test_8(self):\n self.assertEqual(ones_mod(8), 8)\n def test_9(self):\n self.assertEqual(ones_mod(9), 0)\n def test_10(self):\n self.assertEqual(ones_mod(10), 1)\n def test_11(self):\n self.assertEqual(ones_mod(11), 2)\n def test_12(self):\n self.assertEqual(ones_mod(12), 3)\n def test_13(self):\n self.assertEqual(ones_mod(13), 4)\n def test_14(self):\n self.assertEqual(ones_mod(14), 5)\n def test_15(self):\n self.assertEqual(ones_mod(15), 6)\n def test_16(self):\n self.assertEqual(ones_mod(16), 7)\n def test_17(self):\n self.assertEqual(ones_mod(17), 8)\n def test_18(self):\n self.assertEqual(ones_mod(18), 0)\n def test_19(self):\n self.assertEqual(ones_mod(19), 1)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-ones-mod-a3bd8b598f6a", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 1.175, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 4.375}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_ones_mod", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `ones_mod`: Return n % 9, with 0 mapping to 0 (digital-root step). Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def ones_mod(n):\n return n % 9", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 20}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_19 (test_solution.Test.test_19) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 20 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 20, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 20}} {"answer": "def is_sq(n):\n if n<0:\n return False\n r=int(n**0.5)\n return r*r==n", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def is_sq(n):\n if n<0:\n return False\n r=int(n**0.5)\n return r*r==n\n", "test_solution.py": "import unittest\nfrom solution import is_sq\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(is_sq(-1), False)\n def test_1(self):\n self.assertEqual(is_sq(0), True)\n def test_2(self):\n self.assertEqual(is_sq(1), True)\n def test_3(self):\n self.assertEqual(is_sq(2), False)\n def test_4(self):\n self.assertEqual(is_sq(3), False)\n def test_5(self):\n self.assertEqual(is_sq(4), True)\n def test_6(self):\n self.assertEqual(is_sq(5), False)\n def test_7(self):\n self.assertEqual(is_sq(6), False)\n def test_8(self):\n self.assertEqual(is_sq(7), False)\n def test_9(self):\n self.assertEqual(is_sq(8), False)\n def test_10(self):\n self.assertEqual(is_sq(9), True)\n def test_11(self):\n self.assertEqual(is_sq(10), False)\n def test_12(self):\n self.assertEqual(is_sq(11), False)\n def test_13(self):\n self.assertEqual(is_sq(12), False)\n def test_14(self):\n self.assertEqual(is_sq(13), False)\n def test_15(self):\n self.assertEqual(is_sq(14), False)\n def test_16(self):\n self.assertEqual(is_sq(15), False)\n def test_17(self):\n self.assertEqual(is_sq(16), True)\n def test_18(self):\n self.assertEqual(is_sq(17), False)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-is-sq-a8367c9627a4", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 1.2, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 4.975}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_is_sq", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `is_sq`: Return True iff n is a perfect square (n>=0). Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def is_sq(n):\n if n<0:\n return False\n r=int(n**0.5)\n return r*r==n", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 19}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 19 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 19, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 19}} {"answer": "def is_sq(n):\n if n<0:\n return False\n r=int(n**0.5)\n return r*r==n", "assumptions": [], "concept_id": "python.testing", "constraints": ["Do not weaken or delete tests", "Keep the public API"], "context": {"failure": {"command": "python harness.py", "output": "OPEN_REASON_RESULT {\"tests_run\": 19, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_0 (test_solution.Test.test_0) ... FAIL\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n======================================================================\nFAIL: test_0 (test_solution.Test.test_0)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-9g1syvlh\\test_solution.py\", line 5, in test_0\n self.assertEqual(is_sq(-1), False)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\nAssertionError: True != False\n\n----------------------------------------------------------------------\nRan 19 tests in 0.001s\n\nFAILED (failures=1)\n"}, "language": "python", "repository": {"files": {"solution.py": "def is_sq(n):\n if n<0:\n return True\n r=int(n**0.5)\n return r*r==n\n", "test_solution.py": "import unittest\nfrom solution import is_sq\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(is_sq(-1), False)\n def test_1(self):\n self.assertEqual(is_sq(0), True)\n def test_2(self):\n self.assertEqual(is_sq(1), True)\n def test_3(self):\n self.assertEqual(is_sq(2), False)\n def test_4(self):\n self.assertEqual(is_sq(3), False)\n def test_5(self):\n self.assertEqual(is_sq(4), True)\n def test_6(self):\n self.assertEqual(is_sq(5), False)\n def test_7(self):\n self.assertEqual(is_sq(6), False)\n def test_8(self):\n self.assertEqual(is_sq(7), False)\n def test_9(self):\n self.assertEqual(is_sq(8), False)\n def test_10(self):\n self.assertEqual(is_sq(9), True)\n def test_11(self):\n self.assertEqual(is_sq(10), False)\n def test_12(self):\n self.assertEqual(is_sq(11), False)\n def test_13(self):\n self.assertEqual(is_sq(12), False)\n def test_14(self):\n self.assertEqual(is_sq(13), False)\n def test_15(self):\n self.assertEqual(is_sq(14), False)\n def test_16(self):\n self.assertEqual(is_sq(15), False)\n def test_17(self):\n self.assertEqual(is_sq(16), True)\n def test_18(self):\n self.assertEqual(is_sq(17), False)\n"}}, "topic": "algorithms"}, "difficulty": "expert", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-debug-micro-is-sq-c112a60ddd9b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 1.2, "constraints": 1.4, "keywords": 0.0, "math_ops": 3.0, "observations": 0.3, "plan": 1.6, "prompt_length": 4.0, "tests": 0.0, "total": 11.5}, "failure_verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 1, "passed": false, "skipped": 0, "tests_run": 19}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": false, "result": "failed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... FAIL\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n======================================================================\nFAIL: test_0 (test_solution.Test.test_0)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-9g1syvlh\\test_solution.py\", line 5, in test_0\n self.assertEqual(is_sq(-1), False)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\nAssertionError: True != False\n\n----------------------------------------------------------------------\nRan 19 tests in 0.001s\n\nFAILED (failures=1)\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 19, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n", "tests_failed": 1, "tests_passed": 18}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_is_sq", "tests_passed_after_fix": 19, "topic": "algorithms"}, "natural_language": "en", "observations": ["Seeded mutation of the reference implementation."], "plan": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "prompt": "The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.\n\nImplement `is_sq`: Return True iff n is a perfect square (n>=0). Use only the Python standard library.\n\n--- solution.py (buggy) ---\ndef is_sq(n):\n if n<0:\n return True\n r=int(n**0.5)\n return r*r==n\n\n--- test_solution.py ---\nimport unittest\nfrom solution import is_sq\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(is_sq(-1), False)\n def test_1(self):\n self.assertEqual(is_sq(0), True)\n def test_2(self):\n self.assertEqual(is_sq(1), True)\n def test_3(self):\n self.assertEqual(is_sq(2), False)\n def test_4(self):\n self.assertEqual(is_sq(3), False)\n def test_5(self):\n self.assertEqual(is_sq(4), True)\n def test_6(self):\n self.assertEqual(is_sq(5), False)\n def test_7(self):\n self.assertEqual(is_sq(6), False)\n def test_8(self):\n self.assertEqual(is_sq(7), False)\n def test_9(self):\n self.assertEqual(is_sq(8), False)\n def test_10(self):\n self.assertEqual(is_sq(9), True)\n def test_11(self):\n self.assertEqual(is_sq(10), False)\n def test_12(self):\n self.assertEqual(is_sq(11), False)\n def test_13(self):\n self.assertEqual(is_sq(12), False)\n def test_14(self):\n self.assertEqual(is_sq(13), False)\n def test_15(self):\n self.assertEqual(is_sq(14), False)\n def test_16(self):\n self.assertEqual(is_sq(15), False)\n def test_17(self):\n self.assertEqual(is_sq(16), True)\n def test_18(self):\n self.assertEqual(is_sq(17), False)\n\n--- failure ---\nOPEN_REASON_RESULT {\"tests_run\": 19, \"failures\": 1, \"errors\": 0, \"skipped\": 0, \"passed\": false}\n\ntest_0 (test_solution.Test.test_0) ... FAIL\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n======================================================================\nFAIL: test_0 (test_solution.Test.test_0)\n----------------------------------------------------------------------\nTraceback (most recent call last):\n File \"C:\\Users\\matth\\AppData\\Local\\Temp\\open-reason-sandbox-9g1syvlh\\test_solution.py\", line 5, in test_0\n self.assertEqual(is_sq(-1), False)\n ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\nAssertionError: True != False\n\n----------------------------------------------------------------------\nRan 19 tests in 0.001s\n\nFAILED (failures=1)", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def is_sq(n):\n if n<0:\n return False\n r=int(n**0.5)\n return r*r==n", "strategy": ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"], "task_type": "debugging", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 19}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 19 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 19, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 19}} {"answer": "def next_even(n):\n return n if n%2==0 else n+1", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def next_even(n):\n return n if n%2==0 else n+1\n", "test_solution.py": "import unittest\nfrom solution import next_even\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(next_even(-3), -2)\n def test_1(self):\n self.assertEqual(next_even(-2), -2)\n def test_2(self):\n self.assertEqual(next_even(-1), 0)\n def test_3(self):\n self.assertEqual(next_even(0), 0)\n def test_4(self):\n self.assertEqual(next_even(1), 2)\n def test_5(self):\n self.assertEqual(next_even(2), 2)\n def test_6(self):\n self.assertEqual(next_even(3), 4)\n def test_7(self):\n self.assertEqual(next_even(4), 4)\n def test_8(self):\n self.assertEqual(next_even(5), 6)\n def test_9(self):\n self.assertEqual(next_even(6), 6)\n def test_10(self):\n self.assertEqual(next_even(7), 8)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-next-even-20a6a715b190", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.725, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.325, "tests": 0.0, "total": 3.9000000000000004}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_next_even", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `next_even`: Smallest even integer >= n. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def next_even(n):\n return n if n%2==0 else n+1", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 11}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 11 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 11, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 11}} {"answer": "def collatz_step(n):\n return n//2 if n%2==0 else 3*n+1", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def collatz_step(n):\n return n//2 if n%2==0 else 3*n+1\n", "test_solution.py": "import unittest\nfrom solution import collatz_step\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(collatz_step(1), 4)\n def test_1(self):\n self.assertEqual(collatz_step(2), 1)\n def test_2(self):\n self.assertEqual(collatz_step(3), 10)\n def test_3(self):\n self.assertEqual(collatz_step(4), 2)\n def test_4(self):\n self.assertEqual(collatz_step(5), 16)\n def test_5(self):\n self.assertEqual(collatz_step(6), 3)\n def test_6(self):\n self.assertEqual(collatz_step(7), 22)\n def test_7(self):\n self.assertEqual(collatz_step(8), 4)\n def test_8(self):\n self.assertEqual(collatz_step(9), 28)\n def test_9(self):\n self.assertEqual(collatz_step(10), 5)\n def test_10(self):\n self.assertEqual(collatz_step(11), 34)\n def test_11(self):\n self.assertEqual(collatz_step(12), 6)\n def test_12(self):\n self.assertEqual(collatz_step(13), 40)\n def test_13(self):\n self.assertEqual(collatz_step(14), 7)\n def test_14(self):\n self.assertEqual(collatz_step(15), 46)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-collatz-step-8ab9e140b6af", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.925, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.25, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 5.25}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_collatz_step", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `collatz_step`: One Collatz step: n/2 if even else 3n+1, for positive n. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def collatz_step(n):\n return n//2 if n%2==0 else 3*n+1", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 15}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 15 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 15, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 15}} {"answer": "def popcount(n):\n return bin(abs(n)).count('1')", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def popcount(n):\n return bin(abs(n)).count('1')\n", "test_solution.py": "import unittest\nfrom solution import popcount\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(popcount(-8), 1)\n def test_1(self):\n self.assertEqual(popcount(-7), 3)\n def test_2(self):\n self.assertEqual(popcount(-6), 2)\n def test_3(self):\n self.assertEqual(popcount(-5), 2)\n def test_4(self):\n self.assertEqual(popcount(-4), 1)\n def test_5(self):\n self.assertEqual(popcount(-3), 2)\n def test_6(self):\n self.assertEqual(popcount(-2), 1)\n def test_7(self):\n self.assertEqual(popcount(-1), 1)\n def test_8(self):\n self.assertEqual(popcount(0), 0)\n def test_9(self):\n self.assertEqual(popcount(1), 1)\n def test_10(self):\n self.assertEqual(popcount(2), 1)\n def test_11(self):\n self.assertEqual(popcount(3), 2)\n def test_12(self):\n self.assertEqual(popcount(4), 1)\n def test_13(self):\n self.assertEqual(popcount(5), 2)\n def test_14(self):\n self.assertEqual(popcount(6), 2)\n def test_15(self):\n self.assertEqual(popcount(7), 3)\n def test_16(self):\n self.assertEqual(popcount(8), 1)\n def test_17(self):\n self.assertEqual(popcount(9), 2)\n def test_18(self):\n self.assertEqual(popcount(10), 2)\n def test_19(self):\n self.assertEqual(popcount(11), 3)\n def test_20(self):\n self.assertEqual(popcount(12), 2)\n def test_21(self):\n self.assertEqual(popcount(13), 3)\n def test_22(self):\n self.assertEqual(popcount(14), 3)\n def test_23(self):\n self.assertEqual(popcount(15), 4)\n def test_24(self):\n self.assertEqual(popcount(16), 1)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-popcount-ff83f628f559", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 1.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.425, "tests": 0.0, "total": 4.575}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_popcount", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `popcount`: Number of 1-bits in the absolute value of n. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def popcount(n):\n return bin(abs(n)).count('1')", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 25}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_10 (test_solution.Test.test_10) ... ok\ntest_11 (test_solution.Test.test_11) ... ok\ntest_12 (test_solution.Test.test_12) ... ok\ntest_13 (test_solution.Test.test_13) ... ok\ntest_14 (test_solution.Test.test_14) ... ok\ntest_15 (test_solution.Test.test_15) ... ok\ntest_16 (test_solution.Test.test_16) ... ok\ntest_17 (test_solution.Test.test_17) ... ok\ntest_18 (test_solution.Test.test_18) ... ok\ntest_19 (test_solution.Test.test_19) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_20 (test_solution.Test.test_20) ... ok\ntest_21 (test_solution.Test.test_21) ... ok\ntest_22 (test_solution.Test.test_22) ... ok\ntest_23 (test_solution.Test.test_23) ... ok\ntest_24 (test_solution.Test.test_24) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\ntest_7 (test_solution.Test.test_7) ... ok\ntest_8 (test_solution.Test.test_8) ... ok\ntest_9 (test_solution.Test.test_9) ... ok\n\n----------------------------------------------------------------------\nRan 25 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 25, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 25}} {"answer": "def rev_digits(n):\n s=int(str(abs(n))[::-1])\n return -s if n<0 else s", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def rev_digits(n):\n s=int(str(abs(n))[::-1])\n return -s if n<0 else s\n", "test_solution.py": "import unittest\nfrom solution import rev_digits\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(rev_digits(-120), -21)\n def test_1(self):\n self.assertEqual(rev_digits(-10), -1)\n def test_2(self):\n self.assertEqual(rev_digits(0), 0)\n def test_3(self):\n self.assertEqual(rev_digits(7), 7)\n def test_4(self):\n self.assertEqual(rev_digits(100), 1)\n def test_5(self):\n self.assertEqual(rev_digits(1234), 4321)\n def test_6(self):\n self.assertEqual(rev_digits(900), 9)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-rev-digits-039714a11dae", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.1000000000000005}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_rev_digits", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `rev_digits`: Integer obtained by reversing decimal digits of |n|, keeping sign. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def rev_digits(n):\n s=int(str(abs(n))[::-1])\n return -s if n<0 else s", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 7}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\n\n----------------------------------------------------------------------\nRan 7 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 7, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 7}} {"answer": "def sum_digits(n):\n return sum(int(c) for c in str(abs(n)))", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def sum_digits(n):\n return sum(int(c) for c in str(abs(n)))\n", "test_solution.py": "import unittest\nfrom solution import sum_digits\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(sum_digits(0), 0)\n def test_1(self):\n self.assertEqual(sum_digits(10), 1)\n def test_2(self):\n self.assertEqual(sum_digits(99), 18)\n def test_3(self):\n self.assertEqual(sum_digits(123), 6)\n def test_4(self):\n self.assertEqual(sum_digits(1001), 2)\n def test_5(self):\n self.assertEqual(sum_digits(-58), 13)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-sum-digits-844fe7dd7d4b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.475, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.4250000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_sum_digits", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `sum_digits`: Sum of decimal digits of |n|. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def sum_digits(n):\n return sum(int(c) for c in str(abs(n)))", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 6}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\n\n----------------------------------------------------------------------\nRan 6 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 6, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 6}} {"answer": "def mid3(a,b,c):\n return sorted([a,b,c])[1]", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def mid3(a,b,c):\n return sorted([a,b,c])[1]\n", "test_solution.py": "import unittest\nfrom solution import mid3\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(mid3(1, 2, 3), 2)\n def test_1(self):\n self.assertEqual(mid3(9, 1, 5), 5)\n def test_2(self):\n self.assertEqual(mid3(0, 0, 1), 0)\n def test_3(self):\n self.assertEqual(mid3(-4, -1, -3), -3)\n def test_4(self):\n self.assertEqual(mid3(8, 8, 2), 8)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-mid3-64a78f8aad58", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.325, "tests": 0.0, "total": 3.35}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_mid3", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `mid3`: Median of three integers a,b,c. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def mid3(a,b,c):\n return sorted([a,b,c])[1]", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 5}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\n\n----------------------------------------------------------------------\nRan 5 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 5, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 5}} {"answer": "import math\ndef gcd3(a,b,c):\n return math.gcd(math.gcd(a,b),c)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import math\ndef gcd3(a,b,c):\n return math.gcd(math.gcd(a,b),c)\n", "test_solution.py": "import unittest\nfrom solution import gcd3\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(gcd3(12, 18, 30), 6)\n def test_1(self):\n self.assertEqual(gcd3(7, 9, 11), 1)\n def test_2(self):\n self.assertEqual(gcd3(0, 5, 10), 5)\n def test_3(self):\n self.assertEqual(gcd3(21, 14, 7), 7)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-gcd3-612aab1c5039", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.3, "tests": 0.0, "total": 3.3}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_gcd3", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `gcd3`: gcd of three integers. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import math\ndef gcd3(a,b,c):\n return math.gcd(math.gcd(a,b),c)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def powmod(a,b,m):\n return pow(a,b,m)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def powmod(a,b,m):\n return pow(a,b,m)\n", "test_solution.py": "import unittest\nfrom solution import powmod\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(powmod(2, 10, 1000), 24)\n def test_1(self):\n self.assertEqual(powmod(3, 5, 7), 5)\n def test_2(self):\n self.assertEqual(powmod(5, 0, 9), 1)\n def test_3(self):\n self.assertEqual(powmod(7, 3, 5), 3)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-powmod-4af1cf8e1eaf", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.375, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.325, "tests": 0.0, "total": 3.3000000000000003}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_powmod", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `powmod`: Compute pow(a,b,m) for m>0, b>=0. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def powmod(a,b,m):\n return pow(a,b,m)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def ceil_div(a,b):\n return -(-a//b)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def ceil_div(a,b):\n return -(-a//b)\n", "test_solution.py": "import unittest\nfrom solution import ceil_div\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(ceil_div(10, 3), 4)\n def test_1(self):\n self.assertEqual(ceil_div(9, 3), 3)\n def test_2(self):\n self.assertEqual(ceil_div(1, 5), 1)\n def test_3(self):\n self.assertEqual(ceil_div(-7, 3), -2)\n def test_4(self):\n self.assertEqual(ceil_div(0, 4), 0)\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-ceil-div-67918f67e89c", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 1.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 4.5}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_ceil_div", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `ceil_div`: Ceiling of a/b for positive b. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def ceil_div(a,b):\n return -(-a//b)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 5}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\n\n----------------------------------------------------------------------\nRan 5 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 5, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 5}} {"answer": "def bit_rev8(n):\n x=n & 255\n y=0\n for _ in range(8):\n y=(y<<1)|(x&1)\n x>>=1\n return y", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def bit_rev8(n):\n x=n & 255\n y=0\n for _ in range(8):\n y=(y<<1)|(x&1)\n x>>=1\n return y\n", "test_solution.py": "import unittest\nfrom solution import bit_rev8\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(bit_rev8(0), 0)\n def test_1(self):\n self.assertEqual(bit_rev8(1), 128)\n def test_2(self):\n self.assertEqual(bit_rev8(2), 64)\n def test_3(self):\n self.assertEqual(bit_rev8(16), 8)\n def test_4(self):\n self.assertEqual(bit_rev8(128), 1)\n def test_5(self):\n self.assertEqual(bit_rev8(170), 85)\n def test_6(self):\n self.assertEqual(bit_rev8(255), 255)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-bit-rev8-189524cf3190", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.65, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 3.7}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_bit_rev8", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `bit_rev8`: Reverse the low 8 bits of n (ignore higher bits). Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def bit_rev8(n):\n x=n & 255\n y=0\n for _ in range(8):\n y=(y<<1)|(x&1)\n x>>=1\n return y", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 7}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\n\n----------------------------------------------------------------------\nRan 7 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 7, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 7}} {"answer": "def sgn(n):\n return (n>0)-(n<0)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def sgn(n):\n return (n>0)-(n<0)\n", "test_solution.py": "import unittest\nfrom solution import sgn\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(sgn(-3), -1)\n def test_1(self):\n self.assertEqual(sgn(-2), -1)\n def test_2(self):\n self.assertEqual(sgn(-1), -1)\n def test_3(self):\n self.assertEqual(sgn(0), 0)\n def test_4(self):\n self.assertEqual(sgn(1), 1)\n def test_5(self):\n self.assertEqual(sgn(2), 1)\n def test_6(self):\n self.assertEqual(sgn(3), 1)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-sgn-6d4a8e19d5e2", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.525, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 3.95}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_sgn", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `sgn`: Return -1, 0, or 1 as the sign of n. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def sgn(n):\n return (n>0)-(n<0)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 7}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\ntest_5 (test_solution.Test.test_5) ... ok\ntest_6 (test_solution.Test.test_6) ... ok\n\n----------------------------------------------------------------------\nRan 7 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 7, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 7}} {"answer": "def vowels(s):\n return sum(ch.lower() in 'aeiou' for ch in s)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def vowels(s):\n return sum(ch.lower() in 'aeiou' for ch in s)\n", "test_solution.py": "import unittest\nfrom solution import vowels\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(vowels(''), 0)\n def test_1(self):\n self.assertEqual(vowels('xyz'), 0)\n def test_2(self):\n self.assertEqual(vowels('AEIOU'), 5)\n def test_3(self):\n self.assertEqual(vowels('Open Reason'), 5)\n def test_4(self):\n self.assertEqual(vowels('queue'), 4)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-vowels-8f84c53f5d9d", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.125, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.35, "tests": 0.0, "total": 3.5}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_vowels", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `vowels`: Count vowels aeiou in s, case-insensitive. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def vowels(s):\n return sum(ch.lower() in 'aeiou' for ch in s)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 5}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\ntest_4 (test_solution.Test.test_4) ... ok\n\n----------------------------------------------------------------------\nRan 5 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 5, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 5}} {"answer": "import re\ndef snake(s):\n s=re.sub(r'([a-z])([A-Z])', r'\\1_\\2', s)\n s=re.sub(r'[^A-Za-z0-9]+', '_', s)\n return re.sub(r'_+', '_', s).strip('_').lower()", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "import re\ndef snake(s):\n s=re.sub(r'([a-z])([A-Z])', r'\\1_\\2', s)\n s=re.sub(r'[^A-Za-z0-9]+', '_', s)\n return re.sub(r'_+', '_', s).strip('_').lower()\n", "test_solution.py": "import unittest\nfrom solution import snake\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(snake('OpenReason'), 'open_reason')\n def test_1(self):\n self.assertEqual(snake('already_snake'), 'already_snake')\n def test_2(self):\n self.assertEqual(snake('Hello World'), 'hello_world')\n def test_3(self):\n self.assertEqual(snake('A'), 'a')\n"}}, "topic": "algorithms"}, "difficulty": "intermediate", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-snake-497aac12f27b", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.45, "constraints": 1.4, "keywords": 0.0, "math_ops": 2.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 5.45}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_snake", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `snake`: Convert CamelCase or spaces to snake_case keeping alphanumerics. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:47Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "import re\ndef snake(s):\n s=re.sub(r'([a-z])([A-Z])', r'\\1_\\2', s)\n s=re.sub(r'[^A-Za-z0-9]+', '_', s)\n return re.sub(r'_+', '_', s).strip('_').lower()", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def runlen(s):\n if not s:\n return []\n out=[]; last=s[0]; n=1\n for ch in s[1:]:\n if ch==last:\n n+=1\n else:\n out.append((last,n)); last=ch; n=1\n out.append((last,n))\n return out", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def runlen(s):\n if not s:\n return []\n out=[]; last=s[0]; n=1\n for ch in s[1:]:\n if ch==last:\n n+=1\n else:\n out.append((last,n)); last=ch; n=1\n out.append((last,n))\n return out\n", "test_solution.py": "import unittest\nfrom solution import runlen\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(runlen(''), [])\n def test_1(self):\n self.assertEqual(runlen('aaa'), [('a', 3)])\n def test_2(self):\n self.assertEqual(runlen('abba'), [('a', 1), ('b', 2), ('a', 1)])\n def test_3(self):\n self.assertEqual(runlen('aabbaa'), [('a', 2), ('b', 2), ('a', 2)])\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-runlen-7441c90c0d8f", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.6, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.375, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.45, "tests": 0.0, "total": 4.025}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_runlen", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `runlen`: Run-length encode a string as list of (char, count) pairs. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:48Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def runlen(s):\n if not s:\n return []\n out=[]; last=s[0]; n=1\n for ch in s[1:]:\n if ch==last:\n n+=1\n else:\n out.append((last,n)); last=ch; n=1\n out.append((last,n))\n return out", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def is_anagram(a,b):\n def n(x): return sorted(ch.lower() for ch in x if not ch.isspace())\n return n(a)==n(b)", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def is_anagram(a,b):\n def n(x): return sorted(ch.lower() for ch in x if not ch.isspace())\n return n(a)==n(b)\n", "test_solution.py": "import unittest\nfrom solution import is_anagram\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(is_anagram('listen', 'silent'), True)\n def test_1(self):\n self.assertEqual(is_anagram('a', 'b'), False)\n def test_2(self):\n self.assertEqual(is_anagram('Dormitory', 'dirty room'), True)\n def test_3(self):\n self.assertEqual(is_anagram('', ''), True)\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-is-anagram-4c6ccdee2702", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.4, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.0, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 3.475}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_is_anagram", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `is_anagram`: True iff a and b are anagrams ignoring spaces and case. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:48Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def is_anagram(a,b):\n def n(x): return sorted(ch.lower() for ch in x if not ch.isspace())\n return n(a)==n(b)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def titlecase_min(s):\n parts=s.split(' ')\n out=[]\n for i,w in enumerate(parts):\n if not w:\n out.append(w); continue\n if i>0 and len(w)<=2:\n out.append(w.lower())\n else:\n out.append(w[:1].upper()+w[1:].lower())\n return ' '.join(out)", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def titlecase_min(s):\n parts=s.split(' ')\n out=[]\n for i,w in enumerate(parts):\n if not w:\n out.append(w); continue\n if i>0 and len(w)<=2:\n out.append(w.lower())\n else:\n out.append(w[:1].upper()+w[1:].lower())\n return ' '.join(out)\n", "test_solution.py": "import unittest\nfrom solution import titlecase_min\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(titlecase_min('open reason dataset'), 'Open Reason Dataset')\n def test_1(self):\n self.assertEqual(titlecase_min('a b cde'), 'A b Cde')\n def test_2(self):\n self.assertEqual(titlecase_min('SQL'), 'Sql')\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-titlecase-min-f3b5aec7d594", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.475, "tests": 0.0, "total": 4.125}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_titlecase_min", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `titlecase_min`: Title-case words, leaving words of length 1-2 lower except the first. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:48Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def titlecase_min(s):\n parts=s.split(' ')\n out=[]\n for i,w in enumerate(parts):\n if not w:\n out.append(w); continue\n if i>0 and len(w)<=2:\n out.append(w.lower())\n else:\n out.append(w[:1].upper()+w[1:].lower())\n return ' '.join(out)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def strip_html(s):\n out=[]; i=0\n while i', i)\n if j==-1:\n break\n i=j+1\n else:\n out.append(s[i]); i+=1\n return ''.join(out)", "assumptions": [], "concept_id": "python.conditionals", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def strip_html(s):\n out=[]; i=0\n while i', i)\n if j==-1:\n break\n i=j+1\n else:\n out.append(s[i]); i+=1\n return ''.join(out)\n", "test_solution.py": "import unittest\nfrom solution import strip_html\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(strip_html('x'), 'x')\n def test_1(self):\n self.assertEqual(strip_html('plain'), 'plain')\n def test_2(self):\n self.assertEqual(strip_html(\"zy\"), 'zy')\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-strip-html-5c0600ed5fb1", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.55, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.75, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.4, "tests": 0.0, "total": 4.3}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_strip_html", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `strip_html`: Remove <...> tags; do not parse attributes specially. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:48Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def strip_html(s):\n out=[]; i=0\n while i', i)\n if j==-1:\n break\n i=j+1\n else:\n out.append(s[i]); i+=1\n return ''.join(out)", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 3}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\n\n----------------------------------------------------------------------\nRan 3 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 3, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 3}} {"answer": "def csv_escape(s):\n if any(ch in s for ch in ',\\n\"'):\n return '\"'+s.replace('\"','\"\"')+'\"'\n return s", "assumptions": [], "concept_id": "python.functions", "constraints": ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."], "context": {"language": "python", "repository": {"files": {"solution.py": "def csv_escape(s):\n if any(ch in s for ch in ',\\n\"'):\n return '\"'+s.replace('\"','\"\"')+'\"'\n return s\n", "test_solution.py": "import unittest\nfrom solution import csv_escape\nclass Test(unittest.TestCase):\n def test_0(self):\n self.assertEqual(csv_escape('plain'), 'plain')\n def test_1(self):\n self.assertEqual(csv_escape('a,b'), '\"a,b\"')\n def test_2(self):\n self.assertEqual(csv_escape('say \"hi\"'), '\"say \"\"hi\"\"\"')\n def test_3(self):\n self.assertEqual(csv_escape('ok'), 'ok')\n"}}, "topic": "algorithms"}, "difficulty": "beginner", "domain": "coding", "education_level": null, "evidence": null, "id": "or-coding-py-micro-csv-escape-a5bdff54c3bf", "metadata": {"concept_id_inferred": true, "difficulty_score": {"code_size": 0.425, "constraints": 1.4, "keywords": 0.0, "math_ops": 0.5, "observations": 0.0, "plan": 1.2000000000000002, "prompt_length": 0.625, "tests": 0.0, "total": 4.15}, "language": "python", "pipeline_version": "1.3.8", "schema_version": "1.3.8", "slug": "micro_csv_escape", "topic": "algorithms"}, "natural_language": "en", "observations": [], "plan": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "prompt": "Implement `csv_escape`: Escape a field for CSV: wrap in quotes if it contains comma, quote, or newline; double quotes. Use only the Python standard library.", "provenance": {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T01:34:48Z", "generator": "open_reason.generation.coding", "generator_version": "1.3.8", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, "source_type": "synthetic", "source_url": null, "source_version": null, "transformation": null, "trust_tier": "tier7_synthetic", "unknown_reason": null}, "quality": {"evidence_confidence": 0.617, "notes": [], "score_components": {"authority_score": 0.55, "community_score": 0.0, "cross_source_score": 0.0, "provenance_score": 1.0, "recency_score": 0.7, "verification_score": 1.0}, "tier": "S", "verification_method": "sandbox:python", "verified": true}, "runtime": null, "solution": "def csv_escape(s):\n if any(ch in s for ch in ',\\n\"'):\n return '\"'+s.replace('\"','\"\"')+'\"'\n return s", "strategy": ["Read the specification", "Implement the function or class", "Satisfy the tests"], "task_type": "code_generation", "temporal": null, "transformation": ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"], "translation_status": "original", "verification": {"command": "python harness.py", "compiler_version": null, "details": {"payload": {"errors": 0, "failures": 0, "passed": true, "skipped": 0, "tests_run": 4}, "timed_out": false}, "exit_code": null, "memory_mb": null, "method": "sandbox:subprocess", "passed": true, "result": "passed", "runtime_s": null, "runtime_version": null, "stderr": "test_0 (test_solution.Test.test_0) ... ok\ntest_1 (test_solution.Test.test_1) ... ok\ntest_2 (test_solution.Test.test_2) ... ok\ntest_3 (test_solution.Test.test_3) ... ok\n\n----------------------------------------------------------------------\nRan 4 tests in 0.000s\n\nOK\n", "stdout": "OPEN_REASON_RESULT {\"tests_run\": 4, \"failures\": 0, \"errors\": 0, \"skipped\": 0, \"passed\": true}\n", "tests_failed": 0, "tests_passed": 4}} {"answer": "def prefix_fun(xs):\n if not xs:\n return ''\n p=xs[0]\n for s in xs[1:]:\n i=0\n while i