Categories//view/The Confident Refactor

The Confident Refactor

intermediate9 min100 pts

A developer used AI to refactor a legacy permissions module that has been in production for years. The original code is left as a comment at the bottom. The PR description says:

Cleaned up the permissions module with AI. Same logic, just more readable. The old code is left as a comment for reference - we can delete it after merge.

What you're being evaluated on

Behavioral differences - The PR claims no behavior changes. Every silent change is a potential production incident.
Lost business logic - Comments and code that look like clutter may encode real requirements.
Type safety regression - New types that look cleaner but are actually more permissive.

3 hints available (using hints reduces your score)

About this scenario

An AI refactored a 5-year-old permissions module and the PR claims improved readability with no behavior changes. Comparing old and new shows null checks removed, every field made optional, admin checks reordered, and errors silently swallowed instead of thrown. Practice auditing AI refactors for hidden behavior changes in security-critical code.

intermediate · 100 points · 9 min · AI Code Review

What you will practice

Play the full scenario above for free. More AI Code Review scenarios · Create a free account to save your progress.