Spec a Rust config loader with useful errors
Your task
Your Rust CLI tool reads its settings from config.yaml. Users keep filing bugs like "my timeout setting does nothing", and a broken file makes the tool panic with an unreadable message. An agent will rewrite the loader: parse the file, check it, apply defaults and report errors.
Write the spec you would hand the agent.
What you know:
- Rust 2021, with
serdeandserde_yamlalready dependencies server.hostis required, andserver.portdefaults to 8080timeout_secsdefaults to 30 and must be 1 to 300, andretriesdefaults to 3regionis a short lowercase code such asus,deorno
Then, in a few sentences: what does a vague "parse the YAML config" prompt get wrong here?