Code RoomConvention violations in generated code
MediumPrep Room Coding #4198

Convention violations in generated code

Vibe & agenticCode quality & reviewMid–Senior~16 min

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?

Implement
check_house_conventions(method_lines: list[str]) → list[str]
Examples
in[[" 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"]
in[[" @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[]
What a strong answer looks like

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.

0:00 of about 16 min

Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.

Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.