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. An event listener is registered inside a factory function each time the factory is called, but removeEventListener is never called; after many factory calls the same event fires dozens of stacked handlers causing memory growth and duplicate side effects. Identify the listener leak and fix it.
{
"metrics": {
"repro": {
"checks": [
{
"contains": [
"addEventListener"
]
},
{
"contains": [
"factory"
]
},
{
"contains": [
"duplicate"
]
},
{
"contains": [
"memory"
]
}
]
},
"hidden": {
"checks": [
{
"contains": [
"removeEventListener"
]
},
{
"contains": [
"cleanup"
]
},
{
"contains": [
"AbortController"
]
}
]
},
"diagnose": {
"checks": [
{
"contains": [
"listener leak"
]
},
{
"contains": [
"never removed"
]
},
{
"contains": [
"stacked handlers"
]
}
]
}
}
}temperature
0
max_tokens
420
timeout (s)
120
type
scored
file
debug-event-listener-leak-v2.json