承接 #58 / #73(均已 CLOSED)。在当前 `tencent-main` 分支上复查发现 scope 隔离仍有未落地与不一致之处: ## 1. `recall` 仍在合并 user + project 双 scope(与 #73 期望相反) #73 的期望是:检测到 project scope 时只查 project、跳过 user。但当前 `recall()` 仍然把 project 与 user 两个索引都搜出来再合并去重: ```ts // src/recall.ts:234-280 // Try project scope first ... 然后 Try user scope ... 合并 allResults ``` 而 `auto-recall` 只用单一 scope 索引(`src/auto-recall.ts:557-565`)。结果是**手动 recall 与 hook 自动 recall 行为不一致**,且未按 #73 完成隔离。需确认 #73 是否未合并到本分支。 ## 2. `auto-recall` 在 project scope 下把 upvote 写到 user repo 读索引按 project scope,但 upvote 固定走 `requireInit()`(user): ```ts // src/auto-recall.ts:651-653 const { localConfig } = await requireInit(); await autoUpvote(results, localConfig.username, localConfig.repo.localPath); ``` project 场景下投票数据落到 user 的 repo/username,归属错误。 ## 3. `hooks inject` 与 `pull` 对 project scope 的 manifest 处理不一致 - `hooks inject`:project scope 下同时写 project **和** `~/.claude/` 等 user 目录,且用 **project 的 manifest** 去 reconcile user settings(`src/hooks-cmd.ts:18-29,73-76`)。 - `pull` 的 reconcile:每个 scope 各用各自的 baseDir + manifest(`src/pull.ts:1147-1159`、`src/hooks.ts:478`)。 → `~/.cursor/hooks.json` 等被 project manifest 跟踪,下次 user pull 又用 user manifest reconcile 同一文件,可能造成重复注入/误清理。#44 只修了 `hooks remove` 的双目录清理,未覆盖 inject 这条。 ## 4. 其他 - `tags subscribe/unsubscribe` 完全忽略 project scope,始终写 `~/.teamai/config.yaml`(`src/tags.ts:70-124`)。 - `contribute` 写完 learnings 不重建 search-index,需等下次 pull 才进 recall(`src/contribute.ts`)。 - project config 缺 `projectRoot` 字段时 `getTeamaiHome('project')` 静默退化为 `~/.teamai/`(`src/types.ts:692-697`),index/state/env/hooks 全落到 user home;`detectProjectConfig()` 不用 cwd 补全 projectRoot。 ## 建议 统一以 #73 的“project 命中即隔离 user”为准则核对所有读/写路径(recall / auto-recall upvote / hooks inject / tags / contribute),并补回归测试。 严重程度:高(数据归属与一致性)。
Activity
fix(recall): resolve 7 knowledge retrieval bugs (Tencent#79-Tencent#85)
fix(recall): resolve 7 knowledge retrieval bugs (#79-#85) (#91)
fix(scope): close remaining #85 scope-isolation gaps (#97)
test(e2e): update scope-isolation E2E for #264 hook simplification
fix(hooks): simplify project-scope injection and dispatch config (#272)
fix(recall): resolve 7 knowledge retrieval bugs (#79-Tencent#85) (Ten…
fix(scope): close remaining Tencent#85 scope-isolation gaps (Tencent#97)
fix(hooks): simplify project-scope injection and dispatch config (Ten…