AI coding exercises
A task brief
Use a fictional support search endpoint as a practice task. The defect is that a blank query returns every record. State the desired response to a blank query, keep the existing behavior for ordinary searches and limit the proposed repair to the search handler and its tests.
A useful prompt also names what the agent may inspect. Provide the handler and a small synthetic fixture; withhold customer exports and production configuration. Ask for the cause, the proposed change and the results of the relevant checks.
A response to challenge
Suppose the assistant suggests deleting the blank-query test because the endpoint “works as intended.” Compare that reply with the acceptance condition. The task requires a defined response to blank input, so removing the test leaves the requirement unverified.
These exercises use prepared replies. Your decision, instruction or selected evidence is checked against the scenario. The assistant does not produce arbitrary live code. Continue with acceptance checks and repository context to make the brief precise.