Urgent.News

What's breaking now, across hundreds of outlets.

AI

AI Coding Tip 042 - Reject Any Vibe-coded Diff That Goes Beyond the Spec

Reject any vibe-coded diff that goes beyond the spec, and move the extras to their own case.

AI Coding Tip 042 - Reject Any Vibe-coded Diff That Goes Beyond the Spec

When an AI is tasked with one specific change, but it ends up making fourteen, the result can be chaos. The reviewer receives a diff full of unnecessary alterations, making it difficult to identify the requested modification. This practice, known as vibe coding, lacks the necessary oversight and control, leading to numerous problems.

A reviewer cannot distinguish between the intended change and the extras, creating a large pull request with defects that have no associated spec or ticket. The cleanup and behavior changes blend together, obscuring regressions and making it hard to revert the requested change without losing the extras. The spec loses its role as the source of truth, as the code performs actions that were not documented.

To prevent this, it is crucial to write the change down before prompting the AI, including the case description, intention, ticket, or spec. The scope should be clearly listed, and the AI should be restricted to using only the necessary files, following the principle of least privilege. The AI should be instructed to plan first and list the files it will touch, which should then be compared with the scope.

The diff should be sent to an adversarial reviewer, who should map every changed hunk to a numbered requirement and flag any hunk it cannot map.

The reviewer should also examine the tests impacted by the diff, as a test change with no corresponding spec requirement is considered out of scope. If any hunk is found to be out of scope, the pull request should be rejected. This approach ensures that only changes requested in the spec are implemented, making the code more manageable, easier to review, and reducing the risk of unintended consequences.

Rewritten by urgent.news; may contain errors โ€” check the original.

Source: hackernoon.com

Read the original at hackernoon.com โ†’

More from HackerNoon on urgent.news

Report a problem with this story

Get the day's news by email. Daily, weekly or monthly. Sign up

More in AI

More from Monday, 23 November 2026 โ†’