A public library's catalog system is running slow lookups, and the team tasks its coding agent with identifying inefficient database queries contributing to the slowdown. Which framing best matches the scope of the task assigned to the agent?
Select an answer to reveal the explanation.
Short Explanation
Think of it like calling in a mechanic to find out why the engine's sputtering, not asking them to redesign the car from scratch. A coding agent tasked with diagnosing slow queries should stay in its lane: find the specific queries and execution plans causing the drag, then propose targeted fixes. Jumping straight to a full data-model rewrite or a database migration is a much bigger decision than the diagnostic task it was actually given.
Full Explanation
The mechanism is task-scope matching: diagnosing performance means examining query patterns, execution plans, and index usage to isolate specific inefficient queries, then proposing fixes scoped to that finding, such as adding an index or rewriting a join. That keeps the agent's output actionable and reviewable against the narrow problem it was asked to solve, rather than producing a sprawling change that's hard to evaluate.
Jumping to a full data-model redesign or engine migration conflates a diagnostic finding with an architectural decision, slow queries can have many causes far short of the schema or engine being wrong, and that jump skips the analysis step entirely. Letting the agent independently decommission and replace the production database compounds the scope problem with an operational one, an irreversible infrastructure change made without human review is a governance failure regardless of whether the underlying diagnosis was correct. Rewriting the application's business logic layer misattributes the likely cause, query slowness typically traces to how the queries themselves are structured or indexed, not to unrelated application code, so that fix wouldn't address the reported symptom.
Scope caveat: even a well-scoped query fix should go through the same review and testing as any production change, an agent's diagnosis narrows the search but doesn't replace validation. A concrete check: run the proposed fix's execution plan against production-representative data and confirm the identified query's cost actually drops before deploying it.