docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
{
"context": "This criteria evaluates an engineer's ability to use koa-route's regex-based path constraints feature to create selective routes that match specific patterns. The focus is on proper usage of the `:param(regex)` syntax to constrain path parameters to specific values or patterns.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Admin exact match",
"description": "Uses `route.get()` with path pattern `/:username(admin)` or equivalent regex to match exactly 'admin'",
"max_score": 25
},
{
"name": "Power user pattern",
"description": "Uses `route.get()` with path pattern `/:username(power.*)` or similar regex to match usernames starting with 'power'",
"max_score": 25
},
{
"name": "Numeric ID constraint",
"description": "Uses `route.get()` with path pattern `/:userId(\\d+)` or equivalent regex to match only numeric values",
"max_score": 25
},
{
"name": "Fallback unconstrained route",
"description": "Uses `route.get()` with path pattern `/:username` (without regex constraint) to catch all other usernames",
"max_score": 15
},
{
"name": "Parameter extraction",
"description": "Correctly extracts and uses the matched parameters in route handlers (e.g., `(ctx, username) => {}` or `(ctx, userId) => {}`)",
"max_score": 10
}
]
}