Test fixture
Bug fixes, edge conditions, and minimal patch accuracy.
The model receives the prompt (and optional system message). The run uses scorer rubric_json_metrics with the JSON configuration below. Pass/fail and partial credit are determined entirely by that scorer against the model output; no human grading.
Return JSON only with keys diagnosis, fix, tests. A React-style state setter references the captured state variable directly inside an event handler; under rapid sequential updates the closure holds a stale value and increments are lost. Identify the stale closure bug and fix it.
{
"metrics": {
"repro": {
"checks": [
{
"contains": [
"stale"
]
},
{
"contains": [
"closure"
]
},
{
"contains": [
"rapid"
]
},
{
"contains": [
"lost"
]
}
]
},
"hidden": {
"checks": [
{
"contains": [
"functional updater"
]
},
{
"contains": [
"prev =>"
]
},
{
"contains": [
"prevState"
]
}
]
},
"diagnose": {
"checks": [
{
"contains": [
"stale closure"
]
},
{
"contains": [
"captured value"
]
},
{
"contains": [
"functional update"
]
}
]
}
}
}temperature
0
max_tokens
420
timeout (s)
120
type
scored
file
debug-setstate-stale-closure-v2.json