At most one ORM in active use
Why it matters
Two ORMs pointed at the same database produce split-brain writes: Prisma and Drizzle cache query results differently, generate non-equivalent SQL for identical model intent, and maintain independent connection pools that break transaction isolation. Concurrent writes through both clients can bypass each other's query-level constraints and leave rows in states neither ORM expected, corrupting production data and making debugging nearly impossible because neither stack trace sees the whole picture.
Severity rationale
Critical because split-brain data layers silently corrupt production rows and create debugging dead ends that cost days to untangle.
Remediation
Pick one ORM and migrate every file off the other. Inventory the damage first with grep -rl "from '@prisma/client'" src/ and grep -rl "from 'drizzle-orm'" src/, then port the smaller side to the survivor. Once imports are zero, run npm uninstall drizzle-orm drizzle-kit (or the Prisma equivalent). If you genuinely need two databases, isolate each ORM to its own connection file like src/db/legacy-pg.ts and document the boundary so no future commit crosses it.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Multi-Session Drift Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ai-slop-code-drift·automated
- 2026-04-20·v1.1.0·Add Phase 6.0 detect-rg snippet for deterministic ORM import detection·by cakleinman