Code RoomEnvironment config with type coercion
EasyPrep Room Coding #4639

Environment config with type coercion

Vibe & agenticAlgorithms & data structuresEntry–Mid~12 min

You need a config loader for a Python service that reads settings from environment variables, applies defaults, coerces types (a port is an int, a feature flag is a bool, a timeout is a float), and fails loudly at startup if a required value is missing or malformed. You'll ask an AI agent to write it. Draft the prompt/spec with the constraints, edge cases, and acceptance criteria that make the agent get it right first try. What does a vague prompt ("parse my config from env") miss?

Implement
validate_env_config(env_lines: list[str], specs: list[str]) → list[str]
Examples
in[["PORT=8080","DEBUG=false"],["PORT:int:required","DEBUG:bool:optional"]]out[]
in[["PORT=abc"],["PORT:int:required","TIMEOUT:float:required"]]out["PORT is not a valid int (got 'abc')","TIMEOUT is required but is not set"]
in[["FLAG=maybe"],["FLAG:bool:optional"]]out["FLAG is not a valid bool (got 'maybe')"]
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 12 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.