Skip to content

< all problems82 · Level 05, Agents

Repair: Inverness is charged the mainland rate

hard · repair session · Agents

Highland postcodes are quoted at the mainland rate.

Warehouse staff noticed that a parcel to IV2 3AB, which is Inverness, comes out at the mainland price:

$ python -m cli "IV2 3AB" 1 small
mainland: £4.27 (incl. fuel)

The carriers charge us the remote rate for everything in the Highlands and islands, so each of these loses money, and Inverness is one of our busiest destinations. Postcodes in HS, KW and ZE price correctly. Only the IV ones, and apparently some others nearby, come out as mainland. The repo's own tests fail on this.

The zone rules are the carriers' contract, not ours. docs/zones.md names the zones and the whole-area rules; the district schedule for the part-highland areas (IV, PH, PA, KA) is appendix B of docs/carrier-contract.md, and it has exceptions: several districts in those areas take mainland rates, and the Elgin depot alone ships three hundred parcels a week. The code has to match the documents.

One more thing about this agent: its context window is small. It can hold about four files alongside its instructions, and when the conversation outgrows the window it forgets what it read first. A prompt that sends it straight to the right file and the right document gets the work done inside the window; a prompt that sends it on a tour of the repo does not.

Done when

  • IV2 3AB and the rest of the Highlands and islands are quoted in the highlands zone.
  • Every rule in docs/zones.md and appendix B of docs/carrier-contract.md holds, including the districts that take mainland rates.
  • Postcodes typed in lower case or without a space are zoned the same as their tidy form.
  • The repo's tests pass, and no file under tests/ was changed.

You have a coding agent with tools to list, read and edit files and run the tests. It has been given the report above, and nothing else: not the README, not what "done" means. Prompt it. It is graded on the repo it leaves behind: the repo's tests, hidden ones, and whether it left tests/ alone, and ranked on model calls.