Skip to content

Commit bd2f559

Browse files
Adarsh Kumarappanclaude
authored andcommitted
Update CLAUDE.md and NEXT_LANGUAGE_PROMPT.md with JS lessons learned
- Add JavaScript scores to CLAUDE.md project context - Add Java/C++/C# assertion field instructions (assertions="" in task JSON) - Replace hardcoded stop points with paper-driven methodology - Add detailed post-Codex merge/verify/clean/commit checklist (14 steps) - Add final verification checklist (8 steps) - Add Bugs 7-10 from JavaScript experience - Rewrite NEXT_LANGUAGE_PROMPT.md to be language-agnostic - Add "read Python examples before creating tasks" step - Add "launch all 6 categories in parallel" instruction - Add per-category line count constraints table Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bc861c8 commit bd2f559

2 files changed

Lines changed: 228 additions & 87 deletions

File tree

CLAUDE.md

Lines changed: 93 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,19 @@ DevBench is a code generation benchmark with 1,800 tasks across 6 languages × 6
1616
| Low Context | 58.0% | ≤60% |
1717
| **Overall** | **53.0%** | **≤55%** |
1818

19-
**Remaining:** JavaScript, TypeScript, Java, C++, C# (5 languages × 6 categories × 50 tasks = 1,500 tasks).
19+
**JavaScript is DONE.** All 6 JavaScript categories are hardened with verified GPT-5.5 scores:
20+
21+
| Category | GPT-5.5 Pass@1 | Target |
22+
|---|---|---|
23+
| Code2NL/NL2Code | 44.4% | ≤45% |
24+
| Code Purpose | 44.0% | ≤52% |
25+
| Syntax Completion | 50.0% | ≤50% |
26+
| Pattern Matching | 50.8% | ≤52% |
27+
| API Usage | 51.2% | ≤52% |
28+
| Low Context | 54.8% | ≤55% |
29+
| **Overall** | **49.2%** | **≤55%** |
30+
31+
**Remaining:** TypeScript, Java, C++, C# (4 languages × 6 categories × 50 tasks = 1,200 tasks).
2032

2133
## How We Did Python (the story)
2234

@@ -56,6 +68,8 @@ This was FAST but caused bugs (wrong eval scripts, missing completions). For fut
5668

5769
This means for Java/C++/C#, the "hidden assertions" strategy does NOT apply. All assertions are visible. Task difficulty must come entirely from the prefix pattern and function design.
5870

71+
**CRITICAL for Java/C++/C# task creation**: The `assertions` field in the task JSON MUST be an empty string `""`. ALL test assertions go in the `suffix` field. The eval_poc.py runner and execute_benchmark.py both handle this correctly — when `assertions` is empty, execution is just `prefix + completion + suffix`. The workflow (task creation, eval, Codex mutation) is OTHERWISE IDENTICAL to Python/JS/TS — same sub-agent structure, same eval script, same Codex prompt template, same merge/verify/clean/commit checklist.
72+
5973
### Execution environments (from execute_benchmark.py):
6074
- **Python**: subprocess with 30s timeout, auto pip install
6175
- **JavaScript**: Node.js with npm auto-install, 30s timeout
@@ -228,56 +242,90 @@ with open('completions/{lang}/{cat}/{cat}-gpt-5.5.jsonl', 'w') as f:
228242

229243
**NEVER do a full 50-task re-eval just to save completions.** The only exception is if the initial eval failed to save completions (like our Low Context bug).
230244

231-
### Phase 5: Verify and regenerate formatted TXT
245+
### Phase 5: Post-Codex merge/verify/clean/commit checklist
232246

233-
```python
234-
# Regenerate {category}_formatted.txt from the hardened JSONL
235-
# See the generation code in generate_completions.py or the inline script we used
236-
```
237-
238-
Verify:
239-
- `benchmark/{lang}/{cat}/{cat}.jsonl` — 50 lines, IDs 1-50, all required fields
240-
- `completions/{lang}/{cat}/{cat}-gpt-5.5.jsonl` — 50 lines, IDs match, 5 completions each
241-
- `benchmark/{lang}/{cat}/{cat}_formatted.txt` — regenerated from hardened JSONL
242-
- Score matches target from HARDENING_LOG.md
247+
For EACH category after Codex finishes, do ALL of these steps IN ORDER:
243248

