Dashboardopencode-loreTest database isolation and independent…

Test database isolation and independently addressable knowledge fixtures

Category: gotcha
Confidence: 1.00
ID: 01a0a5d8-8c66-7158-ae59-4799ac5a4174
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 1
Source session: 1eG12YcrNV7scAF9Y
Created: 2026-08-26 15:49:06
Updated: 2026-09-15 16:13:47

Cross-Project Recalls

ProjectHitsLast recalled
opencode 1 8d ago

Content

packages/core/test/setup.ts must assign a temporary LORE_DB_PATH; an unset test path should make db() throw rather than risk mutating the real Lore database. After every test, call silenceStderr(false) and invalidateProjectIdCache() so logging and cached mappings cannot leak between cases. Near-identical knowledge() fixtures must each receive an explicit independent crypto.randomUUID() and retain that ID for cleanup. Otherwise production fuzzy dedup may merge fixtures into one logical source, invalidating recall-anchor, transfer, and transaction assertions.

Move to: