evals / debt-migration
migrate-order
Expected
Hidden from the reviewer, like the grading note below.
- legacy-fetch-strict
- holds
order() now takes a Client and calls client.get. order_items keeps its existing legacy_client.fetch call unchanged. The change removes one call and adds none, so the contract holds for it.
Change
app/orders.py
-2+3
12344556789from app import legacy_clientfrom app.api import Client
def order(order_id: str) -> dict: return legacy_client.fetch(f"/orders/{order_id}")def order(client: Client, order_id: str) -> dict: return client.get(f"/orders/{order_id}")
def order_items(order_id: str) -> list:Contracts
legacy-fetch-strict
---
name: legacy-fetch-strict
message: Use api.Client.get instead of the deprecated legacy_client.fetch.
---
## Rules
This contract governs Python source under `app/`.
Do not call `legacy_client.fetch`. Call `api.Client.get` instead.