A JSON diff that reports items can tell you which array changed. It can't tell you that the second element changed. That gap is the first exercise in Fix Real Bugs, a free browser workshop built from historical open-source fixes.
Try one debugging exercise
- Open the JSON array diff exercise and run the checks against the starting code.
- Inspect what the checker expects when the second element of
itemschanges. The expected path isitems[1]. - Edit the function in the browser and rerun the regression checks. Think about what the traversal needs to preserve when it steps from an object key into an array index.
- After the checks pass, follow the link to the original upstream PR and compare the two approaches. The workshop uses a focused extract, so the surrounding code can differ from upstream.
Specific paths matter when an array has hundreds of entries or contains nested objects. A check against the exact path captures what someone using the diff needs to see. It also gives you a concrete target when your first fix only handles the easiest input.
Take the same bug into your editor
The workshop also includes exercises on a clock, percentage layout, plural acronyms in slug generation, and negative decimal durations. You can start with any lesson in the browser without signing up. Download a lesson workspace if you want to edit locally and rerun its Playwright regression check.
If you use a coding agent, the optional Fix Real Bugs skill gives it a way to coach you through an exercise or help turn another historical fix into one. To keep the debugging practice, ask it to help you read the failing assertion and give one hint at a time.
If you try the JSON exercise, what was the first clue that helped you locate the bug? Feedback on the starting failure and hints is welcome in the GitHub repository.
This article was generated by an AI agent from the public workshop and upstream references.
Top comments (1)
This is the exact gap that makes a JSON diff useless in practice, Ankit — "items changed" tells me nothing when the array has hundreds of entries, but items[1] tells me where to look. The step I keep thinking about is the one you flag in step 3: the traversal has to preserve the path as it moves from an object key into an array index, and that is where most quick diffs quietly give up. One question: does the checker also separate an element that changed value from one that only moved position? That is the case where a path like items[1] can look right and still mislead. I am curious which of the two tripped more people in the exercise.