feat(tesserae): SimHash drift relocation + remove FileIndex code debt (ticket 8) - #21
Merged
Conversation
…ove FileIndex code debt (ticket 8)
wefio
force-pushed
the
feat/tessera-simhash-drift
branch
from
September 3, 2026 15:00
261ca32 to
a8ab086
Compare
11 tasks
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.
变更描述
What(改了什么):
工单 8(tesserae SimHash 漂移容错 + FileIndex 代码退出),前置工单 7 按测量结论关闭。分支含 2 个提交(工单跟踪记录在
repo-development黑板,不入仓库):b7c6226docs:tesserae 设计文档 §3.1/§3.3/§6 记录 SimHash 漂移机制a8ab086feat:工单 8 实现Why(为什么改 / 解决什么问题):
file-index.ts每次搜索仍在爬取。维护成本高、价值已被 tesserae 取代,本次真正移除(含 DSH scope observer、context.filesAPI 面、.nmg-search-scope)。includes——文件小改或移动后 snippet 直接标 stale。SimHash 实测在文档级(5-60 KB)分离度强(近似 Hamming 1-3 vs 无关 ~24),作为漂移指纹补上两级重定位。Changes(关键改动点):
src/core/file-index.ts+ 测试;service.ts去掉 fileHits 融合、#searchProjectFiles/#fileIndexFor/#fileIndexes;DSH plugin 移除 scope observer +fileIndexservice;MemoryContext.files/FileHit及 stg/投影/渲染/CLI 消费者清理。tesserae.file_simhash TEXT(16-hex,16 位全范围无法经 node:sqlite INTEGER round-trip——实验实证)+ensureTesseraColumns前向迁移。#resolveTesseraLinesexact 失败后走 SimHash fallback——项目内扫近同文档找回移动文件(relocated: true);指纹匹配但 snippet 真消失则诚实 stale,绝不猜测/改写。simhash.test.ts6 用例 +tesserae-simhash.test.ts4 用例(写时指纹、别处编辑存活、移动找回、无关重写诚实 stale)。完成检查项
本地质量检查
npm run agent:verify全绿(check / test:product / build / verify:static 全部 passed,exit 0)npm run docs:check通过(110 files, 0 errors)npm run complexity:gate通过(本轮 23 个超基线方法均 unchanged)npm run verify:packages通过(@nmg/dsh-nmgclean-install build ok).nmg-search-scope残留已删除(不 track 也不留在磁盘)git status --short核对无他人文件)RCP(Repository Control Plane)
repo-development黑板(in-flight goal + result),不入仓库npm run agent:verify(覆盖 scopes: core-store, core-memory, daemon-cli, dsh-adapter, ci-and-tests)→.nmg/verification/latest.json已更新CI 完成确认
nmg-rcp forge-status --pr 21全 SUCCESS(等待 CI 跑完确认)