completeRoutineExecution was reading from the DB outside the per-routine lock then calling recordRun which acquires the lock internally. This allowed concurrent operations on the same routine to hit SQLite simultaneously. Inlined the logic inside a single withRoutineLock call so the read and write are serialized. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>