Datasets:
id stringlengths 30 95 | domain stringclasses 5
values | task_type stringclasses 49
values | difficulty stringclasses 5
values | prompt stringlengths 12 3.09k | context stringclasses 596
values | observations stringlengths 2 170 | constraints stringclasses 242
values | assumptions stringclasses 51
values | plan stringclasses 240
values | strategy stringclasses 240
values | solution stringlengths 5 766 | answer stringlengths 1 766 | verification stringlengths 268 1.71k ⌀ | provenance stringclasses 95
values | quality stringclasses 29
values | education_level stringclasses 6
values | concept_id stringclasses 54
values | evidence stringclasses 29
values | transformation stringclasses 8
values | temporal stringclasses 0
values | runtime stringclasses 0
values | natural_language stringclasses 1
value | translation_status stringclasses 1
value | metadata stringlengths 220 5.58k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
or-coding-py-nested-delimiter-scan-85bd9022ad05 | coding | code_generation | beginner | Implement `delimiters_ok(text: str) -> bool`.
Return True if every round, square, and curly bracket in `text` is correctly
nested and matched. All other characters are ignored. Empty input is valid. | {"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]:... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def delimiters_ok(text):
pairs = {")": "(", "]": "[", "}": "{"}
stack = []
for ch in text:
if ch in "([{":
stack.append(ch)
elif ch in ")]}":
if not stack or stack[-1] != pairs[ch]:
return False
stack.pop()
return not stack | def delimiters_ok(text):
pairs = {")": "(", "]": "[", "}": "{"}
stack = []
for ch in text:
if ch in "([{":
stack.append(ch)
elif ch in ")]}":
if not stack or stack[-1] != pairs[ch]:
return False
stack.pop()
return not stack | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "nest... |
or-coding-py-window-max-sum-6217a2479b07 | coding | code_generation | intermediate | Implement `max_window_sum(values, k)` returning the maximum sum of any
contiguous subarray of length `k`. If `k` is larger than the list, raise ValueError. | {"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 i... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def max_window_sum(values, k):
if k <= 0 or k > len(values):
raise ValueError("invalid window")
current = sum(values[:k])
best = current
for i in range(k, len(values)):
current += values[i] - values[i - k]
if current > best:
best = current
return best | def max_window_sum(values, k):
if k <= 0 or k > len(values):
raise ValueError("invalid window")
current = sum(values[:k])
best = current
for i in range(k, len(values)):
current += values[i] - values[i - k]
if current > best:
best = current
return best | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "windo... |
or-coding-py-debug-window-max-sum-929a7ef31c21 | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `max_window_sum(values, k)` returning the maximum sum of any
contiguous subarray of length `k`. If `k` is larger than the list, raise ValueError.
--- solution.py (buggy) ---
def max_window_sum... | {"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\... | ["Forgets to subtract the value leaving the window."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | def max_window_sum(values, k):
if k <= 0 or k > len(values):
raise ValueError("invalid window")
current = sum(values[:k])
best = current
for i in range(k, len(values)):
current += values[i] - values[i - k]
if current > best:
best = current
return best | def max_window_sum(values, k):
if k <= 0 or k > len(values):
raise ValueError("invalid window")
current = sum(values[:k])
best = current
for i in range(k, len(values)):
current += values[i] - values[i - k]
if current > best:
best = current
return best | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:44Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-stable-group-by-af1de6dd3bd2 | coding | code_generation | beginner | Implement `group_in_order(items, key_fn)` that groups consecutive items with
the same key, preserving first-seen group order for non-consecutive keys as well
(like an insertion-ordered map of lists). Return a list of (key, group_list) pairs. | {"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 r... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def group_in_order(items, key_fn):
order = []
buckets = {}
for item in items:
key = key_fn(item)
if key not in buckets:
buckets[key] = []
order.append(key)
buckets[key].append(item)
return [(key, buckets[key]) for key in order] | def group_in_order(items, key_fn):
order = []
buckets = {}
for item in items:
key = key_fn(item)
if key not in buckets:
buckets[key] = []
order.append(key)
buckets[key].append(item)
return [(key, buckets[key]) for key in order] | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0",... |
or-coding-py-lru-cache-map-5dfd0b972649 | coding | code_generation | beginner | Implement class `TinyLRU(capacity)` with `get(key)` (return None if missing)
and `put(key, value)`. Evict the least recently used entry when over capacity.
Both get and put count as use. | {"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):\... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | from collections import OrderedDict
class TinyLRU:
def __init__(self, capacity):
if capacity < 1:
raise ValueError("capacity")
self.capacity = capacity
self._data = OrderedDict()
def get(self, key):
if key not in self._data:
return None
self._data.move_to_end(key)
return self._data[key]
def put(self, key,... | from collections import OrderedDict
class TinyLRU:
def __init__(self, capacity):
if capacity < 1:
raise ValueError("capacity")
self.capacity = capacity
self._data = OrderedDict()
def get(self, key):
if key not in self._data:
return None
self._data.move_to_end(key)
return self._data[key]
def put(self, key,... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "lru_cach... |
or-coding-py-debug-lru-cache-map-d25e87700735 | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement class `TinyLRU(capacity)` with `get(key)` (return None if missing)
and `put(key, value)`. Evict the least recently used entry when over capacity.
Both get and put count as use.
--- solution.py... | {"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_soluti... | ["get() does not refresh recency."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | from collections import OrderedDict
class TinyLRU:
def __init__(self, capacity):
if capacity < 1:
raise ValueError("capacity")
self.capacity = capacity
self._data = OrderedDict()
def get(self, key):
if key not in self._data:
return None
self._data.move_to_end(key)
return self._data[key]
def put(self, key,... | from collections import OrderedDict
class TinyLRU:
def __init__(self, capacity):
if capacity < 1:
raise ValueError("capacity")
self.capacity = capacity
self._data = OrderedDict()
def get(self, key):
if key not in self._data:
return None
self._data.move_to_end(key)
return self._data[key]
def put(self, key,... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": ... |
or-coding-py-binary-search-first-4a8714ec195f | coding | code_generation | intermediate | Implement `first_ge(sorted_values, target)` returning the smallest index i
such that sorted_values[i] >= target, or len(sorted_values) if none exists.
The list is sorted non-decreasing. | {"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_solu... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def first_ge(sorted_values, target):
lo, hi = 0, len(sorted_values)
while lo < hi:
mid = (lo + hi) // 2
if sorted_values[mid] < target:
lo = mid + 1
else:
hi = mid
return lo | def first_ge(sorted_values, target):
lo, hi = 0, len(sorted_values)
while lo < hi:
mid = (lo + hi) // 2
if sorted_values[mid] < target:
lo = mid + 1
else:
hi = mid
return lo | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0",... |
or-coding-py-merge-intervals-cc5bc5fd01ac | coding | code_generation | intermediate | Implement `merge_ranges(ranges)` where each range is [start, end] with
start <= end. Return a new list of disjoint merged ranges sorted by start. | {"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], ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def merge_ranges(ranges):
if not ranges:
return []
ordered = sorted(ranges, key=lambda r: r[0])
out = [list(ordered[0])]
for start, end in ordered[1:]:
if start <= out[-1][1]:
out[-1][1] = max(out[-1][1], end)
else:
out.append([start, end])
return out | def merge_ranges(ranges):
if not ranges:
return []
ordered = sorted(ranges, key=lambda r: r[0])
out = [list(ordered[0])]
for start, end in ordered[1:]:
if start <= out[-1][1]:
out[-1][1] = max(out[-1][1], end)
else:
out.append([start, end])
return out | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "merge... |
or-coding-py-debug-merge-intervals-6fc2cea66a6d | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `merge_ranges(ranges)` where each range is [start, end] with
start <= end. Return a new list of disjoint merged ranges sorted by start.
--- solution.py (buggy) ---
def merge_ranges(ranges):
i... | {"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) ... FAI... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | def merge_ranges(ranges):
if not ranges:
return []
ordered = sorted(ranges, key=lambda r: r[0])
out = [list(ordered[0])]
for start, end in ordered[1:]:
if start <= out[-1][1]:
out[-1][1] = max(out[-1][1], end)
else:
out.append([start, end])
return out | def merge_ranges(ranges):
if not ranges:
return []
ordered = sorted(ranges, key=lambda r: r[0])
out = [list(ordered[0])]
for start, end in ordered[1:]:
if start <= out[-1][1]:
out[-1][1] = max(out[-1][1], end)
else:
out.append([start, end])
return out | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-topo-order-50c5ec8cdc24 | coding | code_generation | intermediate | Implement `topo_sort(nodes, edges)` for a directed acyclic graph.
`nodes` is a list of hashable ids. `edges` is a list of (src, dst) meaning
src must come before dst. Return any valid topological order. Raise ValueError
if a cycle exists. | {"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 ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | from collections import defaultdict, deque
def topo_sort(nodes, edges):
incoming = {n: 0 for n in nodes}
graph = defaultdict(list)
for src, dst in edges:
graph[src].append(dst)
incoming[dst] = incoming.get(dst, 0) + 1
incoming.setdefault(src, incoming.get(src, 0))
ready = deque([n for n in nodes if incoming.get... | from collections import defaultdict, deque
def topo_sort(nodes, edges):
incoming = {n: 0 for n in nodes}
graph = defaultdict(list)
for src, dst in edges:
graph[src].append(dst)
incoming[dst] = incoming.get(dst, 0) + 1
incoming.setdefault(src, incoming.get(src, 0))
ready = deque([n for n in nodes if incoming.get... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.collections | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "topo_o... |
or-coding-py-debug-topo-order-7b0d10953f8f | coding | debugging | expert | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `topo_sort(nodes, edges)` for a directed acyclic graph.
`nodes` is a list of hashable ids. `edges` is a list of (src, dst) meaning
src must come before dst. Return any valid topological order. ... | {"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==================================================... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | from collections import defaultdict, deque
def topo_sort(nodes, edges):
incoming = {n: 0 for n in nodes}
graph = defaultdict(list)
for src, dst in edges:
graph[src].append(dst)
incoming[dst] = incoming.get(dst, 0) + 1
incoming.setdefault(src, incoming.get(src, 0))
ready = deque([n for n in nodes if incoming.get... | from collections import defaultdict, deque
def topo_sort(nodes, edges):
incoming = {n: 0 for n in nodes}
graph = defaultdict(list)
for src, dst in edges:
graph[src].append(dst)
incoming[dst] = incoming.get(dst, 0) + 1
incoming.setdefault(src, incoming.get(src, 0))
ready = deque([n for n in nodes if incoming.get... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.collections | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-dijkstra-hops-3cc79c98ed19 | coding | code_generation | beginner | Implement `shortest_cost(graph, start, goal)` where graph maps node ->
list of (neighbor, weight) with non-negative weights. Return the minimum cost
or None if unreachable. | {"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 ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | import heapq
def shortest_cost(graph, start, goal):
best = {start: 0}
heap = [(0, start)]
while heap:
cost, node = heapq.heappop(heap)
if cost != best.get(node, None):
continue
if node == goal:
return cost
for nxt, weight in graph.get(node, []):
cand = cost + weight
if cand < best.get(nxt, float("inf")):
b... | import heapq
def shortest_cost(graph, start, goal):
best = {start: 0}
heap = [(0, start)]
while heap:
cost, node = heapq.heappop(heap)
if cost != best.get(node, None):
continue
if node == goal:
return cost
for nxt, weight in graph.get(node, []):
cand = cost + weight
if cand < best.get(nxt, float("inf")):
b... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.loops | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "dijkstra_h... |
or-coding-py-debug-dijkstra-hops-6ee2d302315a | coding | debugging | expert | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `shortest_cost(graph, start, goal)` where graph maps node ->
list of (neighbor, weight) with non-negative weights. Return the minimum cost
or None if unreachable.
--- solution.py (buggy) ---
i... | {"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==============================================... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | import heapq
def shortest_cost(graph, start, goal):
best = {start: 0}
heap = [(0, start)]
while heap:
cost, node = heapq.heappop(heap)
if cost != best.get(node, None):
continue
if node == goal:
return cost
for nxt, weight in graph.get(node, []):
cand = cost + weight
if cand < best.get(nxt, float("inf")):
b... | import heapq
def shortest_cost(graph, start, goal):
best = {start: 0}
heap = [(0, start)]
while heap:
cost, node = heapq.heappop(heap)
if cost != best.get(node, None):
continue
if node == goal:
return cost
for nxt, weight in graph.get(node, []):
cand = cost + weight
if cand < best.get(nxt, float("inf")):
b... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {"err... |
or-coding-py-heap-median-ebe3df4f8fd3 | coding | code_generation | intermediate | Implement class `RunningMedian` with `add(x)` and `median()` (mean of the
two center values when the count is even). Values are numbers. | {"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... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | import heapq
class RunningMedian:
def __init__(self):
self.low = []
self.high = []
def add(self, x):
if not self.low or x <= -self.low[0]:
heapq.heappush(self.low, -x)
else:
heapq.heappush(self.high, x)
if len(self.low) > len(self.high) + 1:
heapq.heappush(self.high, -heapq.heappop(self.low))
elif len(self... | import heapq
class RunningMedian:
def __init__(self):
self.low = []
self.high = []
def add(self, x):
if not self.low or x <= -self.low[0]:
heapq.heappush(self.low, -x)
else:
heapq.heappush(self.high, x)
if len(self.low) > len(self.high) + 1:
heapq.heappush(self.high, -heapq.heappop(self.low))
elif len(self... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "heap... |
or-coding-py-parse-kv-config-761c659cab58 | coding | code_generation | intermediate | Implement `parse_kv(text)` for a tiny config language:
- ignore blank lines and lines starting with `#`
- remaining lines are `key = value` (value trimmed, may contain =)
- duplicate keys: last wins
Return a dict. Raise ValueError on lines without `=`. | {"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... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def parse_kv(text):
result = {}
for raw in text.splitlines():
line = raw.strip()
if not line or line.startswith("#"):
continue
if "=" not in line:
raise ValueError(line)
key, value = line.split("=", 1)
result[key.strip()] = value.strip()
return result | def parse_kv(text):
result = {}
for raw in text.splitlines():
line = raw.strip()
if not line or line.startswith("#"):
continue
if "=" not in line:
raise ValueError(line)
key, value = line.split("=", 1)
result[key.strip()] = value.strip()
return result | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0",... |
or-coding-py-semver-core-cmp-af727ae91767 | coding | code_generation | beginner | Implement `cmp_semver(a, b)` comparing MAJOR.MINOR.PATCH strings (digits
only, no pre-release). Return -1, 0, or 1. | {"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 ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def cmp_semver(a, b):
def parts(s):
bits = s.split(".")
if len(bits) != 3 or not all(p.isdigit() for p in bits):
raise ValueError(s)
return tuple(int(p) for p in bits)
left, right = parts(a), parts(b)
return (left > right) - (left < right) | def cmp_semver(a, b):
def parts(s):
bits = s.split(".")
if len(bits) != 3 or not all(p.isdigit() for p in bits):
raise ValueError(s)
return tuple(int(p) for p in bits)
left, right = parts(a), parts(b)
return (left > right) - (left < right) | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "... |
or-coding-py-debug-semver-core-cmp-3ec077e8ae1c | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `cmp_semver(a, b)` comparing MAJOR.MINOR.PATCH strings (digits
only, no pre-release). Return -1, 0, or 1.
--- solution.py (buggy) ---
def cmp_semver(a, b):
return (a > b) - (a < b)
--- test_... | {"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.Tes... | ["Compares as strings so 1.10.0 < 1.2.0."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | def cmp_semver(a, b):
def parts(s):
bits = s.split(".")
if len(bits) != 3 or not all(p.isdigit() for p in bits):
raise ValueError(s)
return tuple(int(p) for p in bits)
left, right = parts(a), parts(b)
return (left > right) - (left < right) | def cmp_semver(a, b):
def parts(s):
bits = s.split(".")
if len(bits) != 3 or not all(p.isdigit() for p in bits):
raise ValueError(s)
return tuple(int(p) for p in bits)
left, right = parts(a), parts(b)
return (left > right) - (left < right) | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:45Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {"er... |
or-coding-py-dep-resolution-pins-c28ab4b294ab | coding | code_generation | beginner | Implement `pins_ok(declared, locked)` where declared maps package ->
minimum inclusive version tuple (major, minor, patch) and locked maps package
-> installed version tuple. Every declared package must be present and
installed >= minimum. Extra locked packages are allowed. | {"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\nfr... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def pins_ok(declared, locked):
for name, minimum in declared.items():
if name not in locked:
return False
if locked[name] < minimum:
return False
return True | def pins_ok(declared, locked):
for name, minimum in declared.items():
if name not in locked:
return False
if locked[name] < minimum:
return False
return True | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", ... |
or-coding-py-debug-dep-resolution-pins-1435c42ac5ce | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `pins_ok(declared, locked)` where declared maps package ->
minimum inclusive version tuple (major, minor, patch) and locked maps package
-> installed version tuple. Every declared package must ... | {"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=====... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | def pins_ok(declared, locked):
for name, minimum in declared.items():
if name not in locked:
return False
if locked[name] < minimum:
return False
return True | def pins_ok(declared, locked):
for name, minimum in declared.items():
if name not in locked:
return False
if locked[name] < minimum:
return False
return True | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.modules | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-sql-ident-quote-d0a22efbb77f | coding | code_generation | intermediate | Implement `quote_ident(name)` for a conservative SQL identifier:
accept only `[A-Za-z_][A-Za-z0-9_]*` and wrap in double quotes with internal
quotes doubled. Raise ValueError otherwise. This is defensive quoting, not a
parser for arbitrary SQL. | {"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 ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | import re
def quote_ident(name):
if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name):
raise ValueError("invalid identifier")
return '"' + name.replace('"', '""') + '"' | import re
def quote_ident(name):
if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name):
raise ValueError("invalid identifier")
return '"' + name.replace('"', '""') + '"' | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "sql_i... |
or-coding-py-debug-sql-ident-quote-802f0517d1d2 | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `quote_ident(name)` for a conservative SQL identifier:
accept only `[A-Za-z_][A-Za-z0-9_]*` and wrap in double quotes with internal
quotes doubled. Raise ValueError otherwise. This is defensive... | {"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=====================================================... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | import re
def quote_ident(name):
if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name):
raise ValueError("invalid identifier")
return '"' + name.replace('"', '""') + '"' | import re
def quote_ident(name):
if not re.fullmatch(r"[A-Za-z_][A-Za-z0-9_]*", name):
raise ValueError("invalid identifier")
return '"' + name.replace('"', '""') + '"' | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-parameterized-filter-2992f1833ac8 | coding | code_generation | intermediate | Implement `safe_select_by_id(conn, table, row_id)` using sqlite3.
`table` must match `[a-z_]+`. Execute a parameterized query
`SELECT * FROM {table} WHERE id = ?` and return the list of rows.
Never interpolate `row_id` into the SQL string. | {"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_solut... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | import re
def safe_select_by_id(conn, table, row_id):
if not re.fullmatch(r"[a-z_]+", table):
raise ValueError("table")
sql = f'SELECT * FROM "{table}" WHERE id = ?'
return list(conn.execute(sql, (row_id,))) | import re
def safe_select_by_id(conn, table, row_id):
if not re.fullmatch(r"[a-z_]+", table):
raise ValueError("table")
sql = f'SELECT * FROM "{table}" WHERE id = ?'
return list(conn.execute(sql, (row_id,))) | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "para... |
or-coding-py-path-confine-9bfc484ac11f | coding | code_generation | beginner | Implement `resolve_under(root, relative)` that joins `relative` to `root`
and returns the resolved path only if it stays inside `root`. Reject `..`
escapes. Use pathlib. Raise ValueError on escape. | {"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 ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | from pathlib import Path
def resolve_under(root, relative):
base = Path(root).resolve()
target = (base / relative).resolve()
try:
target.relative_to(base)
except ValueError as exc:
raise ValueError("escape") from exc
return str(target) | from pathlib import Path
def resolve_under(root, relative):
base = Path(root).resolve()
target = (base / relative).resolve()
try:
target.relative_to(base)
except ValueError as exc:
raise ValueError("escape") from exc
return str(target) | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.exceptions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "sl... |
or-coding-py-cidr-contains-880e214734b6 | coding | code_generation | beginner | Implement `ipv4_in_cidr(ip, cidr)` where ip is dotted IPv4 and cidr is
like `10.0.0.0/8`. Return True iff the address is in the prefix. No extra
libraries beyond stdlib. | {"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_i... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | import ipaddress
def ipv4_in_cidr(ip, cidr):
return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False) | import ipaddress
def ipv4_in_cidr(ip, cidr):
return ipaddress.IPv4Address(ip) in ipaddress.IPv4Network(cidr, strict=False) | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", ... |
or-coding-py-fcfs-finish-72e6ead16506 | coding | code_generation | beginner | Implement `fcfs_completion(jobs)` where each job is (arrival, burst) and
jobs are already ordered by arrival time (ties keep given order). Return a list
of completion times in the same order. The CPU is idle until the next arrival
if needed. | {"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... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def fcfs_completion(jobs):
time = 0
done = []
for arrival, burst in jobs:
time = max(time, arrival) + burst
done.append(time)
return done | def fcfs_completion(jobs):
time = 0
done = []
for arrival, burst in jobs:
time = max(time, arrival) + burst
done.append(time)
return done | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "fcfs_... |
or-coding-py-debug-fcfs-finish-69a773b61602 | coding | debugging | advanced | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `fcfs_completion(jobs)` where each job is (arrival, burst) and
jobs are already ordered by arrival time (ties keep given order). Return a list
of completion times in the same order. The CPU is ... | {"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==================================================... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | def fcfs_completion(jobs):
time = 0
done = []
for arrival, burst in jobs:
time = max(time, arrival) + burst
done.append(time)
return done | def fcfs_completion(jobs):
time = 0
done = []
for arrival, burst in jobs:
time = max(time, arrival) + burst
done.append(time)
return done | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-round-robin-trace-992838c315ea | coding | code_generation | advanced | Implement `rr_finish(bursts, quantum)` for processes all arriving at 0,
indexed 0..n-1, using a FIFO ready queue. Return completion times list.
Ignore context-switch cost. | {"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])... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | from collections import deque
def rr_finish(bursts, quantum):
remaining = list(bursts)
finish = [None] * len(bursts)
q = deque(range(len(bursts)))
t = 0
while q:
i = q.popleft()
run = min(quantum, remaining[i])
remaining[i] -= run
t += run
if remaining[i] == 0:
finish[i] = t
else:
q.append(i)
return fini... | from collections import deque
def rr_finish(bursts, quantum):
remaining = list(bursts)
finish = [None] * len(bursts)
q = deque(range(len(bursts)))
t = 0
while q:
i = q.popleft()
run = min(quantum, remaining[i])
remaining[i] -= run
t += run
if remaining[i] == 0:
finish[i] = t
else:
q.append(i)
return fini... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "round_... |
or-coding-py-debug-round-robin-trace-426b74f925fc | coding | debugging | expert | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement `rr_finish(bursts, quantum)` for processes all arriving at 0,
indexed 0..n-1, using a FIFO ready queue. Return completion times list.
Ignore context-switch cost.
--- solution.py (buggy) ---
fr... | {"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... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | from collections import deque
def rr_finish(bursts, quantum):
remaining = list(bursts)
finish = [None] * len(bursts)
q = deque(range(len(bursts)))
t = 0
while q:
i = q.popleft()
run = min(quantum, remaining[i])
remaining[i] -= run
t += run
if remaining[i] == 0:
finish[i] = t
else:
q.append(i)
return fini... | from collections import deque
def rr_finish(bursts, quantum):
remaining = list(bursts)
finish = [None] * len(bursts)
q = deque(range(len(bursts)))
t = 0
while q:
i = q.popleft()
run = min(quantum, remaining[i])
remaining[i] -= run
t += run
if remaining[i] == 0:
finish[i] = t
else:
q.append(i)
return fini... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:46Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {... |
or-coding-py-lru-page-faults-e1513d15e836 | coding | code_generation | beginner | Implement `lru_faults(pages, frames)` counting page faults with LRU
replacement among `frames` slots. Empty frames fill first. | {"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) < ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def lru_faults(pages, frames):
slot = []
used = []
faults = 0
for page in pages:
if page in slot:
used.remove(page)
used.append(page)
continue
faults += 1
if len(slot) < frames:
slot.append(page)
else:
victim = used.pop(0)
idx = slot.index(victim)
slot[idx] = page
used.append(page)
return faults | def lru_faults(pages, frames):
slot = []
used = []
faults = 0
for page in pages:
if page in slot:
used.remove(page)
used.append(page)
continue
faults += 1
if len(slot) < frames:
slot.append(page)
else:
victim = used.pop(0)
idx = slot.index(victim)
slot[idx] = page
used.append(page)
return faults | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.conditionals | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "lru_page... |
or-coding-py-banker-safe-3b58e6d2a848 | coding | code_generation | intermediate | Implement `is_safe(available, allocation, need)` for the Banker's algorithm
safety check. `available` is a list of resource counts. `allocation` and `need`
are lists of per-process lists. Return True iff a safe sequence exists. | {"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 ... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | def is_safe(available, allocation, need):
work = list(available)
finish = [False] * len(allocation)
while True:
progressed = False
for i, done in enumerate(finish):
if done:
continue
if all(need[i][j] <= work[j] for j in range(len(work))):
for j in range(len(work)):
work[j] += allocation[i][j]
finish[i] = Tr... | def is_safe(available, allocation, need):
work = list(available)
finish = [False] * len(allocation)
while True:
progressed = False
for i, done in enumerate(finish):
if done:
continue
if all(need[i][j] <= work[j] for j in range(len(work))):
for j in range(len(work)):
work[j] += allocation[i][j]
finish[i] = Tr... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.loops | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "s... |
or-coding-py-token-bucket-f0a6eaa2b164 | coding | code_generation | intermediate | Implement class `TokenBucket(rate, burst)` with `allow(time, cost=1)`.
`rate` is tokens per time unit, `burst` is max tokens. Start full at t=0.
`time` is non-decreasing. Return True if the request is admitted. | {"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 Val... | [] | ["Use only the Python standard library unless the prompt says otherwise.", "The hidden tests in test_solution.py must pass."] | [] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | ["Read the specification", "Implement the function or class", "Satisfy the tests"] | class TokenBucket:
def __init__(self, rate, burst):
self.rate = rate
self.burst = burst
self.tokens = float(burst)
self.t = 0.0
def allow(self, time, cost=1):
if time < self.t:
raise ValueError("time")
self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)
self.t = time
if self.tokens >= c... | class TokenBucket:
def __init__(self, rate, burst):
self.rate = rate
self.burst = burst
self.tokens = float(burst)
self.t = 0.0
def allow(self, time, cost=1):
if time < self.t:
raise ValueError("time")
self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)
self.t = time
if self.tokens >= c... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.functions | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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.4.0", "schema_version": "1.4.0", "slug": "token_... |
or-coding-py-debug-token-bucket-ba68a47d70d8 | coding | debugging | expert | The following Python module fails its tests. Produce a corrected solution.py that preserves the intended behaviour.
Implement class `TokenBucket(rate, burst)` with `allow(time, cost=1)`.
`rate` is tokens per time unit, `burst` is max tokens. Start full at t=0.
`time` is non-decreasing. Return True if the request is ad... | {"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:... | ["Seeded mutation of the reference implementation."] | ["Do not weaken or delete tests", "Keep the public API"] | [] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | ["Reproduce the failure", "Identify the defect", "Apply a minimal fix", "Re-run tests"] | class TokenBucket:
def __init__(self, rate, burst):
self.rate = rate
self.burst = burst
self.tokens = float(burst)
self.t = 0.0
def allow(self, time, cost=1):
if time < self.t:
raise ValueError("time")
self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)
self.t = time
if self.tokens >= c... | class TokenBucket:
def __init__(self, rate, burst):
self.rate = rate
self.burst = burst
self.tokens = float(burst)
self.t = 0.0
def allow(self, time, cost=1):
if time < self.t:
raise ValueError("time")
self.tokens = min(self.burst, self.tokens + (time - self.t) * self.rate)
self.t = time
if self.tokens >= c... | {"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... | {"commit": null, "derived": false, "derived_from": null, "generated_at": "2026-08-19T02:04:58Z", "generator": "open_reason.generation.coding", "generator_version": "1.4.0", "license": "Apache License 2.0", "license_spdx": "Apache-2.0", "retrieved_at": null, "source": "open_reason.generation.coding", "source_id": null, ... | {"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} | null | python.testing | null | ["task_generation", "difficulty_assignment", "verification", "knowledge_normalization"] | null | null | en | original | {"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": {"err... |
Dataset Card for Open Reason
An open, verified dataset for coding, science, mathematics, and human reasoning.
- Dataset: https://huggingface.co/datasets/theworker02/open-reason
- Small model: https://huggingface.co/theworker02/open-reason-small (~1.3M CPU causal LM; not 1B)
- Medium model: https://huggingface.co/theworker02/open-reason-medium (~13.9M CPU causal LM; not 1B)
- GitHub: https://github.com/theworker02/open-reason
- Site: https://theworker02.github.io/open-reason/
Open Reason is a provenance-aware corpus plus a reproducible pipeline. It is intended for training and evaluating systems on coding, mathematics, science, structured decision-making, and human problem solving.
Open Reason does not use Reddit as a data source. Quora is not a primary source of truth. Case study: docs/why-not-reddit.md.
Supported tasks
- Code generation, debugging, SQL, systems simulations, packaging, and defensive validation
- Structured reasoning (planning, constraints, causal and temporal problems)
- Mathematical problem solving with symbolic or integer checks
- Scientific calculation, modeling, and experimental-design counts
- Teaching, explanation, and synthesis (human-authored)
- Curriculum-aligned education tasks with concept ids and education levels
Languages
Prompts and solutions are English. Verified coding languages in v1.4.0: Python, SQL, JavaScript (when the sandbox can run them). Other languages appear as original concept tasks and are not marked verified.
Source information
| Kind | How to recognize | v1.4.0 |
|---|---|---|
| Human-authored | provenance.source_type = human_authored |
Teaching, synthesis, qualitative items |
| Synthetic | provenance.source_type = synthetic plus generator |
Math, science, most reasoning/coding, curriculum |
| Source-derived | open_source / community with provenance URL/commit |
GitHub-permissive original tasks; Stack Overflow seeds (verbatim=false) |
| Verified | quality.verified = true and verification.passed = true |
Coding sandbox, sympy, numeric, constraint checks |
| Unverified | quality.verified = false |
Reviewed teaching and misconception items (tier A) |
Never treat synthetic rows as human-authored. Never treat unverified rows as executed.
Licensing
Original dataset content and pipeline: Apache 2.0. Per-row provenance.license_spdx is authoritative for upstream GitHub/SO snippets.
Provenance
See docs/provenance.md. Unknown origin requires unknown_reason.
Preprocessing
Unicode NFKC, newline normalization, trimmed lists, task_type slugging. Meaning is not paraphrased.
Deduplication
Exact SHA-256 of canonical fields, normalized prompt/answer hashes, 64-bit simhash. Stats in the release manifest.
Contamination controls
configs/denylist.yaml fingerprints known eval sets. Hits are reported, not silently deleted. --strict fails the build on hits. Hold out benchmarks/ from training.
Quality controls
Schema, SPDX allowlist, Reddit rejection, Quora-as-source rejection, PII heuristics, sandbox/sympy/numeric checks, community-votes-are-not-verification. Tiers S/A/B/C: docs/quality.md. Reddit case study: docs/why-not-reddit.md. evidence_confidence is not a claim of truth.
Intended uses
Research on reasoning and code models; filtering by domain, language, tier, and license; evaluation using the separate benchmarks/ suite.
Limitations
Small v1.4.0 corpus (~3.2K rows); still English-centric; verified coding languages limited to sandbox runtimes; teaching items are not executable oracles unless a numeric/sympy/sandbox check exists; third-party educational sites are registered but not scraped; denylists cannot be complete.
Bias considerations
Synthetic generators encode the authors' choice of topics (software engineering, STEM calculations, operational triage). They under-represent many human domains and languages.
Ethical considerations
No Reddit/social dumps. Case study: docs/why-not-reddit.md. Defensive security only. Minimize PII. Do not present this as a universal "human reasoning" sample.
Maintenance
Issues and PRs: https://github.com/theworker02/open-reason
Hugging Face dataset: https://huggingface.co/datasets/theworker02/open-reason
Small CPU model (1.3M): https://huggingface.co/theworker02/open-reason-small13.9M): https://huggingface.co/theworker02/open-reason-medium
Medium CPU model (
Releases are immutable; GitHub tags map to Hub revisions. Fixes ship in a new version. Shards are not stored in the GitHub git tree.
Citation
See CITATION.cff and the README BibTeX entry.
v1.4.0 snapshot
Pipeline version 1.4.0.
| Configuration | Examples | Verified | Human-authored |
|---|---|---|---|
| coding | 400 | 386 | 0 |
| reasoning | 580 | 580 | 0 |
| science | 527 | 527 | 0 |
| mathematics | 1050 | 1050 | 0 |
| human | 289 | 261 | 28 |
| education | 345 | 111 | 0 |
| core | 3175 | 2899 | 28 |
| verified | 2899 | 2899 | 0 |
| all | 3175 | 2899 | 28 |
Rebuild with open-reason build --config all --seed 42 --out data/release.
Full tables: data/release/statistics.md.
- Downloads last month
- 57