test(intake): 补充实体归并/chunk去重/检索退化测试缺口(2026-07-10 缺口分析)#20
Open
HeDaas-Code wants to merge 1 commit into
Open
Conversation
补齐 commit 972d563(修复 16 个 GitHub issue)中新增但无测试覆盖的逻辑: - chunker.dedup_chunks/_cosine_sim/_sha256_hex(Issue #18.a): 精确匹配(None/HashEmbeddings) / 真嵌入阈值 / embedder 失败降级 三条路径 - entity_resolver(Issue #17,新文件):levenshtein/jaro/jaro_winkler/ strings_similar 纯算法 + resolve_entities 三重信号融合(≥2合并/1待确认/0跳过) - index_store.search HashEmbeddings→SQLite LIKE 退化(Issue #12)+ merge_characters 边界与别名传播 全部确定性、离线(HashEmbeddings + SQLite 临时目录)、无 LLM 依赖。 验证:新增 28 测试 + 原有 50 = 78 passed,smoke 11/11,3 次重跑无不稳定。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
自动化测试缺口分析工具 2026-07-10 运行结果。commit
972d563(fix(issues): 修复 16 个 GitHub issue P1+P2+P3)修改了 24 个生产文件(+2997/-544)但未同步任何测试,后续0ec5dd8仅补了 eval/pipeline/interview/oc_writer,核心 intake 逻辑仍无覆盖。本 PR 补齐三处高优先级缺口(均为新增逻辑路径、零测试覆盖):
tests/test_chunker_gaps.pychunker.dedup_chunks/_cosine_sim/_sha256_hextests/test_entity_resolver_gaps.pyentity_resolver字符串相似度算法 +resolve_entities三重信号融合tests/test_index_store_gaps.pysearchHashEmbeddings→SQLite LIKE 退化 +merge_characters验证
所有测试确定性、隔离(
tempfile临时目录)、离线(HashEmbeddings+ SQLite,无 LLM/Chroma 依赖),遵循项目现有 pytesttest_*风格。为何降低回归风险
levenshtein/jaro/jaro_winkler是归并判定的基础算法,实现错误会导致同一人物被错误合并或遗漏合并——直接污染人格蒸馏语料。dedup_chunks三条路径(精确/真嵌入/失败降级)锁定了 NER 前去重的行为契约,防止重复 chunk 浪费 LLM 调用或误删。search的 LIKE 退化是离线/单测场景的兜底,失效会返回空或随机结果,掩盖真实检索缺陷。merge_characters边界与别名传播保证实体归并的数据完整性。