GAUNTLET (Titan phase 15 audit, rules 7 and 11) flagged two small out-of-scope cleanups in src/db/connection.ts, not addressed by phase 15's commit (scoped narrowly to the openReadonlyWithNative leak-ordering fix + engine-resolution dedup, per sync.json's phase-15 label):
-
Rule 7 (warn): 'busy_timeout = 5000' is hardcoded as a literal pragma string at two call sites (openDb and openReadonlyOrFail). No DEFAULTS entry exists in src/infrastructure/config.ts for it, violating the project convention against hardcoded magic numbers (per CLAUDE.md: "When adding new behavioral constants, always add them to DEFAULTS").
-
Rule 11 remainder (warn): The busy/locked detection regex /\b(busy|locked|SQLITE_BUSY|SQLITE_LOCKED)\b/i is duplicated identically between openRepo's catch block and openReadonlyWithNative's catch block. (Note: the other half of rule 11 — the duplicated engine-resolution block — was already fixed in phase 15 via a new shared resolveDbEngine helper.)
Recommendation: add DEFAULTS.db.busyTimeoutMs (or similar) and wire both pragma call sites to it; extract an isBusyOrLockedError(msg: string): boolean helper shared by both catch blocks.
GAUNTLET (Titan phase 15 audit, rules 7 and 11) flagged two small out-of-scope cleanups in
src/db/connection.ts, not addressed by phase 15's commit (scoped narrowly to the openReadonlyWithNative leak-ordering fix + engine-resolution dedup, per sync.json's phase-15 label):Rule 7 (warn):
'busy_timeout = 5000'is hardcoded as a literal pragma string at two call sites (openDbandopenReadonlyOrFail). NoDEFAULTSentry exists insrc/infrastructure/config.tsfor it, violating the project convention against hardcoded magic numbers (per CLAUDE.md: "When adding new behavioral constants, always add them to DEFAULTS").Rule 11 remainder (warn): The busy/locked detection regex
/\b(busy|locked|SQLITE_BUSY|SQLITE_LOCKED)\b/iis duplicated identically betweenopenRepo's catch block andopenReadonlyWithNative's catch block. (Note: the other half of rule 11 — the duplicated engine-resolution block — was already fixed in phase 15 via a new sharedresolveDbEnginehelper.)Recommendation: add
DEFAULTS.db.busyTimeoutMs(or similar) and wire both pragma call sites to it; extract anisBusyOrLockedError(msg: string): booleanhelper shared by both catch blocks.