Problem
After teamai projects remove <id>, a member whose only delivered team rule came from that project can retain the deployed rule after teamai pull --force. This violates the remove/reclaim acceptance criterion in #756 and the behavior documented in #774.
Evidence
Reproduction case
- In a team repo, define project
alpha with one rule in its exclusive knowledge namespace. Keep that rule in the repo. Do not define any shared or role-delivered rule for the member.
- Activate
alpha in a member directory and run teamai pull --force; confirm the rule is deployed locally.
- Remove
alpha from manifest/projects.yaml using teamai projects remove alpha, merge the manifest change, then run teamai pull --force in the same member directory.
- The project rule is no longer selected, but
pullAllRules() sees zero rules and returns before removing the local copy.
This is a code-path finding; the exact zero-rule scenario is not covered by the PR's real-CLI test.
Expected behavior
The next pull reclaims rules previously deployed by TeamAI for the removed project, including when the desired rule set is empty, while preserving user-authored or locally modified rules.
Suggested verification
Extend the real-CLI remove e2e in #774 with a case that has no shared or role rule. Assert that the project rule disappears after pull. Add a guard assertion that a personal rule in the same tool directory survives. Preserve the existing data-safety behavior rather than sweeping every file when the desired set is empty.
Related: #756, #774.
Problem
After
teamai projects remove <id>, a member whose only delivered team rule came from that project can retain the deployed rule afterteamai pull --force. This violates the remove/reclaim acceptance criterion in #756 and the behavior documented in #774.Evidence
RulesHandler.pullAllRules()returns immediately when the filtered rule set is empty, before its stale-file cleanup:src/resources/rules.ts:442-455. The comment explains that the guard protects user-authored rules.Reproduction case
alphawith one rule in its exclusive knowledge namespace. Keep that rule in the repo. Do not define any shared or role-delivered rule for the member.alphain a member directory and runteamai pull --force; confirm the rule is deployed locally.alphafrommanifest/projects.yamlusingteamai projects remove alpha, merge the manifest change, then runteamai pull --forcein the same member directory.pullAllRules()sees zero rules and returns before removing the local copy.This is a code-path finding; the exact zero-rule scenario is not covered by the PR's real-CLI test.
Expected behavior
The next pull reclaims rules previously deployed by TeamAI for the removed project, including when the desired rule set is empty, while preserving user-authored or locally modified rules.
Suggested verification
Extend the real-CLI remove e2e in #774 with a case that has no shared or role rule. Assert that the project rule disappears after pull. Add a guard assertion that a personal rule in the same tool directory survives. Preserve the existing data-safety behavior rather than sweeping every file when the desired set is empty.
Related: #756, #774.