Convention violations in generated code
An AI agent added a new service method to a large Java codebase. It works, tests pass. But your team has strong conventions: errors flow through a `Result<T>` type (never exceptions across service boundaries), all external calls go through a `@Resilient` wrapper, and logging uses structured `log.atInfo().with(...)`. The agent's new method throws raw exceptions, calls the HTTP client directly, and uses `System.out.println`. How do you efficiently verify a generated method conforms to house conventions, and why does this matter beyond style?
check_house_conventions(method_lines: list[str]) → list[str][[" static UserDto fetchUser(long id) throws IOException {"," var resp = httpClient.get(\"/users/\" + id);"," if (resp.status() != 200) throw new IllegalStateException(\"bad status\");"," System.out.println(\"fetched \" + id);"," return UserDto.from(resp);"," }"]]out["no_result_type","throws_across_boundary","unresilient_external_call","unstructured_logging"][[" @Resilient(timeout = \"2s\")"," static Result<UserDto> fetchUser(long id) {"," var resp = httpClient.get(\"/users/\" + id);"," if (resp.status() != 200) return Result.failure(\"bad status\");"," log.atInfo().with(\"user_id\", id).log(\"fetched\");"," return Result.success(UserDto.from(resp));"," }"]]out[]Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.