use std::sync::{Mutex, OnceLock};
pub fn env_lock() -> &'static Mutex<()> {
static LOCK: OnceLock<Mutex<()>> = OnceLock::new();
LOCK.get_or_init(|| Mutex::new(()))
}
pub fn create_test_db() -> crate::spec_ai_config::persistence::Persistence {
use tempfile::tempdir;
let dir = tempdir().unwrap();
let db_path = dir.path().join("test.duckdb");
std::mem::forget(dir);
crate::spec_ai_config::persistence::Persistence::new(&db_path).unwrap()
}