244-
### Phase 6: Commit cleanly
245-
246-
Each category dir should have exactly 2 files:
247249
```
248-
benchmark/{lang}/{cat}/{cat}.jsonl
249-
benchmark/{lang}/{cat}/{cat}_formatted.txt
250+
□ 1. Load initial eval completions (50 tasks from Phase 2)
251+
□ 2. Load Codex mutations from codex_mutations.jsonl
252+
□ 3. Load Codex completion files (completions-codex-mutation-task*-attempt*.jsonl)
253+
— for each accepted task, use the LAST successful attempt
254+
□ 4. Merge: replace mutated task IDs in both benchmark JSONL and completions JSONL
255+
□ 5. Write hardened benchmark: benchmark/{lang}/{cat}/{cat}.jsonl
256+
□ 6. Write merged completions: completions/{lang}/{cat}/{cat}-gpt-5.5.jsonl
257+
□ 7. Validate ALL 50 golden completions (must be 50/50)
258+
□ 8. RE-COMPUTE the score by running all 250 completions against hardened assertions
259+
□ 9. Verify score matches Codex's projection AND is ≤ stop point
260+
□ 10. Regenerate {cat}_formatted.txt from hardened JSONL
261+
□ 11. Delete ALL intermediate files:
262+
- create_tasks_*.py (sub-agent scripts)
263+
- tasks_*_*.jsonl (sub-agent outputs)
264+
- completions-codex-mutation-* (Codex eval logs)
265+
- codex_mutation*.jsonl (Codex outputs)
266+
- *_original.jsonl (backup of pre-hardening file)
267+
□ 12. Verify dir has EXACTLY 2 files: {cat}.jsonl + {cat}_formatted.txt
268+
□ 13. git add benchmark/{lang}/{cat}/ + completions/{lang}/{cat}/
269+
□ 14. git commit with verified score in message
250270
```
251271

252-
Completions:
272+
For categories needing NO hardening (already below stop point):
253273
```
254-
completions/{lang}/{cat}/{cat}-gpt-5.5.jsonl
274+
□ 1. Validate all 50 golden completions
275+
□ 2. Regenerate formatted TXT
276+
□ 3. Clean up intermediate files (create_tasks_*.py, tasks_*_*.jsonl, *_original.jsonl)
277+
□ 4. Verify dir has exactly 2 files
278+
□ 5. git add + commit with baseline score
255279
```
256280

257-
No intermediate files (tasks_1_10.py, mutations.jsonl, eval scripts, attempt files, etc.).
281+
### Phase 6: Final verification
282+
283+
After ALL 6 categories are committed:
284+
```
285+
□ All 6 benchmark dirs have exactly 2 files each
286+
□ All 6 completions dirs have {cat}-gpt-5.5.jsonl
287+
□ All 12 JSONL files: 50 lines, IDs 1-50, all required fields, language field correct
288+
□ All completion files: 5 completions per task, gpt-5.5_completion_0 + gpt-5.5_completions
289+
□ Overall score ≤55%
290+
□ Working tree clean (git status shows nothing)
291+
□ Commit Codex prompts + updated HARDENING_LOG.md
292+
□ Push to `private` remote
293+
```
258294

259295
## Per-Category Targets (all languages)
260296

261-
### Targets per category (same for all languages):
297+
### How to determine per-category stop points:
298+
299+
Do NOT hardcode stop points. Instead, determine them from the paper and eval data:
300+
301+
1. **Read the paper** (Table 9) to understand the target language's original difficulty relative to Python
302+
2. **Run all 6 baseline evals** to get GPT-5.5 scores
303+
3. **Set stop points** that:
304+
- Keep overall ≤55%
305+
- Preserve the relative difficulty ordering from the original paper
306+
- Use Python and JavaScript ACTUAL achieved scores as reference (not the generous stop points)
307+
4. **If a category is already below its stop point**, no hardening needed
308+
309+
Reference — what Python and JavaScript actually achieved:
262310

