Health check and readiness endpoints for web services — liveness probes,
97
99%
Does it follow best practices?
Impact
94%
3.61xAverage score across 4 eval scenarios
Passed
No known issues
{
"context": "Tests whether the agent proactively adds health check endpoints (/health and /ready) when building an Express API deployed behind a load balancer with a database dependency. The task mentions ALB and ECS but never asks for health checks.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Liveness endpoint exists",
"description": "A GET /health endpoint exists that returns 200 with a JSON body containing a status field (e.g. {\"status\": \"ok\"}). It does NOT check external dependencies like the database.",
"max_score": 15
},
{
"name": "Readiness endpoint exists",
"description": "A GET /ready endpoint exists that checks the database connection (e.g. runs SELECT 1 or db.ping()) and returns 200 when healthy or 503 when the database is unreachable.",
"max_score": 15
},
{
"name": "Readiness returns dependency status",
"description": "The readiness endpoint response includes per-dependency check results (e.g. {\"status\": \"ok\", \"checks\": {\"database\": \"ok\"}}) rather than just a bare 200/503 with no detail.",
"max_score": 12
},
{
"name": "Health endpoints excluded from auth",
"description": "If any authentication or authorization middleware is configured, health check endpoints are excluded from it so monitoring tools can access them without credentials.",
"max_score": 10
},
{
"name": "Dockerfile HEALTHCHECK instruction",
"description": "The Dockerfile includes a HEALTHCHECK instruction that probes the /health endpoint (e.g. HEALTHCHECK CMD curl -f http://localhost:<port>/health || exit 1).",
"max_score": 12
},
{
"name": "Liveness does not check database",
"description": "The /health (liveness) endpoint does NOT perform database queries or check external dependencies. It returns 200 as long as the process is running.",
"max_score": 10
},
{
"name": "503 status for unhealthy readiness",
"description": "When a dependency check fails, the readiness endpoint returns HTTP 503 (Service Unavailable), not 500 or 200.",
"max_score": 8
},
{
"name": "CRUD endpoints functional",
"description": "All four CRUD endpoints (GET list, POST create, PATCH update, DELETE) are implemented and return appropriate success status codes.",
"max_score": 10
},
{
"name": "Database setup present",
"description": "A database module (db.ts or similar) creates the SQLite database and todos table with the specified schema.",
"max_score": 8
}
]
}