Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
80d6ff2
feat(recall): scope teamwiki codebase recall by project/role (#912)
STiFLeR7 Oct 3, 2026
066c8d7
fix(recall): scope route-depth router.md and the knowledge graph by w…
STiFLeR7 Oct 5, 2026
c967370
docs(wiki): propagate the wiki hand-declared type into help text and …
STiFLeR7 Oct 5, 2026
070e8fd
fix(recall): cover rebuildWikiIndex's router format and preserve glob…
STiFLeR7 Oct 5, 2026
5ccde9f
fix(recall): scope graph edges by identity, not node survival, and fi…
STiFLeR7 Oct 5, 2026
b564757
fix(recall): drop all-withheld router domain sections and reconcile-a…
STiFLeR7 Oct 5, 2026
200c1c6
fix(recall): fail closed when graph ownership can't be loaded, and sc…
STiFLeR7 Oct 5, 2026
5bd9f5f
fix(recall): fail closed on an unattributable router line and a colli…
STiFLeR7 Oct 5, 2026
c04c19f
fix(recall): validate per-repo graph shape and normalize legacy relat…
STiFLeR7 Oct 5, 2026
b07d949
fix(recall): validate per-repo graphs with the real schema, not a loo…
STiFLeR7 Oct 5, 2026
7e890c4
fix(recall): drop linkless all-withheld router sections and distrust …
STiFLeR7 Oct 5, 2026
b569a02
fix(recall): stamp graph ownership at aggregation time instead of inf…
STiFLeR7 Oct 5, 2026
df85d42
fix(recall): stamp origin on reconcile-materialized edge-endpoint nod…
STiFLeR7 Oct 5, 2026
e1784f7
fix(recall): tag cross-repo edges by their matched node's origin, and…
STiFLeR7 Oct 5, 2026
c446bbd
fix(recall): track both origins of a cross-repo edge, not just the ma…
STiFLeR7 Oct 5, 2026
07ba878
fix(recall): use the import edge's own origin tag, fail closed on una…
STiFLeR7 Oct 5, 2026
101b1c4
fix(recall): track independent cross-repo-edge provenance as pairs, n…
STiFLeR7 Oct 5, 2026
89aeeda
fix(recall): tag import-iwiki.ts's direct-match MAPS_TO edges with or…
STiFLeR7 Oct 5, 2026
1f689f9
fix(recall): treat an edge's origin as an additional independent prov…
STiFLeR7 Oct 5, 2026
0e7ba9c
fix(recall): preserve a losing edge's plain origin as an independent …
STiFLeR7 Oct 5, 2026
eded9fc
fix(recall): stamp origin on direct codebase --extract writes to the …
STiFLeR7 Oct 5, 2026
2bf4ea3
Merge remote-tracking branch 'origin/main' into feat/912-scope-wiki-r…
STiFLeR7 Oct 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file. See [standa
- **Upgrade every member together: team instructions leave the shared `AGENTS.md`.** `teamai pull` no longer writes the culture, `claudemd/` and recall blocks into the project's `AGENTS.md`, `~/AGENTS.md`, `~/.agents/AGENTS.md` or another tool's file, since members with different roles resolve different `claudemd/` selections and the shared file ended up holding whoever pulled last. Each installed tool gets them in its own file or session hook: Claude Code in `.claude/rules/teamai-context.md` (project) and `~/.claude/CLAUDE.md` (user); Cursor in `teamai-context.mdc` under `.cursor/rules` and `~/.cursor/rules`; CodeBuddy and WorkBuddy in one `.codebuddy/rules/teamai-context.md`, and WorkBuddy in `~/.workbuddy/rules/teamai-context.md`; OpenCode in `.opencode/teamai-context.md` and `~/.config/opencode/teamai-context.md`, listed in its `instructions`; Oh My Pi in `~/.omp/agent/RULES.md` and, in a project, through teamai's OMP extension; Pi through teamai's Pi extension in a project; Hermes in `$HERMES_HOME/SOUL.md` and, in a project, through a Hermes plugin teamai installs and enables. Copilot keeps `.github/copilot-instructions.md`. The first pull after updating removes the blocks earlier releases left in `AGENTS.md`, `~/AGENTS.md`, `.claude/CLAUDE.md`, `.codebuddy/CODEBUDDY.md`, `.omp/AGENTS.md`, `~/.omp/agent/AGENTS.md` and a moved tool's `claudemd` from the team's `toolPaths`, keeps everything else in those files, and names each file it changes; a block with a missing or repeated marker is left with a warning. A member still on an older release writes the blocks back into the shared files, so have everyone update. Pull writes only for installed tools, rewrites nothing that is current, removes the recall block when recall is disabled, and `--dry-run` lists the files it would change. Hermes skips project instructions over 4,000 characters, which pull and `teamai doctor` report. `teamai doctor` checks that each tool can load its instructions. A team `toolPaths` entry without `rules` keeps its configured `claudemd` for Claude Code, Cursor, CodeBuddy and WorkBuddy, and an entry with only `claudemd` is still delivered to. A team rule named `teamai-context` is not delivered, since it would land on teamai's own file, and a copy an earlier release delivered is removed unless the member changed it; neither a tombstone of that rule nor a namespaced placement of it reaches teamai's file. The HTTP local agent strips the old blocks of the tools a prompt reached, probes each tool as pull does, and its project prompts reach Pi, Oh My Pi and Hermes through their extension or plugin and the Codex family through its session hooks. It acks a prompt as failed, with the reason, when it reaches no tool: a target file teamai did not write, an extension or plugin that is missing, or text over Hermes' 4,000-character section. OpenCode counts `~/.claude/CLAUDE.md` as its fallback while that file holds teamai blocks, also from an excluded Claude Code, and pull warns when nothing keeps them current. A Hermes plugin named `teamai-instructions` or an Oh My Pi `teamai-hooks.ts` that teamai did not write is left alone, and a file CodeBuddy and WorkBuddy share gets the `teamai-recall` subagent block only when both have the subagent. teamai does not change `.gitignore`, `.git/info/exclude` or the index; a team that tracks a generated file such as `.github/copilot-instructions.md` still commits one member's selection. A project uninstall keeps the global Pi, Oh My Pi and Hermes adapters and Codex's user hooks, which other installs on the machine may use, and names them; `teamai hooks remove` removes them (for [#945](https://github.com/Tencent/teamai-cli/issues/945)).
- An env variable, hook or MCP server with a key its schema does not know, such as a misspelled `role:` or a hand-added `notes:`, is no longer delivered to anyone: the key used to be dropped silently, so a misspelled restriction shipped the entry to every member. `teamai pull`, the list commands, `teamai status` and `teamai doctor` name the file, the entry and the key. `teamai env add` also warns when it updates a variable carrying the unknown key; it, `teamai env remove` and `teamai remove mcp` keep the key when they rewrite the file. A key that a later version adds to these entries is unknown to this one too, so an entry that uses it is not delivered to a member still on this version: upgrade every member before the team uses a new entry key, as for a new `resources:` key (for [#822](https://github.com/Tencent/teamai-cli/issues/822)).
- `manifest/projects.yaml` and `manifest/roles.yaml` now reject a resource namespace that is not a single path segment, as a project id already had to be (the id keeps its own narrower ASCII rule). A namespace becomes a directory component (`skills/<namespace>/`, `agents/<namespace>/`, `learnings/<namespace>/`), so `../evil`, `a/b`, `C:evil`, a bare `..`, any name with a trailing `.` or space — which Win32 strips, making `.. ` arrive as `..` and `frontend.` as `frontend` — and a Windows device name such as `CON` or `COM1` under `resources:` no longer parse; the error names the offending entry. Nothing else is rejected: a namespace that is a plain directory name still parses, non-ASCII names and names with a space included. A manifest that fails to parse now reports the offending entry on one line (`Invalid projects manifest: projects.0.resources.skills.1: ...`) instead of dumping a raw validation object. Two namespaces of one resource type that differ only by case (`frontend`, `Frontend`) are rejected too, within a manifest and between the two, since they name one directory on Windows and macOS. A manifest that ships any of these — a device name, a trailing `.`, a case-only pair — parsed before and fails every pull now; rename the directory and the entry together.
- **Upgrade every member before a team declares a new axis.** `resources:` in `manifest/roles.yaml` and `manifest/projects.yaml` accepts `env`, `hooks`, `mcp`, `models` and `docs`, but teamai 0.25.0 and the 0.26.0 betas reject a `resources:` key they do not know, so a team that declares one breaks pull for every member still on those versions. From this version on, an unknown `resources:` key prints one warning naming the role or project and the key, and the scope syncs as if the key were absent; `teamai roles` and `teamai projects` keep the key when they save the manifest. `teamai roles|projects add/update --namespaces` never write the new keys, so nothing declares them until an admin does by hand (for [#707](https://github.com/Tencent/teamai-cli/issues/707)).
- **Upgrade every member before a team declares a new axis.** `resources:` in `manifest/roles.yaml` and `manifest/projects.yaml` accepts `env`, `hooks`, `mcp`, `models`, `docs` and `wiki`, but teamai 0.25.0 and the 0.26.0 betas reject a `resources:` key they do not know, so a team that declares one breaks pull for every member still on those versions. From this version on, an unknown `resources:` key prints one warning naming the role or project and the key, and the scope syncs as if the key were absent; `teamai roles` and `teamai projects` keep the key when they save the manifest. `teamai roles|projects add/update --namespaces` never write the new keys, so nothing declares them until an admin does by hand (for [#707](https://github.com/Tencent/teamai-cli/issues/707); `wiki` added for [#912](https://github.com/Tencent/teamai-cli/issues/912)).
- Per-entry scoping of env variables, hooks and MCP servers gives way to namespace files (see Features). `projects:` on an `env/env.yaml` variable, a `hooks/hooks.yaml` hook or an `mcp/mcp.yaml` server, and `roles:` on an env variable, existed only in the 0.26.0 betas and are removed: such an entry now reaches nobody, and pull, the list commands and status warn with the namespace file to move it to, one per listed id, so a project-only value never falls through to the whole team. `teamai env add` also warns when it updates an existing variable carrying either removed key, and preserves the key. `roles:` on hooks and MCP servers, which 0.25.0 shipped, is deprecated: it keeps filtering for one more minor release as 0.25.0 did, a name repeated in one file under different `roles:` included, pull warns once per run and `teamai doctor` has a check, both naming every target file. There is no automatic migration; move each entry into the file the warning names and drop the key. A member with no role in a team with `roles.yaml` received every `roles:`-scoped hook and server; once they move into `hooks/<ns>/` or `mcp/<ns>/`, that member no longer does (for [#707](https://github.com/Tencent/teamai-cli/issues/707)).
- Each tool reads only its own `tool_extras.<tool>` from a YAML agent. Qoder, Qoder CN, ZCode and OMP used to receive `tool_extras.claude` and ignore their own key, which `teamai push` wrote their edits to, so an edit never reached them; a team that relied on Claude extras reaching these tools moves those fields to `tool_extras.qoder`, `tool_extras.qoder-cn`, `tool_extras.zcode` or `tool_extras.omp`. tclaude and tcodex read `tool_extras.tclaude` and `tool_extras.tcodex` and fill the fields those lack from `tool_extras.claude` and `tool_extras.codex`, and `teamai push` writes their edits to their own key instead of the Claude or Codex one. The first ordinary pull after updating re-renders a copy an older CLI wrote this way when that CLI recorded delivering it and the member has not changed it since; any other copy is left as it is until the team next changes the agent (for [#830](https://github.com/Tencent/teamai-cli/issues/830)).
- **Upgrade every member before a team introduces model aliases.** An older CLI ignores `models/aliases.yaml` and writes `model: strong` into every tool as is, a model no tool knows, and its `teamai push` reads a model changed in a deployed copy as an edit, so it can replace `model: strong` in the team's agent with a concrete model such as `opus`. Have everyone update first, then add `models/aliases.yaml` and move agents to an alias. TeamAI does not check versions; the first ordinary pull after a member updates replaces a literal `model: strong` with the resolved model (for [#830](https://github.com/Tencent/teamai-cli/issues/830)).
Expand Down
2 changes: 1 addition & 1 deletion docs/designs/multi-project-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ settings, and pull says it `is no longer active in your namespaces`.

### Manifest and per-entry keys

`resources:` gains `env`, `hooks`, `mcp`, `models` and `docs`. They are optional
`resources:` gains `env`, `hooks`, `mcp`, `models`, `docs` and (#912) `wiki`. They are optional
and never defaulted: saving a manifest writes back the parsed object, so a
default would add `env: []` to every manifest an admin edits and break members on
an older CLI. For the same reason `--namespaces` on `teamai roles` and
Expand Down
2 changes: 2 additions & 0 deletions docs/product-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ Each resource is delivered to every agent:

Skills, rules, CLAUDE.md, agents, env, hooks, MCP, models and docs can also live under a `<namespace>/` subdirectory, which ships only to the roles and projects that list it in `resources:` (rules and CLAUDE.md under `knowledge:`). A namespace item replaces the root item of the same name; a docs namespace replaces nothing. With roles or projects set, root skills reach a member only through a tag subscription.

The Team Context knowledge base below is scoped the same way: a `teamwiki/evidence/code/<slug>/` codebase reaches only the roles and projects that list it under `resources.wiki`, and an undeclared slug stays shared — see [Wiki by namespace](usage-guide.md#codebase-knowledge-graph).

For file formats and full workflows, see the [Usage Guide](usage-guide.md).

## Team Context (beta)
Expand Down
2 changes: 2 additions & 0 deletions docs/product-overview.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ teamai push → 创建分支 + MR → reviewer 审批合并

Skills、rules、CLAUDE.md、agents、env、hooks、MCP、models 和 docs 也可以放在 `<namespace>/` 子目录下,只同步给在 `resources:` 中列出它的角色和项目(rules 与 CLAUDE.md 列在 `knowledge:` 下)。namespace 中的条目会替换根目录中同名的条目;docs namespace 不替换任何内容。配置了角色或项目后,根目录的 skills 只通过标签订阅送达成员。

下方的 Team Context 知识库采用同样的作用域规则:`teamwiki/evidence/code/<slug>/` 代码库只分发给在 `resources.wiki` 中列出它的角色和项目,未声明的 slug 仍然共享——详见[按命名空间分发 wiki](usage-guide.zh-CN.md#代码知识图谱)。

文件格式与完整工作流见[使用指南](usage-guide.zh-CN.md)。

## Team Context (beta)
Expand Down
14 changes: 13 additions & 1 deletion docs/usage-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ teamai projects remove checkout
`--namespaces` sets the same namespaces on every project resource type
(`knowledge`, `skills`, `learnings`, `agents`); `update` adds or removes them on
each type's own list, so a hand-edited per-type layout survives. Neither touches
`env`, `hooks`, `mcp`, `models` or `docs`: declare those by hand (see
`env`, `hooks`, `mcp`, `models`, `docs` or `wiki`: declare those by hand (see
[Env, hooks and MCP servers by namespace](#env-hooks-and-mcp-servers-by-namespace)),
because a member on an older CLI cannot read them. After
`projects remove`, a directory that still has the project active warns on its
Expand Down Expand Up @@ -1959,6 +1959,18 @@ When extract finds components, it writes `teamwiki/evidence/code/<project>/_mani

Without `--project`, `<project>` is the directory's name. At the root of a checkout, the main one or a linked git worktree, it is the repo's name: the main checkout's real name (also when opened through a symlink), or a bare repo's (`repo/.bare` or `repo.git` → `repo`). Every checkout of a repo writes the same entry. `teamai import --dir` picks its slug the same way.

**Wiki by namespace.** `recall` scopes `teamwiki/evidence/code/<slug>/` the same way it scopes docs: once any role (in `manifest/roles.yaml`) or project (in `manifest/projects.yaml`) lists a codebase slug under `resources.wiki`, it reaches only the members who have it active, and an undeclared slug stays shared:

```yaml
# manifest/projects.yaml
projects:
- id: svc-a
resources:
wiki: [svc-a] # evidence/code/svc-a/ only where svc-a is active
```

The slug is whichever one `teamai codebase --project <slug>` (or `teamai import`) wrote under `evidence/code/`; it has no required relationship to the manifest's project id, so declare the one the extraction actually used. Legacy mode (no role and no `projects.yaml`) searches every codebase, as before.

### Dashboard

```bash
Expand Down
14 changes: 13 additions & 1 deletion docs/usage-guide.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ teamai projects remove checkout

`--namespaces` 会把同一组 namespace 写入项目的每种资源类型(`knowledge`、`skills`、
`learnings`、`agents`);`update` 在每种类型各自的列表上增删,因此手工编辑过的按类型
布局会被保留。两者都不会改动 `env`、`hooks`、`mcp`、`models` 或 `docs`:这些请手动声明(见
布局会被保留。两者都不会改动 `env`、`hooks`、`mcp`、`models`、`docs` 或 `wiki`:这些请手动声明(见
[Env、hooks 与 MCP server 按 namespace 划分](#envhooks-与-mcp-server-按-namespace-划分)),因为旧版 CLI 的成员读不了它们。执行 `projects remove` 后,仍激活该项目的目录在下一次 pull 时会提示警告、
回退为仅按角色过滤,并清理已部署的该项目 skills、rules 和 agents——前提是该项目的内容
仍在团队仓库中,因为正是靠它识别已部署的副本。请在成员都 pull 过之后,再用单独的变更删除这些内容。
Expand Down Expand Up @@ -1804,6 +1804,18 @@ teamai codebase --lint --output /path/to/repo

`.teamai/pending-review.jsonl` 中的待审改动可用 `teamai review` 查看。用 `teamai review <id> --apply --dry-run`、`teamai review <id> --reject --dry-run` 或 `teamai review --all-apply --max-risk medium --dry-run` 预览处理决定。应用预览会执行与真实应用相同的目标文件和托管章节校验,但不会修改文档或移除待审项;批量预览保留相同的类型与风险筛选。处理预览的 `--json` 输出包含 `dryRun: true`,其中 `ok` 表示通过校验,不表示已写入。去掉 `--dry-run` 才会执行处理。

**按 namespace 分发 wiki。** `recall` 对 `teamwiki/evidence/code/<slug>/` 采用与 docs 相同的作用域规则:只要有任一角色(`manifest/roles.yaml`)或项目(`manifest/projects.yaml`)在 `resources.wiki` 中列出某个 codebase slug,它就只分发给激活了它的成员;未声明的 slug 仍然共享:

```yaml
# manifest/projects.yaml
projects:
- id: svc-a
resources:
wiki: [svc-a] # 只有激活 svc-a 时才能看到 evidence/code/svc-a/
```

这个 slug 就是 `teamai codebase --project <slug>`(或 `teamai import`)写入 `evidence/code/` 时用的那个值,它与 manifest 的 project id 没有必然关系,按实际提取时用的那个值声明即可。旧式用法(没有角色、没有 `projects.yaml`)会搜索所有 codebase,和之前一样。

### Dashboard

```bash
Expand Down
2 changes: 1 addition & 1 deletion skill-data/core/references/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Generated: do not edit by hand. Regenerate with
- `teamai projects list` — List defined projects and the ones active in this directory
- `teamai projects set [ids...]` — Set the projects active in this directory (comma-separated or repeated; empty to clear)
- `teamai projects add <id>` — Add a project to manifest/projects.yaml, creating the file if needed (admin)
- `--namespaces <ns>` — Comma-separated namespaces for knowledge, skills, learnings and agents (e.g. common,checkout); env, hooks, mcp, models and docs are declared by hand
- `--namespaces <ns>` — Comma-separated namespaces for knowledge, skills, learnings and agents (e.g. common,checkout); env, hooks, mcp, models, docs and wiki are declared by hand
- `--name <name>` — Display name for the project
- `-d, --description <desc>` — Description for the project
- `teamai projects update <id>` — Update a project in manifest/projects.yaml (admin)
Expand Down
10 changes: 8 additions & 2 deletions skill-data/setup/references/manage-admin.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ keep the project's content in the team repo until members have pulled: that is
what lets their next pull clean up the copies they deployed.

Every namespace that names a directory — `knowledge`, `skills`, `agents`, `env`,
`hooks`, `mcp`, `models` and `docs` in either manifest, and `learnings` in `projects.yaml` (a role's `learnings:` is
`hooks`, `mcp`, `models`, `docs` and `wiki` in either manifest, and `learnings` in `projects.yaml` (a role's `learnings:` is
ignored and unchecked) — must be a single path segment: no `/`, `\`, `:` or control character, no trailing
`.` or space, and not a Windows device name (`CON`, `NUL`, `COM1`, …). `team-codebase`
cannot be a `docs` namespace (`docs/team-codebase/` is the legacy codebase output). Two
Expand Down Expand Up @@ -173,6 +173,12 @@ namespace, their next pull removes its docs that still match the team copy and
keeps (and names) the ones they edited. Recall and `teamai doctor` follow the
same filter.

Wiki codebase slugs follow the same rule under `resources.wiki`: once any role
or project lists a `teamwiki/evidence/code/<slug>/` slug there, `recall` only
surfaces it for members with that namespace active; an undeclared slug stays
shared. The slug is whatever `teamai codebase --project <slug>` wrote, not
necessarily the project's manifest id.

## Team dashboard (web UI)

```bash
Expand Down Expand Up @@ -253,7 +259,7 @@ and push it with git. `teamai doctor` lists each override.
and also set in `env.yaml` is a secret: its `env.yaml` value is not delivered. A
secrets file that does not parse keeps `env.sh` and MCP servers as they were, and
`teamai doctor` fails a check naming the file.
- Have every member upgrade before declaring `env`, `hooks`, `mcp`, `models` or `docs` in a
- Have every member upgrade before declaring `env`, `hooks`, `mcp`, `models`, `docs` or `wiki` in a
manifest: teamai 0.25.0 and the 0.26.0 betas reject those keys and their pull stops.

## When sync fails
Expand Down
Loading
Loading