Repository navigation
feat: one namespace model for every resource type (#707) - #816
Conversation
…esolver (Tencent#707) Add src/namespace-resolver.ts, the pure rule tickets 02-05 build on: an active namespace item replaces the root item of the same name, and a name twice in one place or in two active namespaces is a tagged conflict naming both sources. The result depends only on the active order, not read order. Agents and skills now run their duplicate checks through it and throw the same messages. Agents still treat root + namespace as an error. Add fast-check for the resolver's property tests.
…encent#707) env/<ns>/env.yaml, hooks/<ns>/hooks.yaml and mcp/<ns>/mcp.yaml are read where <ns> is active in resources.env/hooks/mcp; a namespace entry replaces the root entry of the same key, hook id or server name. A broken active file, a name twice in one file or in two active namespaces stops that type for the run and keeps what is installed. Per-entry projects: (and roles: on env) reach nobody; roles: on hooks and MCP keeps filtering with a deprecation warning. Unknown resources: keys warn instead of failing the manifest.
…ills, agents, rules and claudemd (Tencent#707) With a role or project configured, an item in an active namespace now replaces the root item of the same name, whole: - agents by stem: root + namespace is no longer a duplicate error, and a recorded (placed) agent replaces the root agent too - skills by name, including a root skill received through a tag; an install removes the files of the version it replaces - rules by first-level file name, in tool dirs and Hermes' SOUL.md block - claudemd files by name in the managed block Two active namespaces with one rule or claudemd name stop that type for the run and keep what is installed. Push writes an edited overridden skill, agent or rule back to its namespace, and the skills push scan covers role and project namespaces. The placement record is withdrawn by a same-name shared-root file only in legacy mode. Recall indexes the skills pull delivers. doctor lists overrides, and in legacy mode repeated names, as notes. Legacy mode is otherwise unchanged.
Tencent#707) Rules and claudemd have no namespace-vs-namespace conflict: each namespace rule keeps its own local path and each claudemd file its own place in the block, so two active namespaces with one first-level name are both delivered, as before. Only root suppression applies. doctor override and legacy repeated-name notes now use the same wording as the env, hooks and MCP ones. The usage guide and admin reference say to keep overridable shared content at the root, with an example.
…nt#707) Two active namespaces with one skill name or agent stem used to throw and abort the whole scope, so rules, env, docs, cleanup and the search index were skipped too. resolveDesiredSkills, resolveDesiredAgents, scanRoleAwareSkills and filterAgentsByNamespaces now return a tagged conflict. pull warns, leaves that type as installed (no install, no inactive-namespace sweep) and syncs the rest. doctor reports the collision as before; recall indexes no skills while it stands.
…ocs (Tencent#707) env add/remove take --role/--project; remove mcp searches every file and asks for --role/--project when several define the name; push picks up env/<ns>/env.yaml. status, list and doctor show where each entry comes from; doctor lists overrides as notes and per-entry roles:/projects: as one informational check. Usage guides and the admin skill reference describe the namespace files; the Tencent#668 e2e moves onto them.
…nch (Tencent#707) Merges impl-707-02 (ticket 02) onto tickets 01 and 04. doctor keeps one notes channel: item overrides, then entry overrides, then the Codex reminder. The usage guide's doctor paragraph now names env, hook and MCP notes too.
…ent#707) remove mcp <name> follows push's convention: mcp/mcp.yaml when it defines the name, else the one namespace file that does; --role/--project pick a namespace. Only a name several namespace files (and not the root) define is refused.
…Tencent#707) A docs/<ns>/ that any role or project lists under resources.docs now reaches only members with that namespace active; an undeclared docs/<dir>/ stays shared. Leaving a namespace removes its local docs that are byte-equal to the team copy and keeps edited ones with a line. team-codebase is rejected as a docs namespace. The search index (pull, recall, contribute) and doctor's "Team docs delivered" use the same set.
… their gateway (Tencent#707) models/<ns>/models.yaml, declared under resources.models, replaces the root profile with the same id while <ns> is active. A team API key is stored per profile id and base_url origin, so pull never writes a key next to a gateway on another origin; it prints the models switch line instead. Conflicts and broken files stop model updates for the run. models list and doctor show where each profile comes from; push validates every models file.
Rewrite the multi-project design doc's precedence section for namespace-over-root, add the per-type conflict, failure and legacy-mode rules, and replace the per-entry key rows in the product overview. The JSON doctor notes now also carry namespace notes.
…ent#707) Drop the beta-only per-entry projects: entry, add the namespace axes, the override, the per-type failure policy, the roles: deprecation on hooks and MCP, and the upgrade-every-member-first note.
Tencent#707) Namespace fallback warnings, entry notices and unknown resources: keys now go through utils/warn-once, reset once per pull, so the quiet option threaded through eleven signatures is gone. The one-line wrappers resolveTeamEnv, resolveTeamMcpServers and resolveTeamProfiles are removed; every caller uses resolveEntries/resolveEntriesFor with the type's reader.
…ew code (Tencent#707) - listEntryFiles/entryFileAbsolutePath replace the per-type file listers in env, mcp and models and the repeated path joins. - gatewaySuffix replaces three spellings of the gateway suffix. - LATER_RESOURCE_TYPES and friends are named for what they are: HAND_DECLARED_RESOURCE_TYPES, HandDeclaredNamespacesShape. - Error messages use instanceof Error; manifest role/project ids are narrowed instead of cast; mapResources builds a typed object; pull writes env through an EnvHandler instance instead of a cast. - status keys counts by entry type; rules localNameFor reuses deliversEveryNamespace, whose false answer is now documented.
…cent#707) Commands must stay thin, and recall, contribute and doctor imported pull.js only to learn what a member receives. The skills, agents, rules and claudemd resolvers, RolePullContext and the index sources now live in src/resources/desired.ts; root suppression, the override note and the repeated-name grouping live in namespace-resolver. - A skill or agent conflict is a tagged DeliveryConflict carrying the resolver's NamespaceConflict, rendered once by describeDeliveryConflict (wording unchanged); DesiredItems names the result union. - DesiredItems keeps each override, so doctor no longer rebuilds skill and agent overrides by hand. - recall and contribute share deliveredIndexSources; pull indexes through the same indexedSkills instead of a second copy. - doctor: one unresolvableCheck for skills, agents and docs; the docs check reports an unreadable manifest instead of returning nothing; the namespace notes catch only the team-repo reads. - docs withdrawal reuses utils pruneEmptyDirs.
Story 8 asks for a message naming both files. A skill or agent conflict named only the namespaces, and an agent defined twice inside one namespace (agents/a/x.md next to agents/a/x.yaml) read as 'found in active namespaces "a" and "a"'. The duplicate case now names its one place, and both cases list the two files.
…n every tool (Tencent#707) - The rules override ran before the tag filter, so a namespace rule the member's tag subscription excludes still suppressed the root rule and the member received neither. The tag filter now runs first. - JoyCode, OMP, Pi and Copilot share their rule directory with the member's own rules, so the stale sweep deletes nothing there unless a tombstone names it: the root rule a namespace rule replaced stayed installed and both versions loaded (story 6). pullAllRules now removes such a copy while it is byte-equal to its render, as agents do.
…em (Tencent#707) On a skills conflict pull keeps the installed skills, but the index was rebuilt with none, so recall returned none of the skills the member still has. The index now keeps the skills entries it already held, and pull does the same when resolving the skills fails.
… not resolve (Tencent#707) reconcileTeamHooksForConfig returned [] when the team hooks could not be resolved, the same value as a team without hooks, so hooks inject printed 'Hooks injected into all AI tool settings' and exited 0 over a broken hooks/<ns>/hooks.yaml. It now returns { ok: false }, and hooks inject exits 1 after the warning that names the file. mcp inject said 'Already up to date.' in the same case; the MCP reconcile now marks the result unresolved and mcp inject exits 1.
…encent#707) - A key a 0.26.0 beta stored under team:<id> counted for whatever origin the root profile had now, so a root profile moved to another host got the old key written next to it. The first pull or models command that reads such a key now binds it to the origin TeamAI last wrote into the agents switched to that profile (the root's current origin when it is among them), else to the root's current origin, and never re-reads the unbound key. Pull then leaves a moved agent alone and asks for the switch. - The 'switch to set a key' and 'no longer active' lines are written to debug.log too: SessionStart pulls run silent. - Legacy mode, which reads no namespace, says a profile 'was removed'. - A models command whose profiles do not resolve reports it with log.error and exit code 1, as env list and mcp list do, instead of throwing.
…s: working (Tencent#707) 0.25.0 let hooks.yaml and mcp.yaml repeat a hook or server name under different roles:, delivering every copy that passed the role filter (MCP kept the last). The namespace resolver treated that as a duplicate, so a member holding both roles, or a role-less member in a team with projects.yaml, stopped receiving hooks or MCP entirely. During the roles: deprecation window such a repeat is delivered as in 0.25; a name repeated without roles: on every copy is still a duplicate. Also restores the test that the role filter runs before requireTeamScripts, so the transparency print lists only what will run.
) The spec asks doctor, like status and the list commands, to show each entry's namespace; doctor listed overrides only. For env, hooks, MCP and models, a namespace contributing any entry now adds a note counting the entries by origin, 'env: 3 received here (2 root, 1 checkout)', from the describeOrigins that status uses.
…in: in a namespace file (Tencent#707) Seam 1 asks every type to show, through pull, that two active namespaces defining one name keep the installed state and name both files. Env and hooks were covered only through doctor and the handler; so was the warning for builtin: in a namespace hooks file.
…mai push (Tencent#707) manage-admin.md told admins to publish hooks/MCP file edits with teamai push, which sweeps only rules/, env/ and .codebuddy-plugin/, so an agent following it would push nothing. It now says to commit and push the file with git, as the usage guide does.
…me a kept copy (Tencent#707) In the JoyCode, OMP, Pi and Copilot rule dirs, a replaced root rule's copy was removed only while it matched the current root rule. When the admin edited the root rule and added its namespace override in one push, the member's unedited copy stayed loaded beside the override, silently. It is now also compared with the render at the last pull, and a copy that is kept is named with the fix.
…solve (Tencent#707) teamai status counts such a type as 0 and says to run doctor, but doctor had failing checks only for env and MCP, so a duplicate hook id or a two-namespace clash showed nothing there.
…t#707) env add/remove --role <ns> wrote env/<ns>/env.yaml for a namespace no role or project lists under resources.env, so the variable reached nobody and nothing said so. The same applies to remove mcp --role.
…n push (Tencent#707) git ls-files quotes such a path by default, so it never matched the name on disk and push skipped the change.
… read stops the type (Tencent#707) The readers folded every read error into 'file does not exist', so an unreadable namespace file silently delivered the root entry in place of its override. Only ENOENT is absence now; any other error is a broken file, like one that does not parse.
…lded, as docs does (Tencent#707) A declared namespace was joined onto the path as written, so with env: [checkout] and a directory env/Checkout/, macOS and Windows members got the override and Linux members the root value.
…ncent#707) listFilesRecursive always joins with '/', so on Windows every path was one segment and a claudemd/<ns>/x.md beside claudemd/x.md was never reported.
|
Findings
The PR description’s testing record is sufficient, including representative real-CLI verification. |
…Tencent#707) A namespace rule replaces the root rule of its name, but recall, contribute and pull indexed every file under rules/: the replaced root rule and the rules of inactive namespaces came back from recall. Index the resolved rule set, as docs and skills already do.
… from (Tencent#707) Pull matches a declared namespace to its directory case-folded, but --role and --project returned the spelling typed. On a case-sensitive filesystem `env add --project checkout` created env/checkout/, which shadowed env/Checkout/ and dropped its variables from delivery.
…es not parse (Tencent#707) The team scan skips a file that does not parse. With mcp/mcp.yaml broken, `remove mcp db` took the one readable checkout/db as the target and removed it. Refuse and name the file unless the readable root defines the name.
…e, not that the name is missing (Tencent#707) The team scan skips a file that does not parse, so `remove mcp db --project checkout` with a broken mcp/checkout/mcp.yaml reported "Not found". Name the file and remove nothing.
|
I’ll inspect the exact PR diff without executing any project code, then trace the changed paths for concrete regressions and verify the earlier findings are resolved. Since the requested comparison is already available locally, I’ll use read-only Git commands only. |
…matches that version (Tencent#707) Install removed any installed file at a path another team version of the skill has, by path alone. A file a member added under that name, e.g. README.md beside a namespace they never had, was deleted on every pull. Remove it only when it is byte for byte that version's file; keep any other and name it.
|
Findings
The three findings from the earlier review are resolved in the current diff. The PR description includes sufficient representative real-CLI and automated testing. |
…et after a failed refresh (Tencent#707) env add and env remove read the target through parseEnvYaml, which answers an empty list for a file that does not parse, then wrote that back: every variable the file had was replaced. They now refuse and name the file. --project resolves through manifest/projects.yaml. After a failed pull that copy may be stale and name a namespace the project no longer uses, whose file push would publish, so --project now changes nothing then. The root file and --role do not depend on the manifest and still only warn.
|
Findings
The five findings from earlier review passes are resolved in the current diff. The PR description includes sufficient automated and representative real-CLI testing. |
…nt#707) A skill directory without SKILL.md replaced the root skill of its name: install overlaid it and removed the installed SKILL.md as the other version's leftover, while pull still counted the skill as synced. Such a directory is no longer a skill; pull names it and keeps delivering the root one. An agent file that does not parse delivers nothing, yet it still replaced the root agent, and cleanup removed the unchanged root copy because no active destination held that stem. The root agent now stays while its replacement cannot be read or parsed.
…s skill (Tencent#707) Pull stopped delivering such a directory in 6c7df8e, but the push scan still mapped the skill name to it. An unedited root skill then showed as modified, and push wrote it into skills/<ns>/<name>/, deleting what was there and making it a namespace skill that replaces the root one. Also keep only a replaced root agent while its replacement does not parse, so an unchanged copy from an inactive namespace is still removed, and put renderedForTool's doc comment back on it.
|
Findings
All seven findings from earlier review passes are resolved in the current diff. The PR description documents sufficient automated testing and representative real-CLI verification. |
…ent#816) * chore: start one namespace model for every resource type (Tencent#707) * refactor(pull): check agent and skill namespace collisions with one resolver (Tencent#707) Add src/namespace-resolver.ts, the pure rule tickets 02-05 build on: an active namespace item replaces the root item of the same name, and a name twice in one place or in two active namespaces is a tagged conflict naming both sources. The result depends only on the active order, not read order. Agents and skills now run their duplicate checks through it and throw the same messages. Agents still treat root + namespace as an error. Add fast-check for the resolver's property tests. * feat(env,hooks,mcp): scope env, hooks and MCP servers by namespace (Tencent#707) env/<ns>/env.yaml, hooks/<ns>/hooks.yaml and mcp/<ns>/mcp.yaml are read where <ns> is active in resources.env/hooks/mcp; a namespace entry replaces the root entry of the same key, hook id or server name. A broken active file, a name twice in one file or in two active namespaces stops that type for the run and keeps what is installed. Per-entry projects: (and roles: on env) reach nobody; roles: on hooks and MCP keeps filtering with a deprecation warning. Unknown resources: keys warn instead of failing the manifest. * feat(pull): let an active namespace item replace the root item for skills, agents, rules and claudemd (Tencent#707) With a role or project configured, an item in an active namespace now replaces the root item of the same name, whole: - agents by stem: root + namespace is no longer a duplicate error, and a recorded (placed) agent replaces the root agent too - skills by name, including a root skill received through a tag; an install removes the files of the version it replaces - rules by first-level file name, in tool dirs and Hermes' SOUL.md block - claudemd files by name in the managed block Two active namespaces with one rule or claudemd name stop that type for the run and keep what is installed. Push writes an edited overridden skill, agent or rule back to its namespace, and the skills push scan covers role and project namespaces. The placement record is withdrawn by a same-name shared-root file only in legacy mode. Recall indexes the skills pull delivers. doctor lists overrides, and in legacy mode repeated names, as notes. Legacy mode is otherwise unchanged. * fix(pull): deliver both namespace rules and claudemd files of one name (Tencent#707) Rules and claudemd have no namespace-vs-namespace conflict: each namespace rule keeps its own local path and each claudemd file its own place in the block, so two active namespaces with one first-level name are both delivered, as before. Only root suppression applies. doctor override and legacy repeated-name notes now use the same wording as the env, hooks and MCP ones. The usage guide and admin reference say to keep overridable shared content at the root, with an example. * fix(pull): stop only skills or agents on a namespace collision (Tencent#707) Two active namespaces with one skill name or agent stem used to throw and abort the whole scope, so rules, env, docs, cleanup and the search index were skipped too. resolveDesiredSkills, resolveDesiredAgents, scanRoleAwareSkills and filterAgentsByNamespaces now return a tagged conflict. pull warns, leaves that type as installed (no install, no inactive-namespace sweep) and syncs the rest. doctor reports the collision as before; recall indexes no skills while it stands. * feat(env,hooks,mcp): namespace flags, origins in status and doctor, docs (Tencent#707) env add/remove take --role/--project; remove mcp searches every file and asks for --role/--project when several define the name; push picks up env/<ns>/env.yaml. status, list and doctor show where each entry comes from; doctor lists overrides as notes and per-entry roles:/projects: as one informational check. Usage guides and the admin skill reference describe the namespace files; the Tencent#668 e2e moves onto them. * test(env): show a broken env file stops env only (Tencent#707) * fix(remove): remove an MCP server from the root file by default (Tencent#707) remove mcp <name> follows push's convention: mcp/mcp.yaml when it defines the name, else the one namespace file that does; --role/--project pick a namespace. Only a name several namespace files (and not the root) define is refused. * test(remove): expect namespace files in sorted order (Tencent#707) * feat(docs): deliver a declared docs namespace only where it is active (Tencent#707) A docs/<ns>/ that any role or project lists under resources.docs now reaches only members with that namespace active; an undeclared docs/<dir>/ stays shared. Leaving a namespace removes its local docs that are byte-equal to the team copy and keeps edited ones with a line. team-codebase is rejected as a docs namespace. The search index (pull, recall, contribute) and doctor's "Team docs delivered" use the same set. * feat(models): scope team model profiles by namespace and bind keys to their gateway (Tencent#707) models/<ns>/models.yaml, declared under resources.models, replaces the root profile with the same id while <ns> is active. A team API key is stored per profile id and base_url origin, so pull never writes a key next to a gateway on another origin; it prints the models switch line instead. Conflicts and broken files stop model updates for the run. models list and doctor show where each profile comes from; push validates every models file. * docs(models): describe model profiles by namespace and key binding (Tencent#707) * docs: list docs among the axes declared by hand (Tencent#707) * docs: describe one namespace model for every resource type (Tencent#707) Rewrite the multi-project design doc's precedence section for namespace-over-root, add the per-type conflict, failure and legacy-mode rules, and replace the per-entry key rows in the product overview. The JSON doctor notes now also carry namespace notes. * docs(changelog): replace per-entry scoping with namespace files (Tencent#707) Drop the beta-only per-entry projects: entry, add the namespace axes, the override, the per-type failure policy, the roles: deprecation on hooks and MCP, and the upgrade-every-member-first note. * docs(changelog): say the model key binding re-keys once and affects only betas (Tencent#707) * refactor(namespaces): one warn-once registry instead of the quiet flag (Tencent#707) Namespace fallback warnings, entry notices and unknown resources: keys now go through utils/warn-once, reset once per pull, so the quiet option threaded through eleven signatures is gone. The one-line wrappers resolveTeamEnv, resolveTeamMcpServers and resolveTeamProfiles are removed; every caller uses resolveEntries/resolveEntriesFor with the type's reader. * refactor(namespaces): shared entry-file helpers, no unsafe casts in new code (Tencent#707) - listEntryFiles/entryFileAbsolutePath replace the per-type file listers in env, mcp and models and the repeated path joins. - gatewaySuffix replaces three spellings of the gateway suffix. - LATER_RESOURCE_TYPES and friends are named for what they are: HAND_DECLARED_RESOURCE_TYPES, HandDeclaredNamespacesShape. - Error messages use instanceof Error; manifest role/project ids are narrowed instead of cast; mapResources builds a typed object; pull writes env through an EnvHandler instance instead of a cast. - status keys counts by entry type; rules localNameFor reuses deliversEveryNamespace, whose false answer is now documented. * refactor(desired): move the desired-set resolvers out of pull.ts (Tencent#707) Commands must stay thin, and recall, contribute and doctor imported pull.js only to learn what a member receives. The skills, agents, rules and claudemd resolvers, RolePullContext and the index sources now live in src/resources/desired.ts; root suppression, the override note and the repeated-name grouping live in namespace-resolver. - A skill or agent conflict is a tagged DeliveryConflict carrying the resolver's NamespaceConflict, rendered once by describeDeliveryConflict (wording unchanged); DesiredItems names the result union. - DesiredItems keeps each override, so doctor no longer rebuilds skill and agent overrides by hand. - recall and contribute share deliveredIndexSources; pull indexes through the same indexedSkills instead of a second copy. - doctor: one unresolvableCheck for skills, agents and docs; the docs check reports an unreadable manifest instead of returning nothing; the namespace notes catch only the team-repo reads. - docs withdrawal reuses utils pruneEmptyDirs. * fix(pull): name both files in a skill or agent conflict (Tencent#707) Story 8 asks for a message naming both files. A skill or agent conflict named only the namespaces, and an agent defined twice inside one namespace (agents/a/x.md next to agents/a/x.yaml) read as 'found in active namespaces "a" and "a"'. The duplicate case now names its one place, and both cases list the two files. * fix(rules): only a delivered namespace rule replaces the root rule, in every tool (Tencent#707) - The rules override ran before the tag filter, so a namespace rule the member's tag subscription excludes still suppressed the root rule and the member received neither. The tag filter now runs first. - JoyCode, OMP, Pi and Copilot share their rule directory with the member's own rules, so the stale sweep deletes nothing there unless a tombstone names it: the root rule a namespace rule replaced stayed installed and both versions loaded (story 6). pullAllRules now removes such a copy while it is byte-equal to its render, as agents do. * fix(recall): keep the indexed skills while a skills conflict holds them (Tencent#707) On a skills conflict pull keeps the installed skills, but the index was rebuilt with none, so recall returned none of the skills the member still has. The index now keeps the skills entries it already held, and pull does the same when resolving the skills fails. * fix(hooks,mcp): fail hooks inject and mcp inject when team entries do not resolve (Tencent#707) reconcileTeamHooksForConfig returned [] when the team hooks could not be resolved, the same value as a team without hooks, so hooks inject printed 'Hooks injected into all AI tool settings' and exited 0 over a broken hooks/<ns>/hooks.yaml. It now returns { ok: false }, and hooks inject exits 1 after the warning that names the file. mcp inject said 'Already up to date.' in the same case; the MCP reconcile now marks the result unresolved and mcp inject exits 1. * fix(models): bind a beta API key to the gateway it was sent to, once (Tencent#707) - A key a 0.26.0 beta stored under team:<id> counted for whatever origin the root profile had now, so a root profile moved to another host got the old key written next to it. The first pull or models command that reads such a key now binds it to the origin TeamAI last wrote into the agents switched to that profile (the root's current origin when it is among them), else to the root's current origin, and never re-reads the unbound key. Pull then leaves a moved agent alone and asks for the switch. - The 'switch to set a key' and 'no longer active' lines are written to debug.log too: SessionStart pulls run silent. - Legacy mode, which reads no namespace, says a profile 'was removed'. - A models command whose profiles do not resolve reports it with log.error and exit code 1, as env list and mcp list do, instead of throwing. * fix(entries): keep 0.25 files that repeat a name under different roles: working (Tencent#707) 0.25.0 let hooks.yaml and mcp.yaml repeat a hook or server name under different roles:, delivering every copy that passed the role filter (MCP kept the last). The namespace resolver treated that as a duplicate, so a member holding both roles, or a role-less member in a team with projects.yaml, stopped receiving hooks or MCP entirely. During the roles: deprecation window such a repeat is delivered as in 0.25; a name repeated without roles: on every copy is still a duplicate. Also restores the test that the role filter runs before requireTeamScripts, so the transparency print lists only what will run. * feat(doctor): say where each entry type's entries come from (Tencent#707) The spec asks doctor, like status and the list commands, to show each entry's namespace; doctor listed overrides only. For env, hooks, MCP and models, a namespace contributing any entry now adds a note counting the entries by origin, 'env: 3 received here (2 root, 1 checkout)', from the describeOrigins that status uses. * test(pull): env and hooks conflicts between two namespaces, and builtin: in a namespace file (Tencent#707) Seam 1 asks every type to show, through pull, that two active namespaces defining one name keep the installed state and name both files. Env and hooks were covered only through doctor and the handler; so was the warning for builtin: in a namespace hooks file. * docs(skill-data): hooks and MCP edits are published with git, not teamai push (Tencent#707) manage-admin.md told admins to publish hooks/MCP file edits with teamai push, which sweeps only rules/, env/ and .codebuddy-plugin/, so an agent following it would push nothing. It now says to commit and push the file with git, as the usage guide does. * refactor(models): read switched agents without a cast (Tencent#707) * docs(changelog): doctor counts entries per namespace; inject fails on unresolved entries (Tencent#707) * refactor(pull): drop imports the resolver move left unused (Tencent#707) * fix(hooks): install the built-in hooks when the team hooks do not resolve (Tencent#707) A first init or bootstrap whose team hooks did not resolve (a broken namespace file, a clash, a duplicate id) installed no built-in hook, so the session-start pull that heals the member never ran. Installed team hooks are still kept; the built-in hooks are now installed where missing, with the root file's builtin: overrides whenever hooks/hooks.yaml parses, and with their defaults only in a tool with no teamai hook when it does not. init and bootstrap say that the team hooks were not installed. * fix(manifest): keep an unknown resources: key when roles and projects save (Tencent#707) zod stripped the key this CLI only warns about, so a projects or roles command run on this version deleted a newer CLI's type from the team repo for everyone. * fix(docs): withdraw a copy the team edited after delivery, not only an unchanged one (Tencent#707) Withdrawing an inactive docs namespace compared the local copy with the current team file only. A doc the team changed after the member received it was then kept forever with a false 'you edited it' line. A copy equal to an earlier team commit is what the mirror delivered, so it goes too. * fix(rules): withdraw a replaced root rule edited in the same push, name a kept copy (Tencent#707) In the JoyCode, OMP, Pi and Copilot rule dirs, a replaced root rule's copy was removed only while it matched the current root rule. When the admin edited the root rule and added its namespace override in one push, the member's unedited copy stayed loaded beside the override, silently. It is now also compared with the render at the last pull, and a copy that is kept is named with the fix. * fix(doctor): fail a check when team hooks or model profiles do not resolve (Tencent#707) teamai status counts such a type as 0 and says to run doctor, but doctor had failing checks only for env and MCP, so a duplicate hook id or a two-namespace clash showed nothing there. * fix(env): warn when --role names a namespace nothing declares (Tencent#707) env add/remove --role <ns> wrote env/<ns>/env.yaml for a namespace no role or project lists under resources.env, so the variable reached nobody and nothing said so. The same applies to remove mcp --role. * fix(env): find a changed namespace env file whose name is not ASCII on push (Tencent#707) git ls-files quotes such a path by default, so it never matched the name on disk and push skipped the change. * fix(entries): an active env, hooks, MCP or models file that cannot be read stops the type (Tencent#707) The readers folded every read error into 'file does not exist', so an unreadable namespace file silently delivered the root entry in place of its override. Only ENOENT is absence now; any other error is a broken file, like one that does not parse. * fix(entries): match env, hooks, MCP and models namespace dirs case-folded, as docs does (Tencent#707) A declared namespace was joined onto the path as written, so with env: [checkout] and a directory env/Checkout/, macOS and Windows members got the override and Linux members the root value. * fix(doctor): split the legacy claudemd paths on '/', not path.sep (Tencent#707) listFilesRecursive always joins with '/', so on Windows every path was one segment and a claudemd/<ns>/x.md beside claudemd/x.md was never reported. * fix(recall): index the rules pull delivers, not the whole rules/ tree (Tencent#707) A namespace rule replaces the root rule of its name, but recall, contribute and pull indexed every file under rules/: the replaced root rule and the rules of inactive namespaces came back from recall. Index the resolved rule set, as docs and skills already do. * fix(entries): write a namespace file into the directory pull reads it from (Tencent#707) Pull matches a declared namespace to its directory case-folded, but --role and --project returned the spelling typed. On a case-sensitive filesystem `env add --project checkout` created env/checkout/, which shadowed env/Checkout/ and dropped its variables from delivery. * fix(remove): remove no MCP server by a bare name while an MCP file does not parse (Tencent#707) The team scan skips a file that does not parse. With mcp/mcp.yaml broken, `remove mcp db` took the one readable checkout/db as the target and removed it. Refuse and name the file unless the readable root defines the name. * docs: rules in recall, namespace writes and remove mcp on a broken file (Tencent#707) * fix(remove): say the MCP file --role or --project names does not parse, not that the name is missing (Tencent#707) The team scan skips a file that does not parse, so `remove mcp db --project checkout` with a broken mcp/checkout/mcp.yaml reported "Not found". Name the file and remove nothing. * fix(skills): remove a leftover of another skill version only when it matches that version (Tencent#707) Install removed any installed file at a path another team version of the skill has, by path alone. A file a member added under that name, e.g. README.md beside a namespace they never had, was deleted on every pull. Remove it only when it is byte for byte that version's file; keep any other and name it. * fix(env): edit no env file that does not parse, and no --project target after a failed refresh (Tencent#707) env add and env remove read the target through parseEnvYaml, which answers an empty list for a file that does not parse, then wrote that back: every variable the file had was replaced. They now refuse and name the file. --project resolves through manifest/projects.yaml. After a failed pull that copy may be stale and name a namespace the project no longer uses, whose file push would publish, so --project now changes nothing then. The root file and --role do not depend on the manifest and still only warn. * fix(pull): let no unusable namespace item replace the root one (Tencent#707) A skill directory without SKILL.md replaced the root skill of its name: install overlaid it and removed the installed SKILL.md as the other version's leftover, while pull still counted the skill as synced. Such a directory is no longer a skill; pull names it and keeps delivering the root one. An agent file that does not parse delivers nothing, yet it still replaced the root agent, and cleanup removed the unchanged root copy because no active destination held that stem. The root agent now stays while its replacement cannot be read or parsed. * fix(push): take no namespace directory without SKILL.md for a member's skill (Tencent#707) Pull stopped delivering such a directory in 6c7df8e, but the push scan still mapped the skill name to it. An unedited root skill then showed as modified, and push wrote it into skills/<ns>/<name>/, deleting what was there and making it a namespace skill that replaces the root one. Also keep only a replaced root agent while its replacement does not parse, so an unchanged copy from an inactive namespace is still removed, and put renderedForTool's doc comment back on it.
Summary
Every resource type now scopes to roles and projects in the same way: files under
<type>/<ns>/in the team repo, declared inresources:. A namespace item replaces the root item with the same name.idType of Change
Breaking changes: per-entry
projects:(env/hooks/MCP) androles:on env existed only in the 0.26.0 betas and are removed. An entry that still has one reaches nobody, and the warning names its target file.roles:on hooks/MCP, which shipped in 0.25.0, keeps filtering for one minor, with a warning in pull and a doctor check.Test Plan
npx tsc --noEmitpassesnpx vitest runpasses: 313 files, 4863 passed, 1 skippednpm run test:e2epasses: 51 files, 265 passed, 26 skipped (live-provider suites)fast-checkproperty tests on the namespace resolverReal CLI (
dist/),checkoutoverridingAPI_BASEand MCP serverdb:Real CLI, first pull with a broken
hooks/hooks.yaml:Real CLI,
teamai remove mcp dbwith a brokenmcp/mcp.yamlanddbinmcp/checkout/mcp.yaml:Real CLI,
devopsmember with the rootreviewskill; the member addsfront-only.md, a pathskills/frontend/review/also has, then pulls:Real CLI,
teamai env add NEW_KEY x --role checkouton anenv/checkout/env.yamlwritten as a plainKEY: valuemapping:Real CLI,
devopsmember with the rootreviewskill; the team then addsskills/devops/review/notes.mdwith noSKILL.md:Same setup,
teamai --dry-run push --allwith the root skill unedited:mcp.yaml/hooks.yamlenv.yamlremoved or emptiedenv.shstays exportedenv.shrewritten from what still appliesremove mcp <name>while an MCP file does not parseremove mcp <name> --project <id>on a file that does not parseNot found (skipping)env add/env removeon an env file that does not parseenv add/env remove --projectafter a failed pullprojects.yamlnames--rolestill only warn)SKILL.mdSKILL.mdremovedRelated Issues
Closes #707. Spec, tickets and design decisions: #707 (comment)
Notes for Reviewers
Door: two-way for code. It is one-way for teams that declare the new axes, because 0.25.0 and the betas reject unknown
resources:keys and those members' pull breaks. Upgrade every member first (CHANGELOG says so). From this version on, an unknown key only warns. The new axes are.optional(), so saving a manifest never writesenv: [].Blast radius: broad. Pull, push, doctor, recall and the
env/remove mcpcommands, across every resource type.Decisions made after the spec, where the code differs from it:
rules/x.md), not inrules/common/, becausecommonis just another namespace.<type>/<ns>/.team:<id>@<origin>, for root profiles as well. When a gateway host changes, the member runsteamai models switch team:<id>once. A beta key is bound once to the origin it was last sent to. Models exist only in the betas.remove mcp <name>removes the root server even while an active namespace overrides it. Members of that namespace keep their override; everyone else loses the server.team-codebasecannot be a docs namespace. Directory names match case-insensitively.builtin:overrides live in the root file.An adversarial pass with the CI Codex review prompt (1 P1, 5 P2, 4 P3) is fixed. The main fixes:
builtin:overrides when that file parses.roles/projectssaves keep unknownresources:keys.The CI Codex review on this PR (3 P1) is fixed, each with a test that failed first:
ruleFiles, likedocFiles), not all ofrules/. A replaced root rule and the rules of inactive namespaces are no longer returned. Rules the member's tags leave out are not indexed either, as for skills.env add|removeandremove mcpwith--role/--projectwrite to the existing directory the namespace matches case-folded, which is the file pull reads. Before, on Linux,--project checkoutcreatedenv/checkout/, which shadowedenv/Checkout/.remove mcp <name>that the root file does not define removes nothing while any MCP file does not parse.--role/--projectnaming a file that does not parse now says so, instead of reporting the server as not found.The Codex review of c0a51d5 posted only its opening line, so the same prompt was run locally (read-only) on that head. It confirmed the three P1s resolved and raised one P2, fixed with a test that failed first: skill install deleted a member-added file whenever another version of the skill had a file at that path, even in a namespace the member never had.
The CI Codex review of 8169268 (2 P1) is fixed, with tests that failed first:
env add|removeno longer rewrite an env file that does not parse (this predates the PR forenv/env.yaml; the PR extends it to namespace files), and--projectchanges nothing when the team repo cannot be refreshed.The CI Codex review of c8fc79b (2 P1) is fixed, with tests that failed first: an unusable namespace item no longer replaces the root one. A skill directory without
SKILL.mdis left out of the desired set, so it neither replaces the root skill nor strips the installedSKILL.md. While a namespace agent file cannot be read or parsed, cleanup keeps the root agent it would replace.The Codex review of 6c7df8e timed out (15-minute job limit), so its prompt was run locally, read-only, on that head. It raised one P1, a regression of that commit, now fixed with a test that failed first: push still mapped a skill to a namespace directory without SKILL.md, so an unedited root skill showed as modified and push would publish it there. Two P3s are fixed too: the agent cleanup guard now spares only the replaced root agent, and a doc comment went back on its function.
Left for follow-up issues (#822): local-edit protection on pull; mistyped per-entry keys are silently dropped;
pull --dry-runshows no hooks/MCP warnings; a tagged skill that exists only in an inactive namespace still reaches the member;recallprints a Chinese footer.