Bugs that span several files
Give GPT-5.5 the failing behaviour and every file on the code path, and have it explain where the state goes wrong and propose a fix. Reproduce the bug in a test before you merge.
Example: Why does the cart show an old price?
Material
- price-service.ts
- updatePrice(id, p) { db.save(id, p); events.emit('price-changed', id); }
- cart-cache.ts
- events.on('price-changed', id => cache.delete('product:' + id)); getPrice(id) { return cache.get('price:' + id) ?? db.load(id); }
PromptUsing the code below, explain why customers sometimes see an outdated price and propose the smallest fix.
Sample answer · written by hand to show the reasoning
The cache stores prices under the price: key, but the price-changed handler deletes the product: key, so the old price stays cached until it expires. Delete 'price:' + id in the handler (or both keys if the product: key is also used). Add a test that updates a price and reads it back from the cart.