test(benchmarks): add A/B task fixtures with hidden checks
Ten small Python tasks, each failing on the fixture and passing with a reference solution, including workflow expectations for a small change, a bugfix, and a delegable change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b8fd66ce3b
commit
3480072ed7
60 files changed
+374
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,17 @@
|
||||
import unittest
|
||||
from app.parsers.csv_parser import parse_csv
|
||||
from app.parsers.ini_parser import parse_ini
|
||||
from app.parsers.json_parser import parse_json_lines
|
||||
|
||||
|
||||
class Hidden(unittest.TestCase):
|
||||
def test_csv(self):
|
||||
self.assertEqual(parse_csv('a, b\n1, "x,y"\n\n2,3\n'), [{'a': '1', 'b': 'x,y'}, {'a': '2', 'b': '3'}])
|
||||
|
||||
def test_json(self):
|
||||
self.assertEqual(parse_json_lines('{"a": 1}\n\n[2]\n'), [{'a': 1}, [2]])
|
||||
with self.assertRaisesRegex(ValueError, '2'):
|
||||
parse_json_lines('{}\n{bad\n')
|
||||
|
||||
def test_ini(self):
|
||||
self.assertEqual(parse_ini('top = 1\n; c\n[s]\n# c\n k = v \n'), {'': {'top': '1'}, 's': {'k': 'v'}})
|
||||
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,6 @@
|
||||
def parse_csv(text):
|
||||
"""Parse comma-separated text with a header row into a list of dicts.
|
||||
|
||||
Strip whitespace around cells, skip blank lines, and support double-quoted cells containing commas.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,6 @@
|
||||
def parse_ini(text):
|
||||
"""Parse INI text into {section: {key: value}}.
|
||||
|
||||
Ignore lines starting with ; or #, strip whitespace, keep keys before the first section under "".
|
||||
"""
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,6 @@
|
||||
def parse_json_lines(text):
|
||||
"""Parse JSON Lines text into a list of objects.
|
||||
|
||||
Skip blank lines. Raise ValueError naming the 1-based line number for invalid JSON.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"prompt": "Implement the three independent parsers in app/parsers (csv_parser, json_parser, ini_parser) according to their docstrings, and add unit tests for each. They share no code.",
|
||||
"workflow": {
|
||||
"kind": "larger change with justified delegation",
|
||||
"min_agents": 1,
|
||||
"max_agents": 3
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user