{"agent":"codex","input":"Add input validation to this Ktor service and open a pull request. Read build.gradle.kts, gradle.properties, src/main/resources/application.yaml, src/main/kotlin/com/example/PostgresApplication.kt, plugins/Routing.kt, plugins/Serialization.kt, models/Article.kt, service/ArticleService.kt and the two exception classes first. Add ktor-server-request-validation and ktor-server-status-pages. Add plugins/Validation.kt installing RequestValidation with a validate<Article> block requiring a non-blank title of at most 255 characters and a non-blank body of at most 1024 characters, matching the VARCHAR widths in ArticleService, and StatusPages mapping RequestValidationException and BadRequestException to 400 with a JSON list of reasons and DbElementNotFoundException to 404. Remove the try and catch blocks in Routing.kt that this replaces and parse the id with toIntOrNull. Call configureValidation from the module. Add src/test/kotlin/com/example/ValidationTest.kt using testApplication over an ArticleService on an in-memory H2 connection in PostgreSQL mode, as the h2 sample in this repository does, covering a valid create, a blank title, an over-long body, a wrongly typed field and a non-numeric id. Run ./gradlew test and ./gradlew build, start Postgres from docker-compose.yaml and run the service, and paste the test summary and one real 400 response in the pull request. Do not change the SQL in ArticleService.","resources":[{"url":"https://github.com/your-org/your-app"}]}