Divergent Copy Check — Did Copies of the Same Code Drift Apart?
DevMeth checks the 48 known AI-code failure patterns — not a penetration test or a security guarantee.
What the issue is
Two blocks of code that began as one copy no longer agree: they share a clear prefix and then differ. That is how a fix lands in one place and stays out of the other — the same logic now behaves differently depending on where it runs.
Why AI tools generate it
An agent iterating on a problem often copies the working answer and modifies the copy for the next prompt, never updating the original. Each subsequent change to one copy deepens a divergence the agent never notices.
How DevMeth detects it
The scan hashes normalized line windows, groups blocks sharing a 6-line prefix, and flags pairs whose post-prefix tails differ. Blocks that remain identical to the end are routed to the duplication check instead.
Two blocks that started identical have silently drifted apart — one copy changed, the other did not
WHAT WE FOUND
lib/fetch-wrapper-a.ts — same 6-line opening — the fix landed in only one copy
The fix, in three steps
Diff each pair, reconcile or deduplicate it, and state any genuinely intentional difference in a comment. Both members of the pair get fixed together — never just one.
Run a free scan and each finding carries a paste-ready fix prompt you can act on.
Maintainability findings ship in the Rescue Report — bundled with the Launch Pack or available on its own.
Try a free scanFAQ
How is this different from plain duplication?
Plain duplication keeps the copies identical; divergent copies started identical and then changed in only some places. That is the dangerous kind, because a fix applied once silently never reaches the other copy.
Are there cases where divergent copies are fine?
Yes, when the two blocks deliberately implement different behaviors — but then the difference should be visible: distinct names and a comment saying so. The scan only flags divergences that look accidental.
What happens if I fix only one copy?
The finding persists. The scanner still sees two blocks sharing a prefix that disagree, which is exactly the state that caused the drift in the first place.
DevMeth checks the 48 known AI-code failure patterns — not a penetration test or a security guarantee. A clear result means each known pattern was checked and found clear or not applicable for your app; it is not a guarantee of security.