mirror of
https://github.com/proffesor-for-testing/agentic-qe.git
synced 2026-09-19 08:45:47 +08:00
9df4dd2758
Root cause: 40+ places opened memory.db with `new Database()` without WAL mode or busy_timeout. When 10 Claude Code hooks spawn separate processes that concurrently write to the DB, rollback journal mode causes page-level corruption. Fix: Created v3/src/shared/safe-db.ts with openDatabase() that enforces WAL + busy_timeout=5000 on every open. Replaced all 28 direct new Database() calls across v3/src (22 files), hooks (1 file), helpers (2 files), and scripts (2 files). Only remaining direct call is the UnifiedMemoryManager singleton which already sets WAL + busy_timeout itself. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>