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 for-loop uses i <= arr.length as its condition; on the final iteration the index equals arr.length and the access returns undefined, causing a processing error. Identify the off-by-one and fix it.
{
"metrics": {
"repro": {
"checks": [
{
"contains": [
"undefined"
]
},
{
"contains": [
"arr.length"
]
},
{
"contains": [
"last iteration"
]
},
{
"contains": [
"for loop"
]
}
]
},
"hidden": {
"checks": [
{
"contains": [
"< arr.length"
]
},
{
"contains": [
"arr.length - 1"
]
},
{
"contains": [
"boundary"
]
}
]
},
"diagnose": {
"checks": [
{
"contains": [
"off-by-one"
]
},
{
"contains": [
"out of bounds"
]
},
{
"contains": [
"<= arr.length"
]
}
]
}
}
}temperature
0
max_tokens
420
timeout (s)
120
type
scored
file
debug-index-off-by-one-v2.json