Dashboard › opencode-lore › Database schema, vec0, tracing, and con…
01a0a657-a484-77d4-8c18-f324c1e9933fPhysical schema is authoritative for vector reads: resolveReadMode() must inspect it even in transactions; committed vec0 and the connection latch override stale or forged storage_mode metadata, and blob fallback is allowed only when base embedding columns exist. Repartition vec0 rows by exact primary key using DELETE→INSERT in one transaction; keep batch 500, 900-ID scopes, and no-op equal projects, empty scopes, or non-vec0 mode. Normalize schema_version to MIGRATIONS.length. Tool-call upserts target (project_id, session_id, call_id). A fresh db() with LORE_NO_DB_TRACING="1" returns the raw connection and never invokes withDbSpan.