Skip to content

fix(pull): preserve role isolation for tag subscriptions - #337

Merged
jeff-r2026 merged 1 commit into
mainfrom
fix/issue-334-tag-role-leak
Aug 26, 2026
Merged

jeff-r2026 merged 1 commit into
mainfrom
fix/issue-334-tag-role-leak

Conversation

@jeff-r2026

Copy link
Copy Markdown
Collaborator

Summary

  • restrict the tag augmentation channel to explicitly matching skills so inactive namespaces cannot leak untagged skills
  • retain valid cross-role tag matches during inactive-namespace cleanup and remove them after unsubscribe
  • add unit/integration coverage, a real CLI E2E fixture, and synchronized English/Chinese documentation

Closes #334

Test plan

  • npm run build
  • npm run typecheck
  • npm test (2230 tests)
  • npm run test:e2e -- src/__tests__/e2e/roles-tags-pull.test.ts
  • Real CLI flow: roles set backend → tags subscribe wanted → pull --force

Made with Cursor

Only explicit tag matches may augment role-scoped skills, while cleanup retains valid cross-role matches.

Co-authored-by: Cursor <[email protected]>
@jeff-r2026
jeff-r2026 merged commit 579477b into main Aug 26, 2026
7 checks passed
@jeff-r2026
jeff-r2026 deleted the fix/issue-334-tag-role-leak branch September 11, 2026 09:15
SaulMoro added a commit to SaulMoro/teamai-cli that referenced this pull request Sep 25, 2026
…ey (Tencent#822)

Item 1. Env, hook and MCP entry schemas are plain z.object, which strips
unknown keys, so a mistyped scoping key (`role:` for `roles:`) vanished and
the entry reached every member. Each reader now reports the keys an entry
was written with that its schema does not know (known keys come from the
schema's own shape), and keepScopedEntry does not deliver such an entry and
warns once, naming the file, the entry and the key, the same path the
removed `projects:` key takes. doctor's per-entry-key check is retitled to
cover it. `env add`/`env remove` and `remove mcp` keep such a key when they
rewrite the file; `remove mcp` edits the YAML document instead of
re-serializing the parsed servers.

Item 4. recall ended every result with a Chinese line; it is English now.

Item 2 is not a bug: tags reaching a tagged skill in an inactive namespace
is the behavior Tencent#337 added and roles-tags-pull tests. The design doc's
Known gaps entry now says so.

Item 3 (pull --dry-run warnings) is left to Tencent#832.
SaulMoro added a commit to SaulMoro/teamai-cli that referenced this pull request Sep 26, 2026
…ey (Tencent#822)

Item 1. Env, hook and MCP entry schemas are plain z.object, which strips
unknown keys, so a mistyped scoping key (`role:` for `roles:`) vanished and
the entry reached every member. Each reader now reports the keys an entry
was written with that its schema does not know (known keys come from the
schema's own shape), and keepScopedEntry does not deliver such an entry and
warns once, naming the file, the entry and the key, the same path the
removed `projects:` key takes. doctor's per-entry-key check is retitled to
cover it. `env add`/`env remove` and `remove mcp` keep such a key when they
rewrite the file; `remove mcp` edits the YAML document instead of
re-serializing the parsed servers.

Item 4. recall ended every result with a Chinese line; it is English now.

Item 2 is not a bug: tags reaching a tagged skill in an inactive namespace
is the behavior Tencent#337 added and roles-tags-pull tests. The design doc's
Known gaps entry now says so.

Item 3 (pull --dry-run warnings) is left to Tencent#832.
jeff-r2026 pushed a commit that referenced this pull request Sep 26, 2026
…ey (#822) (#833)

* fix(pull): do not deliver an env, hook or MCP entry with a mistyped key (#822)

Item 1. Env, hook and MCP entry schemas are plain z.object, which strips
unknown keys, so a mistyped scoping key (`role:` for `roles:`) vanished and
the entry reached every member. Each reader now reports the keys an entry
was written with that its schema does not know (known keys come from the
schema's own shape), and keepScopedEntry does not deliver such an entry and
warns once, naming the file, the entry and the key, the same path the
removed `projects:` key takes. doctor's per-entry-key check is retitled to
cover it. `env add`/`env remove` and `remove mcp` keep such a key when they
rewrite the file; `remove mcp` edits the YAML document instead of
re-serializing the parsed servers.

Item 4. recall ended every result with a Chinese line; it is English now.

Item 2 is not a bug: tags reaching a tagged skill in an inactive namespace
is the behavior #337 added and roles-tags-pull tests. The design doc's
Known gaps entry now says so.

Item 3 (pull --dry-run warnings) is left to #832.

* fix(env): warn when env add updates a variable pull does not deliver (#822)

Updating a variable that carries an unknown key keeps the key, so the
variable stays undelivered; env add now says so instead of only reporting
'Updated env variable'.

* fix(pull): keep installed MCP servers and hooks when their file has no known top-level key (#822)

A hooks or MCP file with `server:` for `servers:` parsed as empty and
removed every installed team server or hook for every member, silently.
Such a file now fails like one that does not parse, naming the keys found
and the key expected. An extra key beside a known one is still ignored.
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
Only explicit tag matches may augment role-scoped skills, while cleanup retains valid cross-role matches.

Co-authored-by: Cursor <[email protected]>
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
…ey (Tencent#822) (Tencent#833)

* fix(pull): do not deliver an env, hook or MCP entry with a mistyped key (Tencent#822)

Item 1. Env, hook and MCP entry schemas are plain z.object, which strips
unknown keys, so a mistyped scoping key (`role:` for `roles:`) vanished and
the entry reached every member. Each reader now reports the keys an entry
was written with that its schema does not know (known keys come from the
schema's own shape), and keepScopedEntry does not deliver such an entry and
warns once, naming the file, the entry and the key, the same path the
removed `projects:` key takes. doctor's per-entry-key check is retitled to
cover it. `env add`/`env remove` and `remove mcp` keep such a key when they
rewrite the file; `remove mcp` edits the YAML document instead of
re-serializing the parsed servers.

Item 4. recall ended every result with a Chinese line; it is English now.

Item 2 is not a bug: tags reaching a tagged skill in an inactive namespace
is the behavior Tencent#337 added and roles-tags-pull tests. The design doc's
Known gaps entry now says so.

Item 3 (pull --dry-run warnings) is left to Tencent#832.

* fix(env): warn when env add updates a variable pull does not deliver (Tencent#822)

Updating a variable that carries an unknown key keeps the key, so the
variable stays undelivered; env add now says so instead of only reporting
'Updated env variable'.

* fix(pull): keep installed MCP servers and hooks when their file has no known top-level key (Tencent#822)

A hooks or MCP file with `server:` for `servers:` parsed as empty and
removed every installed team server or hook for every member, silently.
Such a file now fails like one that does not parse, naming the keys found
and the key expected. An extra key beside a known one is still ignored.
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.

[bug] tag subscriptions leak untagged skills from inactive role namespaces

1 participant