Tracing bugs across services
Give Claude Opus 4.7 the logs from each service and the code on the request path, and have it find where the data goes wrong and why. Confirm the cause with a test before you fix it.
Example: Where does the order total change?
Material
- Logs
- checkout: total=19.99 currency=EUR · payments: charge amount=1999 currency=EUR · ledger: amount=1999.00 EUR
- ledger.ts
- record({ amount: event.amount, currency: event.currency })
- payments.ts
- emit('charged', { amount: Math.round(total * 100), currency })
PromptUsing the logs and code, find where the order total changes and explain why.
Sample answer · written by hand to show the reasoning
The total is correct until the ledger. payments.ts converts 19.99 to minor units (1999 cents) before emitting the event, but ledger.ts records event.amount as if it were in euros, so it books 1999.00 EUR. Divide by 100 in the ledger, or better, emit an explicit amount_minor field and convert in one place.