Skip to content

feat(scope): add opt-in user resource inheritance - #281

Merged
jeff-r2026 merged 3 commits into
Tencent:mainfrom
GaoSSR:feat/layered-scope-composition
Aug 5, 2026
Merged

feat(scope): add opt-in user resource inheritance#281
jeff-r2026 merged 3 commits into
Tencent:mainfrom
GaoSSR:feat/layered-scope-composition

Conversation

@GaoSSR

@GaoSSR GaoSSR commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Project scope isolation prevents cross-project leakage, but it also leaves no supported way to combine organization-wide practices with project-specific resources. This adds a project-local, opt-in inheritUserScope mode that layers safe user resources and searchable knowledge while preserving project isolation by default.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature causing existing behavior to change)
  • Documentation only
  • Refactor / internal cleanup

Test Plan

  • npx tsc --noEmit passes
  • npx vitest run --coverage passes (144 files, 1907 tests)
  • Added/updated tests for the change
  • npm run build passes
  • npx vitest run --config vitest.e2e.config.ts src/__tests__/scope-inheritance-e2e.test.ts passes (6 tests)

Related Issues

Related to #73.

Notes for Reviewers

  • Default project-only behavior remains unchanged unless the local project config enables inheritance.
  • The inherited channel includes skills, rules, docs, agents, shared instructions/culture, and the user search index.
  • User env, hooks, MCP definitions, external sources, usage reporting, remote writes, and inherited-result vote writes remain isolated.
  • Partial user sync uses lastInheritedPullRev, so it cannot suppress a later full user pull.
  • Recall searches project first and shadows an identical user resource type and filename using the complete project index.
  • This branch is stacked on docs(scope): align scope docs with runtime behavior #280 so the behavior documentation can merge first without creating conflicting follow-up edits.

GaoSSR added 2 commits August 4, 2026 20:28
The documentation still described pull and recall as merging user and project scopes after project isolation became the default behavior.

Document the active-scope selection used by pull and recall, while clarifying that both configurations may coexist on one machine.

Refs Tencent#73
Preserve project isolation by default while allowing projects to layer safe user resources and searchable knowledge.

Keep env, hooks, MCP, sources, reporting, and inherited vote writes isolated, with a separate revision marker for partial synchronization.

Refs Tencent#73
@jeff-r2026

Copy link
Copy Markdown
Collaborator

Thanks for you contribution , Please solve the conflicts.

@jeff-r2026
jeff-r2026 self-requested a review August 5, 2026 02:59
Resolve the documentation overlap after Tencent#280 was squash-merged while preserving the opt-in inheritance behavior on this branch.
@GaoSSR

GaoSSR commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@jeff-r2026 Thanks,I merged the latest upstream/main into this branch and resolved the documentation conflicts caused by the squash merge of #280. All checks are passing, and the PR is now mergeable.

@jeff-r2026 jeff-r2026 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeff-r2026
jeff-r2026 merged commit b9f792c into Tencent:main Aug 5, 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.

2 participants