20 Apr, 2026
1 commit
-
变更清单 修复(6 处漂移用例,全部更新到最新实现) - `tests/test_eval_metrics.py` — 整体重写为新的 4 级 label + 级联公式断言,放弃旧的 `RELEVANCE_EXACT/HIGH/LOW/IRRELEVANT` 和硬编码 ERR 值。 - `tests/test_embedding_service_priority.py` — 补齐 `_TextDispatchTask(user_id=...)` 新必填位。 - `tests/test_embedding_pipeline.py` — cache-hit 路径的 `np.allclose` 改用 `np.asarray(..., dtype=float32)` 避开 object-dtype。 - `tests/test_es_query_builder_text_recall_languages.py` — keywords 次 combined_fields 的期望值对齐现行值(`MSM 60% / boost 0.8`)并重命名。 - `tests/test_product_enrich_partial_mode.py` - `test_create_prompt_supports_taxonomy_analysis_kind`:去掉错误假设(fr 不属于任何 taxonomy schema),明确 `(None, None, None)` sentinel 的契约。 - `test_build_index_content_fields_non_apparel_taxonomy_returns_en_only`:fake 模拟真实 schema 行为(unsupported lang 返回空列表),删除"zh 未被调用"的过时断言。 清理历史过渡物(per 开发原则:不保留内部双轨) - 删除 `tests/test_keywords_query.py`(已被 `query/keyword_extractor.py` 生产实现取代的早期原型)。 - `tests/test_facet_api.py` / `tests/test_cnclip_service.py` 移动到 `tests/manual/`,更新 `tests/manual/README.md` 说明分工。 - 重写 `tests/conftest.py`:仅保留 `sys.path` 注入,删除全库无人引用的 `sample_search_config / mock_es_client / test_searcher / temp_config_file` 等 fixture。 - 删除 `tests/test_suggestions.py` 中 13 处残留 `@pytest.mark.unit` 装饰器(模块级 `pytestmark` 已覆盖)。 新建一致性基础设施 - `pytest.ini`:权威配置源。`testpaths = tests`、`norecursedirs = tests/manual`、`--strict-markers`、登记所有子系统 marker + `regression` marker。 - `tests/ci/test_service_api_contracts.py` + 30 个 `tests/test_*.py` 批量贴上 `pytestmark = [pytest.mark.<subsystem>, pytest.mark.regression]`(AST 安全插入,避开多行 import)。 - `scripts/run_regression_tests.sh` 新建,支持 `SUBSYSTEM=<name>` 选子集。 - `scripts/run_ci_tests.sh` 扩容:由原先的 `tests/ci -q` 改为 `contract` marker + `search ∧ regression` 双阶段。 文档统一(删除历史双轨) - 重写 `docs/测试Pipeline说明.md`:删除 `tests/unit/` / `tests/integration/` / `scripts/start_test_environment.sh` 等早已不存在的引用,给出目录约定、marker 表、回归锚点矩阵、覆盖缺口清单、联调脚本用法。 - 删除 `docs/测试回归钩子梳理-2026-04-20.md`(内容已合并进上面一份权威文档,按"一处真相"原则下掉)。 - `docs/DEVELOPER_GUIDE.md §8.2 测试` 改写,指向 pipeline 权威文档。 - `CLAUDE.md` 的 `Testing` 与 `Testing Infrastructure` 两节同步更新。 最终状态 | 指标 | 结果 | |------|------| | 全量 `pytest tests/` | **241 passed** | | `./scripts/run_ci_tests.sh` | 45 passed | | `./scripts/run_regression_tests.sh` | 233 passed | | 子系统子集(示例) | search=45 / rerank=35 / embedding=23 / intent=25 / translation=33 / indexer=17 / suggestion=13 / query=6 / eval=8 / contract=34 | | 未清零的已知缺口 | 见新版 `测试Pipeline说明.md §4`(function_score / facet / image search / config loader / document_transformer 等 6 条) | Pipeline 文档里 §4 的覆盖缺口我没有强行补测用例——那属于"新增覆盖",不是这次清理的范畴;只要后续谁补,把对应 marker 贴上去、从清单里划掉即可。
17 Apr, 2026
2 commits
-
2. eval framework: record request_id and response body when LLM calls fail — clients.py: added request ID extraction and error description functions
-
【方案落地】 - 配置层:在 config/config.yaml 中注册 core_queries(原53条)和 clothing_top771(771条) 核心改动:config/schema.py (line 410) 增加 EvaluationDataset 模型; config/loader.py (line 304) 提供 get_dataset/list_datasets,兼容旧配置; 新增 scripts/evaluation/eval_framework/datasets.py 作为 dataset registry 辅助模块 - 存储与框架:所有 artifact 按 dataset_id 隔离,标注缓存跨数据集共享 核心改动:store.py (line 1) 增加 dataset_id 字段到 build_runs/batch_runs; framework.py (line 1) build/batch_evaluate 接受 dataset_id 并固化 snapshot - CLI 与调参:所有子命令增加 --dataset-id 参数 核心改动:cli.py (line 1)、tune_fusion.py (line 1) 及启动脚本 - Web 与前端:支持动态切换评估集,History 按 dataset 过滤 核心改动:web_app.py (line 1) 新增 /api/datasets,/api/history 支持 dataset_id; static/index.html 和 eval_web.js (line 1) 增加下拉选择器 【验证与测试】 - 新增 tests/test_search_evaluation_datasets.py,pytest 通过 2 passed - 编译检查通过(pyflakes/mypy 核心模块) - eval-web 已按新模型重启并通过健康检查(后续因资源占用不稳定,不影响标注) 【LLM 标注运行状态】 - 目标 dataset:clothing_top771(771条query) - 手动拉起 reranker(因 search.rerank.enabled=false),确认 /health 正常 - 执行 rebuild --dataset-id clothing_top771,当前已进入第1个 query "白色oversized T-shirt" 的批量标注阶段(llm_batch=24/40) - 日志:logs/eval.log(主进度),logs/verbose/eval_verbose.log(详细 LLM I/O)
16 Apr, 2026
3 commits
-
1)接口层 translator_app.py 支持并发调用翻译后端(http接口 /translate 处理函数 调用results = _translate_batch 改为 results = await _run_translation_blocking) 2)translation/backends/llm.py 支持batch翻译 2. 缓存清理脚本: scripts/redis/purge_caches.py 删除 embedding_prefix:*、embed:*、anchor_prefix:*,以及 trans:* 但会跳过 trans:deepl* 1)dry run方法: source activate.sh && python scripts/redis/purge_caches.py --dry-run 2)真正的清空缓存:python scripts/redis/purge_caches.py
14 Apr, 2026
3 commits
-
2. +service_enabled_by_config() { reranker|reranker-fine|translator 如果被关闭,则run.sh all 不启动该服务
09 Apr, 2026
2 commits
-
- 数据转换放到 scripts/data_import/README.md - 诊断巡检放到 scripts/inspect/README.md - 运维辅助放到 scripts/ops/README.md - 前端辅助服务放到 scripts/frontend/frontend_server.py - 翻译模型下载放到 scripts/translation/download_translation_models.py - 临时图片补 embedding 脚本收敛成 scripts/maintenance/embed_tenant_image_urls.py - Redis 监控脚本并入 redis/,现在是 scripts/redis/monitor_eviction.py 同时我把真实调用链都改到了新位置: - scripts/start_frontend.sh - scripts/start_cnclip_service.sh - scripts/service_ctl.sh - scripts/setup_translator_venv.sh - scripts/README.md 文档里涉及这些脚本的路径也同步修了,主要是 docs/QUICKSTART.md 和 translation/README.md。 -
问题背景: - scripts/ 目录下混有服务启动、数据转换、性能压测、临时脚本及历史备份目录 - 存在大量中间迭代遗留信息,不利于维护和新人理解 - 现行服务编排已稳定为 service_ctl up all 的集合:tei / cnclip / embedding / embedding-image / translator / reranker / backend / indexer / frontend / eval-web,不再保留 reranker-fine 默认位 调整内容: 1. 根 scripts/ 收敛为运行、运维、环境、数据处理脚本,并新增 scripts/README.md 说明文档 2. 性能/压测/调参脚本整体迁至 benchmarks/ 目录,同步更新 benchmarks/README.md 3. 人工试跑脚本迁至 tests/manual/ 目录,同步更新 tests/manual/README.md 4. 删除明确过时内容: - scripts/indexer__old_2025_11/ - scripts/start.sh - scripts/install_server_deps.sh 5. 同步修正以下文档中的路径及过时描述: - 根目录 README.md - 性能报告相关文档 - reranker/translation 模块文档 技术细节: - 性能测试不放常规 tests/ 的原因:这类脚本依赖真实服务、GPU、模型和环境噪声,不适合作为稳定回归门禁;benchmarks/ 更贴合其定位 - tests/manual/ 仅存放需要人工启动依赖、手工观察结果的接口试跑脚本 - 所有迁移后的 Python 脚本已通过 py_compile 语法校验 - 所有迁移后的 Shell 脚本已通过 bash -n 语法校验 校验结果: - py_compile: 通过 - bash -n: 通过
08 Apr, 2026
2 commits
07 Apr, 2026
3 commits
-
- consolidate suggestion rebuild flow into build_suggestions.sh via --rebuild and remove the redundant rebuild_suggestions.sh wrapper - make suggestion versioned index names use microseconds and handle index-create retries/timeouts without false already_exists failures - treat create requests as successful when the index was created server-side, then explicitly wait for shard readiness and surface allocation diagnostics - clean up freshly created suggestion indices on rebuild failure to avoid leaving red orphan indices behind - make rebuild smoke tests target the local backend by default, with SUGGESTIONS_SMOKE_BASE_URL as the explicit override - add unit coverage for microsecond versioned index names and cleanup on unallocatable index failures
-
2. issues文档
04 Apr, 2026
2 commits
-
Exact Match High Relevant Low Relevant Irrelevant to Fully Relevant Mostly Relevant Weakly Relevant Irrelevant
03 Apr, 2026
1 commit
02 Apr, 2026
4 commits
-
目前在54训练数据里面,拆分44条train + 10 test,训练集显著提升但是test上不及基线 作为基础设施保留,以后可以考虑扩大数据集进行使用
01 Apr, 2026
16 commits
-
Irrelevant
-
现在的行为(按你的路径) 用途 路径(相对仓库根 PROJECT_ROOT) 评估主日志(CLI + framework 的 INFO) logs/eval.log LLM 全量 prompt / 原始响应 logs/verbose/eval_verbose.log 实现要点: constants.py:EVAL_LOG_DIR、EVAL_VERBOSE_LOG_DIR、EVAL_LOG_FILE、EVAL_VERBOSE_LOG_FILE。 logging_setup.py:setup_eval_logging() 给名为 search_eval 的 logger 挂 文件 + stderr,只初始化一次;build_annotation_set.py / serve_eval_web.py 走的 eval_framework.cli.main() 开头会先调用。 cli.py:原来的 print 改为 search_eval.cli 的 logging.info;启动时写一条 CLI start command=... log_file=... 到 logs/eval.log。 framework.py:rebuild 相关 print 改为 search_eval.framework 的 logging.info。 clients.py:verbose 改为写入 logs/verbose/eval_verbose.log;首次需要时调用 setup_eval_logging(),并用 search_eval.info 提示 verbose 文件路径(不再用 print)。
-
scripts/evaluation/eval_framework/constants.py:500 → 200 Rebuild 里 rank <= recall_n 的 rerank_score: 1.0 仍按该 K 生效。 2. LLM 批次上下限 最少批次:DEFAULT_REBUILD_MIN_LLM_BATCHES 20 → 10 最多批次:仍为 40(未改) 3. 提前结束条件(_annotate_rebuild_batches) 在已跑满 min_batches 之后,对每个批次: 本批无 Exact(exact_n == 0),且满足其一即视为 bad batch: irrelevant_ratio >= 0.94 或 (irrelevant + Low Relevant) / n >= 0.96(弱相关用 RELEVANCE_LOW) 连续 2 个 bad batch 则 early stop(原先是连续 3 次、irrelevant > 0.92)。 批次日志里增加了 low_ratio、irrelevant_plus_low_ratio;rebuild 元数据里增加了 rebuild_irrel_low_combined_stop_ratio。 4. CLI --search-recall-top-k 说明改为默认 200 --rebuild-min-batches 说明改为默认 10 --rebuild-irrelevant-stop-ratio / --rebuild-irrelevant-stop-streak 说明与新逻辑一致 新增 --rebuild-irrel-low-combined-stop-ratio(默认 0.96)
31 Mar, 2026
1 commit