fix: 索引正确性、同步收敛与企业隔离通路
线上实测(2025-12-19 启动后未重启的实例):启动后新增的款式搜不到、 改图后旧向量残留、已删款式不移除、搜索阻塞事件循环。 - 索引:去掉 HNSW/墓碑/pickle 映射/双 FAISS 实例,改为进程内单一精确索引, SQLite 为唯一持久化事实源,启动时批量加载 - 存储:新 schema(整数 id、eps_id、关键点只存坐标、特征版本),拒绝旧库 - 同步:重叠窗口 + 键集分页,按状态写入或移除,按内容定时对账, 所有同步入口共用一把互斥锁,重建在后台执行 - 搜索:eps_id 只取自 JWT,召回前按企业过滤;候选特征批量加载并做版本校验; 同分按 id 升序;打分公式与置信度规则不变 - 接口:搜索改同步函数进线程池并限并发,/health 保持协程不占工作线程 设计与验收:saasProject openspec/changes/fix-image-search-index-integrity
Showing
53 changed files
with
243 additions
and
171 deletions
This diff is collapsed.
Click to expand it.
core/faiss_manager.py
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
core/memory_index.py
deleted
100644 → 0
This diff is collapsed.
Click to expand it.
core/vector_index.py
0 → 100644
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
pytest.ini
0 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
tests/.tmp/test_old_schema_rejected0/old.db
0 → 100644
No preview for this file type
64.3 KB
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
tests/conftest.py
0 → 100644
tests/reference_feature_extractor.py
0 → 100644
This diff is collapsed.
Click to expand it.
tests/reference_search_engine.py
0 → 100644
This diff is collapsed.
Click to expand it.
tests/test_equivalence.py
0 → 100644
tests/test_integrity.py
0 → 100644
This diff is collapsed.
Click to expand it.
-
Please register or sign in to post a comment