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. A controller has nested if statements checking role, ownership, and feature flags before every action. Refactor the guards for clarity.
{
"metrics": {
"intent": {
"checks": [
{
"contains": [
"nested if"
]
},
{
"contains": [
"guard clauses"
]
},
{
"contains": [
"permissions"
]
}
]
},
"visible": {
"checks": [
{
"contains": [
"role"
]
},
{
"contains": [
"ownership"
]
},
{
"contains": [
"feature flags"
]
}
]
},
"hidden": {
"checks": [
{
"contains": [
"same authorization"
]
},
{
"contains": [
"negative tests"
]
},
{
"contains": [
"clarity"
]
}
]
}
}
}temperature
0
max_tokens
500
timeout (s)
120
type
scored
file
refactor-permission-guards.json