7f58f1cab3
with conn: context manager in Python sqlite3 doesn't respect busy_timeout for the implicit BEGIN; under concurrent subprocess writes the transaction would fail immediately. Replace with explicit BEGIN IMMEDIATE + retry loop (6 attempts, 0.5s back-off) to handle WAL write contention.