Test fixture
Code transformation while preserving behavior and intent.
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 plan, refactor, tests. Several async route handlers repeat try/catch blocks that map errors into the same JSON envelope. Refactor to a wrapper while preserving status codes.
{
"metrics": {
"intent": {
"checks": [
{
"contains": [
"try/catch"
]
},
{
"contains": [
"wrapper"
]
},
{
"contains": [
"JSON envelope"
]
}
]
},
"visible": {
"checks": [
{
"contains": [
"async route handlers"
]
},
{
"contains": [
"status codes"
]
},
{
"contains": [
"error mapping"
]
}
]
},
"hidden": {
"checks": [
{
"contains": [
"preserve status"
]
},
{
"contains": [
"tests"
]
},
{
"contains": [
"same response shape"
]
}
]
}
}
}temperature
0
max_tokens
500
timeout (s)
120
type
scored
file
refactor-error-handling-wrapper.json