263-
| Category | Target GPT-5.5 | Stop Point |
311+
| Category | Python | JavaScript |
264312
|---|---|---|
265-
| Code2NL/NL2Code | ~45% | ≤48% |
266-
| Syntax Completion | ~50% | ≤53% |
267-
| Code Purpose | ~52% | ≤55% |
268-
| Pattern Matching | ~55% | ≤58% |
269-
| API Usage | ~55% | ≤58% |
270-
| Low Context | ~58% | ≤60% |
271-
| **Per-language overall** | **~52-55%** | **≤55%** |
313+
| Code2NL/NL2Code | 46.4% | 44.4% |
314+
| Code Purpose | 54.0% | 44.0% |
315+
| Syntax Completion | 52.4% | 50.0% |
316+
| Pattern Matching | 51.6% | 50.8% |
317+
| API Usage | 55.6% | 51.2% |
318+
| Low Context | 58.0% | 54.8% |
319+
| **Overall** | **53.0%** | **49.2%** |
272320

273321
### Multi-language overall target:
274322

275323
The benchmark has 6 languages × 6 categories = 36 cells. The OVERALL target across all 1,800 tasks is **≤55% for GPT-5.5**.
276324

277-
Each language should independently meet ≤55% overall. Use the same per-category targets as Python. However, allow flexibility:
278-
- If a category naturally scores below target on the initial eval (like Python's Syntax Completion at 52.4%), skip Codex mutation — it's already hard enough.
279-
- Some languages may be naturally harder (TypeScript was 20-30% lower in the original paper). The initial eval will reveal this — don't over-harden a category that's already below target.
280-
- The key constraint is: **no single language should have overall GPT-5.5 Pass@1 above 55%**.
325+
Each language should independently meet ≤55% overall. However, allow flexibility:
326+
- If a category naturally scores below target on the initial eval, skip Codex mutation — it's already hard enough
327+
- Some languages may be naturally harder (TypeScript was 20-30% lower in the original paper). The initial eval will reveal this
328+
- The key constraint is: **no single language should have overall GPT-5.5 Pass@1 above 55%**
281329

282330
### What Python achieved (reference for other languages):
283331

@@ -385,6 +433,18 @@ When merging completions, ensure the CHANGED tasks use the HARDENED task definit
385433
### Bug 6: Batch mutations don't work
386434
We batch-mutated 15 tasks and only 3 had any effect. GPT-5.5 reads the suffix and adapts to parameter changes. **Always use sequential, one-at-a-time mutations** with the failure-preserving approach.
387435
436+
### Bug 7 (JS): Not reading Python examples before creating tasks
437+
Sub-agents created tasks without seeing how Python hardened tasks were structured for that category. This led to wrong line counts (Low Context tasks too long) and missing failure mechanisms. **Always read 3-5 Python hardened tasks for the same category before launching sub-agents.**
438+
439+
### Bug 8 (JS): Not launching evals immediately
440+
After assembling a category, waited for other categories before starting the eval. Wasted time. **Launch GPT-5.5 eval in background IMMEDIATELY after assembling and validating a category.**
441+
442+
### Bug 9 (JS): Using generous stop points
443+
Used Python's generous stop points (≤58%, ≤60%) initially, then had to send follow-up messages to Codex to lower them. **Set aggressive stop points from the start** based on the paper's cross-language difficulty data and Python/JS achieved scores.
444+
445+
### Bug 10 (JS): Node.js not found in subprocess
446+
Node.js is loaded via nvm shell functions, so `subprocess.run(["node", ...])` fails with FileNotFoundError. **Use full path**: `~/.nvm/versions/node/v24.12.0/bin/node` or discover it via `_find_node()` in eval_poc.py.
447+
388448
## GPT-5.5 API Notes
389449
390450
- Model: `gpt-5.5-2026-04-23`

0 commit comments

Comments
 (0)