Skip to content

feat(scope): isolate user scope when project scope is installed (#73)#77

Merged
jeff-r2026 merged 1 commit into
mainfrom
feat/issue-73-scope-isolation
Jun 30, 2026
Merged

feat(scope): isolate user scope when project scope is installed (#73)#77
jeff-r2026 merged 1 commit into
mainfrom
feat/issue-73-scope-isolation

Conversation

@jeff-r2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #73. When a project-scope install is detected in the current directory, teamai now operates on the project scope only — the user scope is no longer pulled or searched. This stops a self-contained project knowledge base from being polluted by user-scope team resources.

  • pull: detect project scope first; in project mode skip the user scope entirely and print 检测到 project scope,已跳过 user scope. Hooks reconcile is limited to the active scope. Cross-team source skills are still pulled (decision per issue), now against the active scope so deploys land in the right base dir.
  • recall: query the project index only when a project scope is detected, the user index otherwise. The two scopes are no longer merged/deduped.
  • uninstall: the summary now states which scope (user/project) and .teamai path it is acting on, to avoid wiping the wrong scope.

auto-recall already resolved a single scope index via autoDetectInit(), so it stays consistent with the new behavior.

Behavior change

command no project scope (unchanged) project scope present (new)
teamai pull pull user scope project only, user skipped (+ notice)
teamai recall search user index project index only
teamai uninstall acts on user scope acts on project scope (now labeled)

Backward compatible for pure user-scope users (no project config → identical behavior).

Test plan

  • npx tsc --noEmit
  • npm run build
  • Unit: pull-scope-isolation.test.ts (project mode skips user, source routed to active config; user mode unchanged)
  • Unit: recall-scope-isolation.test.ts (project-only vs user-only results, real indexes)
  • E2E (offline, no token): scope-isolation-e2e.test.ts — dual-scope sandbox driving the real CLI for pull (notice + project skill deployed, user skill NOT deployed), recall (project knowledge only), uninstall --dry-run (states project scope)
  • Full unit suite: 1670 passed

Made with Cursor

When a project-scope install is detected in cwd, `pull` and `recall` now
operate on the project scope ONLY — the user scope is no longer pulled or
searched. This keeps a self-contained project knowledge base from being
polluted by user-scope team resources.

- pull: skip user scope (print notice), reconcile only the active scope,
  still pull cross-team source skills (against the project scope).
- recall: query the project index only when a project scope is detected,
  user index otherwise; the two scopes are no longer merged.
- uninstall: state which scope (user/project) and path it is acting on.

Tests: unit (pull/recall isolation) + offline real-CLI e2e covering
pull/recall/uninstall in a dual-scope sandbox.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jeff-r2026 jeff-r2026 merged commit dcda577 into main Jun 30, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feat] project scope 安装后隔离 user scope(pull/recall 不再处理 user,uninstall 提示 scope)

1 participant