守住 RAG embedding signature migration
This commit is contained in:
@@ -65,6 +65,22 @@ def test_host_health_probe_label_check_accepts_runtime_labels():
|
||||
assert f"'{label}'" in migration
|
||||
|
||||
|
||||
def test_rag_embedding_signature_migration_covers_query_and_learning_tables():
|
||||
migration = (ROOT / "migrations" / "034_add_embedding_signature_to_rag_tables.sql").read_text(encoding="utf-8")
|
||||
|
||||
expected_snippets = [
|
||||
"ALTER TABLE IF EXISTS rag_query_log",
|
||||
"ADD COLUMN IF NOT EXISTS embedding_signature VARCHAR(64)",
|
||||
"idx_rag_query_log_embedding_signature",
|
||||
"WHERE query_embedding IS NOT NULL AND embedding_signature IS NOT NULL",
|
||||
"ALTER TABLE IF EXISTS learning_episodes",
|
||||
"idx_le_embedding_signature",
|
||||
"WHERE embedding IS NOT NULL AND embedding_signature IS NOT NULL",
|
||||
]
|
||||
for snippet in expected_snippets:
|
||||
assert snippet in migration
|
||||
|
||||
|
||||
def test_legacy_zero_byte_database_decoys_do_not_return():
|
||||
for filename in ["momo.db", "momo_data.db", "momo_database.db"]:
|
||||
assert not (ROOT / "database" / filename).exists()
|
||||
|
||||
Reference in New Issue
Block a user