coderace 0.8.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {coderace-0.8.0 → coderace-0.9.0}/PKG-INFO +43 -1
- {coderace-0.8.0 → coderace-0.9.0}/README.md +42 -0
- coderace-0.9.0/all-day-build-contract-v090-tasks.md +163 -0
- coderace-0.9.0/all-day-build-contract-verification-tests.md +165 -0
- coderace-0.9.0/benchmark-results/fibonacci-2026-02-27.md +20 -0
- coderace-0.9.0/benchmark-results/fibonacci-v2-2026-02-27.md +20 -0
- coderace-0.9.0/benchmark-results/hard-tasks-2026-02-27.md +24 -0
- coderace-0.9.0/benchmark-results/multi-task-2026-02-27.md +24 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/codex.py +1 -2
- {coderace-0.8.0 → coderace-0.9.0}/coderace/benchmark.py +64 -4
- {coderace-0.8.0 → coderace-0.9.0}/coderace/benchmark_report.py +147 -8
- {coderace-0.8.0 → coderace-0.9.0}/coderace/builtins/__init__.py +5 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/builtins/tasks/binary-search-tree.yaml +76 -3
- coderace-0.9.0/coderace/builtins/tasks/cli-args-parser.yaml +112 -0
- coderace-0.9.0/coderace/builtins/tasks/csv-analyzer.yaml +140 -0
- coderace-0.9.0/coderace/builtins/tasks/data-pipeline.yaml +106 -0
- coderace-0.9.0/coderace/builtins/tasks/diff-algorithm.yaml +163 -0
- coderace-0.9.0/coderace/builtins/tasks/expression-evaluator.yaml +134 -0
- coderace-0.9.0/coderace/builtins/tasks/fibonacci.yaml +92 -0
- coderace-0.9.0/coderace/builtins/tasks/file-watcher.yaml +138 -0
- coderace-0.9.0/coderace/builtins/tasks/http-server.yaml +163 -0
- coderace-0.9.0/coderace/builtins/tasks/json-parser.yaml +116 -0
- coderace-0.9.0/coderace/builtins/tasks/lru-cache.yaml +179 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/builtins/tasks/markdown-to-html.yaml +33 -3
- coderace-0.9.0/coderace/builtins/tasks/regex-engine.yaml +154 -0
- coderace-0.9.0/coderace/builtins/tasks/state-machine.yaml +127 -0
- coderace-0.9.0/coderace/builtins/tasks/task-scheduler.yaml +182 -0
- coderace-0.9.0/coderace/builtins/tasks/url-router.yaml +165 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/cli.py +2 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/benchmark.py +10 -2
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/tasks.py +4 -1
- {coderace-0.8.0 → coderace-0.9.0}/coderace/reporter.py +3 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/scorer.py +75 -8
- {coderace-0.8.0 → coderace-0.9.0}/coderace/store.py +57 -2
- {coderace-0.8.0 → coderace-0.9.0}/coderace/task.py +33 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/types.py +34 -1
- coderace-0.9.0/progress-log.md +444 -0
- {coderace-0.8.0 → coderace-0.9.0}/pyproject.toml +1 -1
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_adapters.py +1 -1
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_benchmark.py +121 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_builtins.py +11 -1
- coderace-0.9.0/tests/test_scorer.py +247 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_task.py +37 -1
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_tasks_cli.py +3 -0
- coderace-0.9.0/tests/test_verification_integration.py +137 -0
- {coderace-0.8.0 → coderace-0.9.0}/uv.lock +1 -1
- coderace-0.8.0/coderace/builtins/tasks/csv-analyzer.yaml +0 -63
- coderace-0.8.0/coderace/builtins/tasks/fibonacci.yaml +0 -41
- coderace-0.8.0/coderace/builtins/tasks/http-server.yaml +0 -65
- coderace-0.8.0/coderace/builtins/tasks/json-parser.yaml +0 -53
- coderace-0.8.0/progress-log.md +0 -78
- coderace-0.8.0/tests/test_scorer.py +0 -80
- {coderace-0.8.0 → coderace-0.9.0}/.github/workflows/publish.yml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/.gitignore +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/CHANGELOG.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/LICENSE +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/action.yml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-benchmark.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-builtin-tasks.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-ci-integration.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-cost-tracking.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-dashboard.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-leaderboard.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/all-day-build-contract-v0.2.md +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/__init__.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/__init__.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/aider.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/base.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/claude.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/gemini.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/adapters/opencode.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/benchmark_stats.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/__init__.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/dashboard.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/diff.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/history.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/leaderboard.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/commands/results.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/cost.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/dashboard.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/git_ops.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/html_report.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/publish.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/coderace/stats.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/demo-race.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/examples/add-type-hints.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/examples/ci-race-on-pr.yml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/examples/example-task.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/examples/fix-edge-case.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/examples/write-tests.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/scripts/ci-run.sh +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/scripts/format-comment.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tasks/markdown-table.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tasks/parse-duration.yaml +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/__init__.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/conftest.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_cli.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_cli_store_integration.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_cost.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_cost_config.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_cost_integration.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_dashboard.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_dashboard_cli.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_diff.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_examples.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_format_comment.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_full_workflow.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_git_ops.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_history.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_html_report.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_leaderboard.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_markdown_results.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_publish.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_reporter.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_stats.py +0 -0
- {coderace-0.8.0 → coderace-0.9.0}/tests/test_store.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: coderace
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: Race coding agents against each other on real tasks
|
|
5
5
|
Project-URL: Homepage, https://github.com/mikiships/coderace
|
|
6
6
|
Project-URL: Repository, https://github.com/mikiships/coderace
|
|
@@ -106,6 +106,12 @@ description: |
|
|
|
106
106
|
repo: .
|
|
107
107
|
test_command: pytest tests/test_auth.py -x
|
|
108
108
|
lint_command: ruff check .
|
|
109
|
+
# Optional: independent verification suite written after agent completes
|
|
110
|
+
# verify_command: python3 -m pytest verify_auth.py -x -q
|
|
111
|
+
# verify_files:
|
|
112
|
+
# verify_auth.py: |
|
|
113
|
+
# def test_real_contract():
|
|
114
|
+
# assert True
|
|
109
115
|
timeout: 300
|
|
110
116
|
agents:
|
|
111
117
|
- claude
|
|
@@ -133,6 +139,34 @@ For each agent in the task:
|
|
|
133
139
|
| Wall time | 15% | Faster is better (normalized across agents) |
|
|
134
140
|
| Lines changed | 10% | Fewer is better (normalized across agents) |
|
|
135
141
|
|
|
142
|
+
## Verification Tests
|
|
143
|
+
|
|
144
|
+
For stronger evaluation, tasks can define an independent verification suite that the agent does not control.
|
|
145
|
+
|
|
146
|
+
```yaml
|
|
147
|
+
verify_command: python3 -m pytest verify_api_contract.py -x -q
|
|
148
|
+
verify_files:
|
|
149
|
+
verify_api_contract.py: |
|
|
150
|
+
def test_contract_behavior():
|
|
151
|
+
assert True
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Flow for verification-enabled tasks:
|
|
155
|
+
1. Agent completes implementation.
|
|
156
|
+
2. `test_command` runs (agent-authored tests).
|
|
157
|
+
3. `verify_files` are written into the workspace (overwriting same-path files).
|
|
158
|
+
4. `verify_command` runs.
|
|
159
|
+
|
|
160
|
+
Default scoring when `verify_command` is present:
|
|
161
|
+
- tests: 25%
|
|
162
|
+
- verify: 30%
|
|
163
|
+
- exit: 20%
|
|
164
|
+
- lint: 15%
|
|
165
|
+
- time: 5%
|
|
166
|
+
- lines: 5%
|
|
167
|
+
|
|
168
|
+
Tasks without `verify_command` keep the legacy default scoring (40/20/15/15/10).
|
|
169
|
+
|
|
136
170
|
## Output
|
|
137
171
|
|
|
138
172
|
Terminal table with Rich formatting:
|
|
@@ -172,6 +206,14 @@ coderace run --builtin fibonacci
|
|
|
172
206
|
| `csv-analyzer` | Medium | CLI tool for CSV summary statistics |
|
|
173
207
|
| `http-server` | Medium-Hard | HTTP/1.1 server using only stdlib socket |
|
|
174
208
|
| `binary-search-tree` | Hard | AVL tree with insert, delete, search, and balancing |
|
|
209
|
+
| `regex-engine` | Hard | Regex engine with custom matcher + verification suite |
|
|
210
|
+
| `lru-cache` | Hard | Thread-safe LRU + TTL correctness verification |
|
|
211
|
+
| `expression-evaluator` | Hard | Expression parser/evaluator with precedence and functions |
|
|
212
|
+
| `url-router` | Hard | HTTP-style router with params, wildcard, and 405/404 logic |
|
|
213
|
+
| `diff-algorithm` | Hard | Unified diff + patch application roundtrip checks |
|
|
214
|
+
| `task-scheduler` | Hard | Dependency-aware priority scheduler with timeout handling |
|
|
215
|
+
|
|
216
|
+
`coderace tasks list` now includes a `Verify` column so you can see which built-ins ship with verification suites.
|
|
175
217
|
|
|
176
218
|
## Try It Now
|
|
177
219
|
|
|
@@ -76,6 +76,12 @@ description: |
|
|
|
76
76
|
repo: .
|
|
77
77
|
test_command: pytest tests/test_auth.py -x
|
|
78
78
|
lint_command: ruff check .
|
|
79
|
+
# Optional: independent verification suite written after agent completes
|
|
80
|
+
# verify_command: python3 -m pytest verify_auth.py -x -q
|
|
81
|
+
# verify_files:
|
|
82
|
+
# verify_auth.py: |
|
|
83
|
+
# def test_real_contract():
|
|
84
|
+
# assert True
|
|
79
85
|
timeout: 300
|
|
80
86
|
agents:
|
|
81
87
|
- claude
|
|
@@ -103,6 +109,34 @@ For each agent in the task:
|
|
|
103
109
|
| Wall time | 15% | Faster is better (normalized across agents) |
|
|
104
110
|
| Lines changed | 10% | Fewer is better (normalized across agents) |
|
|
105
111
|
|
|
112
|
+
## Verification Tests
|
|
113
|
+
|
|
114
|
+
For stronger evaluation, tasks can define an independent verification suite that the agent does not control.
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
verify_command: python3 -m pytest verify_api_contract.py -x -q
|
|
118
|
+
verify_files:
|
|
119
|
+
verify_api_contract.py: |
|
|
120
|
+
def test_contract_behavior():
|
|
121
|
+
assert True
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Flow for verification-enabled tasks:
|
|
125
|
+
1. Agent completes implementation.
|
|
126
|
+
2. `test_command` runs (agent-authored tests).
|
|
127
|
+
3. `verify_files` are written into the workspace (overwriting same-path files).
|
|
128
|
+
4. `verify_command` runs.
|
|
129
|
+
|
|
130
|
+
Default scoring when `verify_command` is present:
|
|
131
|
+
- tests: 25%
|
|
132
|
+
- verify: 30%
|
|
133
|
+
- exit: 20%
|
|
134
|
+
- lint: 15%
|
|
135
|
+
- time: 5%
|
|
136
|
+
- lines: 5%
|
|
137
|
+
|
|
138
|
+
Tasks without `verify_command` keep the legacy default scoring (40/20/15/15/10).
|
|
139
|
+
|
|
106
140
|
## Output
|
|
107
141
|
|
|
108
142
|
Terminal table with Rich formatting:
|
|
@@ -142,6 +176,14 @@ coderace run --builtin fibonacci
|
|
|
142
176
|
| `csv-analyzer` | Medium | CLI tool for CSV summary statistics |
|
|
143
177
|
| `http-server` | Medium-Hard | HTTP/1.1 server using only stdlib socket |
|
|
144
178
|
| `binary-search-tree` | Hard | AVL tree with insert, delete, search, and balancing |
|
|
179
|
+
| `regex-engine` | Hard | Regex engine with custom matcher + verification suite |
|
|
180
|
+
| `lru-cache` | Hard | Thread-safe LRU + TTL correctness verification |
|
|
181
|
+
| `expression-evaluator` | Hard | Expression parser/evaluator with precedence and functions |
|
|
182
|
+
| `url-router` | Hard | HTTP-style router with params, wildcard, and 405/404 logic |
|
|
183
|
+
| `diff-algorithm` | Hard | Unified diff + patch application roundtrip checks |
|
|
184
|
+
| `task-scheduler` | Hard | Dependency-aware priority scheduler with timeout handling |
|
|
185
|
+
|
|
186
|
+
`coderace tasks list` now includes a `Verify` column so you can see which built-ins ship with verification suites.
|
|
145
187
|
|
|
146
188
|
## Try It Now
|
|
147
189
|
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# All-Day Build Contract: v0.9.0 — Verification Tests + New Tasks
|
|
2
|
+
|
|
3
|
+
Status: In Progress
|
|
4
|
+
Date: 2026-02-28
|
|
5
|
+
Owner: Codex execution pass
|
|
6
|
+
Scope type: Deliverable-gated (no hour promises)
|
|
7
|
+
|
|
8
|
+
## 1. Objective
|
|
9
|
+
|
|
10
|
+
Add verification tests to all 6 built-in tasks that lack them, and add 4 new built-in tasks that test different programming skills. The verification test runner (verify_command + verify_files) landed in v0.8.1 but only 6/12 tasks use it. Every task should have independent verification tests — tests the agent can't see, that validate the agent's implementation against a known-good spec. This is the feature that separates coderace from "run pytest and hope."
|
|
11
|
+
|
|
12
|
+
New tasks should cover skills the current suite doesn't: file I/O, CLI argument parsing, data transformation pipeline, and a state machine. These are practical programming tasks that real developers encounter, not academic exercises.
|
|
13
|
+
|
|
14
|
+
This contract is considered complete only when every deliverable and validation gate below is satisfied.
|
|
15
|
+
|
|
16
|
+
## 2. Non-Negotiable Build Rules
|
|
17
|
+
|
|
18
|
+
1. No time-based completion claims.
|
|
19
|
+
2. Completion is allowed only when all checklist items are checked.
|
|
20
|
+
3. Full test suite must pass at the end (`uv run python -m pytest`).
|
|
21
|
+
4. New tasks must follow the exact YAML schema used by existing tasks.
|
|
22
|
+
5. Never modify files outside the project directory.
|
|
23
|
+
6. Commit after each completed deliverable (not at the end).
|
|
24
|
+
7. If stuck on same issue for 3 attempts, stop and write a blocker report.
|
|
25
|
+
8. Do NOT refactor, restyle, or "improve" code outside the deliverables.
|
|
26
|
+
9. Read existing tasks and tests before writing new ones. Match style exactly.
|
|
27
|
+
10. Every verify_files test must be self-contained (no imports from the task description that aren't part of the standard library + pytest).
|
|
28
|
+
11. verify_command tests must be meaningfully different from test_command tests — they should test edge cases, integration behavior, or correctness properties the agent's own tests might miss.
|
|
29
|
+
|
|
30
|
+
## 3. Feature Deliverables
|
|
31
|
+
|
|
32
|
+
### D1. Add verify_command + verify_files to fibonacci.yaml
|
|
33
|
+
|
|
34
|
+
The fibonacci task currently has no verification tests. Add verify_files with a verify test file that tests:
|
|
35
|
+
- Large fibonacci numbers (fib(50), fib(100)) to ensure memoization actually works (not just that it doesn't crash)
|
|
36
|
+
- Type checking: verify return types are int, not float
|
|
37
|
+
- Edge case: fib(0) and fib(1) specifically
|
|
38
|
+
- Performance: fib(100) should complete in under 1 second (verify memoization)
|
|
39
|
+
- fibonacci_sequence returns a list, not a generator
|
|
40
|
+
|
|
41
|
+
Required files to modify:
|
|
42
|
+
- `coderace/builtins/tasks/fibonacci.yaml`
|
|
43
|
+
|
|
44
|
+
- [ ] Add verify_command and verify_files to fibonacci.yaml
|
|
45
|
+
- [ ] Verify tests are meaningfully different from the task's test_command expectations
|
|
46
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
47
|
+
|
|
48
|
+
### D2. Add verify_command + verify_files to json-parser.yaml
|
|
49
|
+
|
|
50
|
+
- [ ] Add verification tests that test malformed JSON edge cases, nested structures, unicode handling
|
|
51
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
52
|
+
|
|
53
|
+
### D3. Add verify_command + verify_files to csv-analyzer.yaml
|
|
54
|
+
|
|
55
|
+
- [ ] Add verification tests for empty CSVs, CSVs with quoted fields containing commas/newlines, large datasets
|
|
56
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
57
|
+
|
|
58
|
+
### D4. Add verify_command + verify_files to markdown-to-html.yaml
|
|
59
|
+
|
|
60
|
+
- [ ] Add verification tests for nested formatting, edge cases (empty input, only whitespace), HTML entity escaping
|
|
61
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
62
|
+
|
|
63
|
+
### D5. Add verify_command + verify_files to http-server.yaml
|
|
64
|
+
|
|
65
|
+
- [ ] Add verification tests for concurrent requests, proper HTTP headers, error responses, content-type handling
|
|
66
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
67
|
+
|
|
68
|
+
### D6. Add verify_command + verify_files to binary-search-tree.yaml
|
|
69
|
+
|
|
70
|
+
- [ ] Add verification tests for AVL balance property, deletion edge cases, large sequential inserts
|
|
71
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
72
|
+
|
|
73
|
+
### D7. New task: file-watcher (medium)
|
|
74
|
+
|
|
75
|
+
Create `coderace/builtins/tasks/file-watcher.yaml`:
|
|
76
|
+
A CLI tool that watches a directory for file changes and logs them. Tests file I/O, directory traversal, and event handling.
|
|
77
|
+
|
|
78
|
+
Requirements for the task description:
|
|
79
|
+
- Implement `file_watcher.py` with a `FileWatcher` class
|
|
80
|
+
- Methods: `scan(directory) -> dict[str, FileInfo]`, `diff(old_scan, new_scan) -> list[Change]`
|
|
81
|
+
- FileInfo: path, size, modified_time, hash (md5)
|
|
82
|
+
- Change types: added, modified, deleted
|
|
83
|
+
- Must handle nested directories
|
|
84
|
+
- Agent writes their own tests in `test_file_watcher.py`
|
|
85
|
+
|
|
86
|
+
Include verify_command + verify_files from the start.
|
|
87
|
+
|
|
88
|
+
- [ ] Create file-watcher.yaml with full task spec + verification tests
|
|
89
|
+
- [ ] Register in builtins __init__.py if needed
|
|
90
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
91
|
+
|
|
92
|
+
### D8. New task: cli-args-parser (medium)
|
|
93
|
+
|
|
94
|
+
Create `coderace/builtins/tasks/cli-args-parser.yaml`:
|
|
95
|
+
Build a lightweight CLI argument parser (like a mini argparse). Tests string parsing, API design, error handling.
|
|
96
|
+
|
|
97
|
+
Requirements:
|
|
98
|
+
- Implement `cli_parser.py` with an `ArgumentParser` class
|
|
99
|
+
- Support: positional args, --flags, --key=value, --key value, -short flags, --no-flag (boolean negation)
|
|
100
|
+
- Methods: `add_argument(name, type, default, required, help)`, `parse(args: list[str]) -> Namespace`
|
|
101
|
+
- Proper error messages for missing required args, type conversion failures
|
|
102
|
+
- Agent writes tests in `test_cli_parser.py`
|
|
103
|
+
|
|
104
|
+
Include verify_command + verify_files.
|
|
105
|
+
|
|
106
|
+
- [ ] Create cli-args-parser.yaml with full task spec + verification tests
|
|
107
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
108
|
+
|
|
109
|
+
### D9. New task: data-pipeline (hard)
|
|
110
|
+
|
|
111
|
+
Create `coderace/builtins/tasks/data-pipeline.yaml`:
|
|
112
|
+
Build a composable data transformation pipeline. Tests functional programming patterns, method chaining, lazy evaluation.
|
|
113
|
+
|
|
114
|
+
Requirements:
|
|
115
|
+
- Implement `pipeline.py` with a `Pipeline` class
|
|
116
|
+
- Methods: `map(fn)`, `filter(fn)`, `reduce(fn, initial)`, `sort(key)`, `take(n)`, `skip(n)`, `batch(size)`
|
|
117
|
+
- Pipelines are lazy (don't execute until `.collect()` or `.first()`)
|
|
118
|
+
- Pipelines are composable: `pipe1 | pipe2` creates a combined pipeline
|
|
119
|
+
- Agent writes tests in `test_pipeline.py`
|
|
120
|
+
|
|
121
|
+
Include verify_command + verify_files.
|
|
122
|
+
|
|
123
|
+
- [ ] Create data-pipeline.yaml with full task spec + verification tests
|
|
124
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
125
|
+
|
|
126
|
+
### D10. New task: state-machine (medium-hard)
|
|
127
|
+
|
|
128
|
+
Create `coderace/builtins/tasks/state-machine.yaml`:
|
|
129
|
+
Implement a finite state machine with transition guards and event handling. Tests OOP design, state management.
|
|
130
|
+
|
|
131
|
+
Requirements:
|
|
132
|
+
- Implement `state_machine.py` with `StateMachine`, `State`, `Transition` classes
|
|
133
|
+
- Define states, transitions with guards (conditions), and actions (callbacks)
|
|
134
|
+
- Methods: `add_state(name, on_enter, on_exit)`, `add_transition(from, to, event, guard)`, `trigger(event)`, `current_state`
|
|
135
|
+
- Raise `InvalidTransition` for illegal transitions
|
|
136
|
+
- Support `on_enter`/`on_exit` hooks for states
|
|
137
|
+
- Agent writes tests in `test_state_machine.py`
|
|
138
|
+
|
|
139
|
+
Include verify_command + verify_files.
|
|
140
|
+
|
|
141
|
+
- [ ] Create state-machine.yaml with full task spec + verification tests
|
|
142
|
+
- [ ] Run `uv run python -m pytest tests/ -q` — all tests pass
|
|
143
|
+
|
|
144
|
+
## 4. Test Requirements
|
|
145
|
+
|
|
146
|
+
- [ ] All existing 411 tests must still pass
|
|
147
|
+
- [ ] New YAML tasks must be loadable by the task loader (test with `uv run python -c "from coderace.builtins import list_builtin_tasks; print(list_builtin_tasks())"`)
|
|
148
|
+
- [ ] All new tasks must have valid YAML that passes task schema validation
|
|
149
|
+
- [ ] verify_files content must be valid Python that would actually pass if a correct implementation existed
|
|
150
|
+
- [ ] Final count: 16 built-in tasks, all with verify_command + verify_files
|
|
151
|
+
|
|
152
|
+
## 5. Reports
|
|
153
|
+
|
|
154
|
+
- Write progress to `progress-log.md` after each deliverable
|
|
155
|
+
- Include: what was built, what tests pass, what's next, any blockers
|
|
156
|
+
- Final summary when all deliverables done or stopped
|
|
157
|
+
|
|
158
|
+
## 6. Stop Conditions
|
|
159
|
+
|
|
160
|
+
- All deliverables checked and all tests passing -> DONE
|
|
161
|
+
- 3 consecutive failed attempts on same issue -> STOP, write blocker report
|
|
162
|
+
- Scope creep detected (new requirements discovered) -> STOP, report what's new
|
|
163
|
+
- All tests passing but deliverables remain -> continue to next deliverable
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# All-Day Build Contract: Verification Tests (v0.9.0)
|
|
2
|
+
|
|
3
|
+
Status: In Progress
|
|
4
|
+
Date: 2026-02-27
|
|
5
|
+
Owner: Codex execution pass
|
|
6
|
+
Scope type: Deliverable-gated (no hour promises)
|
|
7
|
+
|
|
8
|
+
## 1. Objective
|
|
9
|
+
|
|
10
|
+
Add "verification tests" to coderace: pre-written test suites that run AFTER an agent completes a task, validating the agent's implementation against a known standard. Currently agents score 100% because they write their own tests and naturally make them pass. Verification tests solve this by providing an independent quality check the agent doesn't control.
|
|
11
|
+
|
|
12
|
+
New YAML fields:
|
|
13
|
+
- `verify_command`: command to run verification tests (e.g., `python3 -m pytest verify_fibonacci.py -x -q`)
|
|
14
|
+
- `verify_files`: dict of `{filename: content}` that get written into the task workspace BEFORE `verify_command` runs
|
|
15
|
+
|
|
16
|
+
Scoring changes:
|
|
17
|
+
- If task has `verify_command`: tests=25, verify=30, exit=20, lint=15, time=5, lines=5
|
|
18
|
+
- If task has NO `verify_command`: scoring unchanged (backward compatible)
|
|
19
|
+
|
|
20
|
+
This contract is considered complete only when every deliverable and validation gate below is satisfied.
|
|
21
|
+
|
|
22
|
+
## 2. Non-Negotiable Build Rules
|
|
23
|
+
|
|
24
|
+
1. No time-based completion claims.
|
|
25
|
+
2. Completion is allowed only when all checklist items are checked.
|
|
26
|
+
3. Full test suite must pass at the end.
|
|
27
|
+
4. New features must ship with docs and report addendum updates in the same pass.
|
|
28
|
+
5. CLI outputs must be deterministic and schema-backed where specified.
|
|
29
|
+
6. Never modify files outside the project directory.
|
|
30
|
+
7. Commit after each completed deliverable (not at the end).
|
|
31
|
+
8. If stuck on same issue for 3 attempts, stop and write a blocker report.
|
|
32
|
+
9. Do NOT refactor, restyle, or "improve" code outside the deliverables.
|
|
33
|
+
10. Read existing tests and docs before writing new code.
|
|
34
|
+
|
|
35
|
+
## 3. Feature Deliverables
|
|
36
|
+
|
|
37
|
+
### D1. Verification Test Runner (core engine)
|
|
38
|
+
|
|
39
|
+
Add verification test support to the coderace runner. After an agent completes a task and the normal `test_command` runs, if the task has `verify_command` and `verify_files`:
|
|
40
|
+
1. Write each file from `verify_files` into the task workspace (overwriting any agent-written file with the same name is OK — that's the point)
|
|
41
|
+
2. Run `verify_command` in the workspace
|
|
42
|
+
3. Capture pass/fail/output the same way `test_command` is captured
|
|
43
|
+
4. Add `verify_score`, `verify_output`, `verify_passed` to the result
|
|
44
|
+
|
|
45
|
+
Required files to modify:
|
|
46
|
+
- `coderace/runner.py` (or wherever task execution happens)
|
|
47
|
+
- `coderace/models.py` or result dataclasses
|
|
48
|
+
|
|
49
|
+
Read the existing runner code first to understand the execution flow.
|
|
50
|
+
|
|
51
|
+
- [ ] Parse `verify_command` and `verify_files` from task YAML
|
|
52
|
+
- [ ] Write verify_files to workspace after agent completes
|
|
53
|
+
- [ ] Run verify_command and capture results
|
|
54
|
+
- [ ] Add verify fields to result model
|
|
55
|
+
- [ ] Tests for D1
|
|
56
|
+
|
|
57
|
+
### D2. Scoring Engine Update
|
|
58
|
+
|
|
59
|
+
Update the scoring engine to incorporate verification test results.
|
|
60
|
+
|
|
61
|
+
When a task has `verify_command`:
|
|
62
|
+
- `tests` weight: 25 (agent's own tests)
|
|
63
|
+
- `verify` weight: 30 (verification tests)
|
|
64
|
+
- `exit` weight: 20
|
|
65
|
+
- `lint` weight: 15
|
|
66
|
+
- `time` weight: 5
|
|
67
|
+
- `lines` weight: 5
|
|
68
|
+
|
|
69
|
+
When a task does NOT have `verify_command`:
|
|
70
|
+
- Keep existing scoring unchanged (backward compatible)
|
|
71
|
+
|
|
72
|
+
The task YAML can also override these weights with a `scoring:` section as it already does.
|
|
73
|
+
|
|
74
|
+
Required files to modify:
|
|
75
|
+
- `coderace/scoring.py` (or wherever scoring happens)
|
|
76
|
+
|
|
77
|
+
- [ ] Add verify score calculation
|
|
78
|
+
- [ ] Update weight distribution when verify_command present
|
|
79
|
+
- [ ] Backward compatibility: no verify_command = old scoring
|
|
80
|
+
- [ ] Tests for D2
|
|
81
|
+
|
|
82
|
+
### D3. Benchmark Report Update
|
|
83
|
+
|
|
84
|
+
Update the benchmark report (terminal, markdown, HTML) to show verification scores separately.
|
|
85
|
+
|
|
86
|
+
In the results table, when any task has verification tests:
|
|
87
|
+
- Add a "Verify" column showing verification pass/fail percentage
|
|
88
|
+
- In task details, show verification output (truncated to 20 lines)
|
|
89
|
+
|
|
90
|
+
Required files to modify:
|
|
91
|
+
- `coderace/benchmark_report.py`
|
|
92
|
+
- `coderace/commands/benchmark.py` (if CLI output changes)
|
|
93
|
+
|
|
94
|
+
- [ ] Terminal report shows Verify column
|
|
95
|
+
- [ ] Markdown report shows Verify column
|
|
96
|
+
- [ ] HTML report shows Verify column
|
|
97
|
+
- [ ] Verification output in task details
|
|
98
|
+
- [ ] Tests for D3
|
|
99
|
+
|
|
100
|
+
### D4. Six Hard Built-in Tasks with Verification Tests
|
|
101
|
+
|
|
102
|
+
Create 6 new built-in tasks with embedded verification tests. These must be tasks where coding agents are likely to make mistakes. Each task YAML includes both a `test_command` (agents write their own tests) and `verify_command` + `verify_files` (our verification suite).
|
|
103
|
+
|
|
104
|
+
Tasks to create in `coderace/builtins/tasks/`:
|
|
105
|
+
|
|
106
|
+
1. **regex-engine** (hard): Implement a basic regex engine supporting `.`, `*`, `+`, `?`, `^`, `$`, character classes `[abc]`, `[a-z]`, `[^abc]`, and alternation `a|b`. Must handle backtracking correctly. Verification tests: catastrophic backtracking detection (must complete in <2s), nested quantifier edge cases, empty string matching.
|
|
107
|
+
|
|
108
|
+
2. **lru-cache** (medium-hard): Implement an LRU cache with O(1) get/put, max capacity, TTL expiry, and thread safety. Verification tests: concurrent access correctness, TTL precision, capacity overflow ordering.
|
|
109
|
+
|
|
110
|
+
3. **expression-evaluator** (hard): Implement a math expression parser and evaluator supporting +, -, *, /, **, parentheses, unary minus, variables, and functions (sin, cos, sqrt, abs). Must handle operator precedence correctly. Verification tests: deeply nested expressions, operator precedence edge cases, floating point precision, error handling for division by zero and undefined variables.
|
|
111
|
+
|
|
112
|
+
4. **url-router** (medium-hard): Implement an HTTP URL router with path parameters (`/users/:id`), wildcards (`/files/*path`), middleware support, and method matching. Verification tests: ambiguous route resolution, parameter extraction, middleware ordering, 405 vs 404 distinction.
|
|
113
|
+
|
|
114
|
+
5. **diff-algorithm** (hard): Implement Myers diff algorithm producing unified diff output. Must handle insertions, deletions, modifications, and generate minimal edit distance patches. Verification tests: large file diffs (1000+ lines), binary-like content, all-insert/all-delete edge cases, patch application roundtrip.
|
|
115
|
+
|
|
116
|
+
6. **task-scheduler** (hard): Implement a priority-based task scheduler with dependencies (DAG), cycle detection, parallel execution slots, and timeout handling. Verification tests: diamond dependencies, cycle detection accuracy, priority inversion scenarios, timeout edge cases.
|
|
117
|
+
|
|
118
|
+
Each task YAML must include:
|
|
119
|
+
- Clear description (what to build)
|
|
120
|
+
- `verify_files` with a comprehensive test file (30-50 test cases each)
|
|
121
|
+
- `verify_command` pointing to the verification test file
|
|
122
|
+
- Difficulty rating: hard
|
|
123
|
+
- Scoring weights using the new verify-aware distribution
|
|
124
|
+
|
|
125
|
+
- [ ] regex-engine.yaml with verify_files
|
|
126
|
+
- [ ] lru-cache.yaml with verify_files
|
|
127
|
+
- [ ] expression-evaluator.yaml with verify_files
|
|
128
|
+
- [ ] url-router.yaml with verify_files
|
|
129
|
+
- [ ] diff-algorithm.yaml with verify_files
|
|
130
|
+
- [ ] task-scheduler.yaml with verify_files
|
|
131
|
+
|
|
132
|
+
### D5. Documentation + Final Tests
|
|
133
|
+
|
|
134
|
+
- Update README.md: Verification Tests section explaining the feature
|
|
135
|
+
- Update `coderace tasks list` output to show which tasks have verification tests
|
|
136
|
+
- Integration tests: run a mock task with verify_command, confirm scoring works end-to-end
|
|
137
|
+
|
|
138
|
+
- [ ] README updated with Verification Tests section
|
|
139
|
+
- [ ] `tasks list` shows verification badge
|
|
140
|
+
- [ ] Integration test for full verify flow
|
|
141
|
+
- [ ] All existing tests still pass
|
|
142
|
+
|
|
143
|
+
## 4. Test Requirements
|
|
144
|
+
|
|
145
|
+
- [ ] Unit tests for verify file writing
|
|
146
|
+
- [ ] Unit tests for verify command execution
|
|
147
|
+
- [ ] Unit tests for scoring with/without verify
|
|
148
|
+
- [ ] Unit tests for report generation with verify columns
|
|
149
|
+
- [ ] Integration test: task with verify_command scores differently than without
|
|
150
|
+
- [ ] Integration test: verify_files correctly overwrite workspace files
|
|
151
|
+
- [ ] Edge cases: verify_command fails, verify_files empty, task has verify but agent breaks the interface
|
|
152
|
+
- [ ] All 392 existing tests must still pass
|
|
153
|
+
|
|
154
|
+
## 5. Reports
|
|
155
|
+
|
|
156
|
+
- Write progress to `progress-log.md` after each deliverable
|
|
157
|
+
- Include: what was built, what tests pass, what's next, any blockers
|
|
158
|
+
- Final summary when all deliverables done or stopped
|
|
159
|
+
|
|
160
|
+
## 6. Stop Conditions
|
|
161
|
+
|
|
162
|
+
- All deliverables checked and all tests passing -> DONE
|
|
163
|
+
- 3 consecutive failed attempts on same issue -> STOP, write blocker report
|
|
164
|
+
- Scope creep detected (new requirements discovered) -> STOP, report what's new
|
|
165
|
+
- All tests passing but deliverables remain -> continue to next deliverable
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# coderace Benchmark Results
|
|
2
|
+
|
|
3
|
+
Generated: 2026-02-27 15:37 UTC
|
|
4
|
+
|
|
5
|
+
Benchmark ID: `bench-20260227-153601`
|
|
6
|
+
|
|
7
|
+
| Task | claude | codex |
|
|
8
|
+
|------|------|------|
|
|
9
|
+
| fibonacci | 35.0 (34s) | 35.0 (62s) |
|
|
10
|
+
|------|------|------|
|
|
11
|
+
| **TOTAL** | **35.0** | **35.0** |
|
|
12
|
+
| **Win Rate** | 100% | 100% |
|
|
13
|
+
| **Avg Time** | 33.6s | 61.6s |
|
|
14
|
+
| **Total Cost** | $0.0218 | - |
|
|
15
|
+
|
|
16
|
+
## Task Insights
|
|
17
|
+
|
|
18
|
+
| Task | Best Agent | Best Score | Avg Score | Fastest Agent |
|
|
19
|
+
|------|-----------|-----------|----------|--------------|
|
|
20
|
+
| fibonacci | claude | 35.0 | 35.0 | claude (34s) |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# coderace Benchmark Results
|
|
2
|
+
|
|
3
|
+
Generated: 2026-02-27 15:40 UTC
|
|
4
|
+
|
|
5
|
+
Benchmark ID: `bench-20260227-153946`
|
|
6
|
+
|
|
7
|
+
| Task | claude | codex |
|
|
8
|
+
|------|------|------|
|
|
9
|
+
| fibonacci | 100.0 (34s) | 100.0 (26s) |
|
|
10
|
+
|------|------|------|
|
|
11
|
+
| **TOTAL** | **100.0** | **100.0** |
|
|
12
|
+
| **Win Rate** | 100% | 100% |
|
|
13
|
+
| **Avg Time** | 33.7s | 25.9s |
|
|
14
|
+
| **Total Cost** | $0.0173 | - |
|
|
15
|
+
|
|
16
|
+
## Task Insights
|
|
17
|
+
|
|
18
|
+
| Task | Best Agent | Best Score | Avg Score | Fastest Agent |
|
|
19
|
+
|------|-----------|-----------|----------|--------------|
|
|
20
|
+
| fibonacci | claude | 100.0 | 100.0 | codex (26s) |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# coderace Benchmark Results
|
|
2
|
+
|
|
3
|
+
Generated: 2026-02-27 15:55 UTC
|
|
4
|
+
|
|
5
|
+
Benchmark ID: `bench-20260227-154647`
|
|
6
|
+
|
|
7
|
+
| Task | claude | codex |
|
|
8
|
+
|------|------|------|
|
|
9
|
+
| binary-search-tree | 100.0 (47s) | 100.0 (33s) |
|
|
10
|
+
| csv-analyzer | 100.0 (71s) | 100.0 (137s) |
|
|
11
|
+
| http-server | 100.0 (64s) | 100.0 (185s) |
|
|
12
|
+
|------|------|------|
|
|
13
|
+
| **TOTAL** | **300.0** | **300.0** |
|
|
14
|
+
| **Win Rate** | 100% | 100% |
|
|
15
|
+
| **Avg Time** | 60.8s | 118.2s |
|
|
16
|
+
| **Total Cost** | $0.1669 | - |
|
|
17
|
+
|
|
18
|
+
## Task Insights
|
|
19
|
+
|
|
20
|
+
| Task | Best Agent | Best Score | Avg Score | Fastest Agent |
|
|
21
|
+
|------|-----------|-----------|----------|--------------|
|
|
22
|
+
| binary-search-tree | claude | 100.0 | 100.0 | codex (33s) |
|
|
23
|
+
| csv-analyzer | claude | 100.0 | 100.0 | claude (71s) |
|
|
24
|
+
| http-server | claude | 100.0 | 100.0 | claude (64s) |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# coderace Benchmark Results
|
|
2
|
+
|
|
3
|
+
Generated: 2026-02-27 15:46 UTC
|
|
4
|
+
|
|
5
|
+
Benchmark ID: `bench-20260227-154058`
|
|
6
|
+
|
|
7
|
+
| Task | claude | codex |
|
|
8
|
+
|------|------|------|
|
|
9
|
+
| fibonacci | 100.0 (25s) | 100.0 (71s) |
|
|
10
|
+
| json-parser | 100.0 (66s) | 100.0 (42s) |
|
|
11
|
+
| markdown-to-html | 100.0 (74s) | 100.0 (48s) |
|
|
12
|
+
|------|------|------|
|
|
13
|
+
| **TOTAL** | **300.0** | **300.0** |
|
|
14
|
+
| **Win Rate** | 100% | 100% |
|
|
15
|
+
| **Avg Time** | 55.1s | 53.5s |
|
|
16
|
+
| **Total Cost** | $0.1471 | - |
|
|
17
|
+
|
|
18
|
+
## Task Insights
|
|
19
|
+
|
|
20
|
+
| Task | Best Agent | Best Score | Avg Score | Fastest Agent |
|
|
21
|
+
|------|-----------|-----------|----------|--------------|
|
|
22
|
+
| fibonacci | claude | 100.0 | 100.0 | claude (25s) |
|
|
23
|
+
| json-parser | claude | 100.0 | 100.0 | codex (42s) |
|
|
24
|
+
| markdown-to-html | claude | 100.0 | 100.0 | codex (48s) |
|