Skip to content

feat(v2): team roles, Workflow templates, outcomes, trust and review routing; remove Agent Team engine - #636

Open
Blue-Berrys wants to merge 26 commits into
mainfrom
feat/team-collaboration
Open

Blue-Berrys wants to merge 26 commits into
mainfrom
feat/team-collaboration

Conversation

@Blue-Berrys

@Blue-Berrys Blue-Berrys commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Team Workspace grows from "share Skills/docs/config" into shared Agent roles, Workflow templates, run outcomes, and review routing, all still stored in the team's Git repository. Manifest goes to schemaVersion: 6 only when a v6 resource is used; repositories without roles/templates/outcomes stay v4/v5 so older clients keep reading them.

 team repo/
 ├── agentrecall.json          # manifest v6: + agentRoles, workflowTemplates, outcomes
+├── agents/<id>.md            # role instructions (runtime + model family only, no channel/keys)
+├── workflows/<id>.json       # template nodes reference roles, never local Agent ids
+├── outcomes/<id>.md          # outcome record, links shared sessions by id
+├── OWNERS.json               # review rules: resource → GitHub owners
+└── .github/CODEOWNERS        # generated from OWNERS.json
 Team Workspace tabs
   共享会话
+  Agent 角色      # publish / enable to local with channel+model mapping and preflight; Skill × role matrix
+  Workflow 模板   # use → personal copy with origin; scripts confirmed before first run
+  运行成果        # record from a completed run or manually
   Skills          # + export ZIP (keeps exec bit)
   文档 / 共享指令 / MCP / Env
   工作目录        # + install only selected roles' Skills
+  成员与动态      # last 100 commits, author identity + change trailers
+  审核规则        # OWNERS.json editor
Push
  split items by OWNERS.json
    protected → agentrecall/review/<digest> branch → "打开 Pull Request" (GitHub compare page)
    others    → default branch as before
Pull
  scripted Skills / MCP not yet trusted → TRUST_REQUIRED → per-item trust/skip (stored locally per content digest)
Save / Publish
  MCP env/headers/args/url, Env, templates, outcomes → reject plaintext secrets (PLAINTEXT_SECRET), ask for fromEnv

Docs: docs/spec/team-assets.md, docs/spec/workflow.md, docs/v2/team-workspace.md, docs/v2/team-assets.md; ADRs 0014–0019 (roles, local trust, templates, outcomes, install by role, review routing). One release note: .release-notes/feat-team-collaboration.md.

Also removes the unreachable vendored Agent Team engine (pipeline/parallel/supervisor: engine/main/hub/team/*, AgentHub team methods, snapshot/persistence fields; ~1700 lines). Multi-agent orchestration stays in Workflow. Persisted payload stays version 5: legacy teams/teamRuns are ignored on load and saved as empty so older builds can still restore (ADR 0013).

Evidence

  • Before: no roles/templates/outcomes/review rules; Pull installed scripted Skills and MCP without asking; plaintext tokens in MCP/Env could be published.
    After: new behavior covered by tests:
    • CLI (apps/cli, NODE_NO_WARNINGS=1 npm test): 89/89 — roles + v6 upgrade only when used, secret rejection, templates reject Agent ids/unknown roles, outcomes, trust prompt remembered per digest, install by role retires unselected Skills, member identity + trailers read back by activity, review rules route protected items and generate CODEOWNERS.
    • V2 vitest: 296 files / 2914 tests pass (team-engine tests removed) (incl. role/template/outcome/review panels, trust dialog, Skill ZIP IPC, template script gate in WorkflowCoreService).
    • npm run typecheck, test:repo 52/52, check:dead-code, release-note:check pass.
    • test:scripts: 235/236; the one failure (embedded-postgres-runtime.test.mjs "fails an npm installation whose platform runtime was omitted") is environment-related and untouched by this branch (no scripts/, bin/, package.json changes).
  • UI not yet exercised in a packaged app; screenshots pending.

Merge Danger

Door: two-way for code, one-way per team repository once a v6 resource is published.

Publishing a role, template, or outcome upgrades that repository's manifest to v6; older AgentRecall builds then refuse to read it and ask members to upgrade. Repositories that never use these resources are unaffected. Local trust decisions and per-directory role selection are stored in app config and are ignored by older builds.

Blast Radius: team-workspace

Pull now stops with a trust prompt the first time a team ships scripted Skills or MCP servers (CLI: team sync --trust all|none). Existing plaintext secrets in already-published MCP/Env are not rewritten, but editing them requires switching to environment references.

Drop the vendored Agent Team (pipeline/parallel/supervisor) engine from
the automation hub: team modules, types, AgentHub methods, snapshot and
persisted fields, and team-only tests. Workflow v2 owns multi-agent
orchestration and has no dependency on it.

Persisted payloads stay at version 5. Validation no longer requires the
teams/teamRuns collections, so payloads written by earlier versions still
restore and the legacy team fields are dropped on the next save. The
incremental change protocol never carried team data, so its version is
unchanged. Record the decision in ADR 0012.
Add manifest v6 agentRoles (instructions in agents/<id>.md, runtime and
model family, referenced team Skills and MCP) with a Team Space tab to
author roles, prefill from local Agents and enable them locally with a
member-chosen channel. Reject plaintext credentials in team MCP and Env
before staging or publishing.
Templates live in workflows/<id>.json under manifest v6, name team roles instead of local Agent ids, and are checked for plaintext credentials. Using a template creates a personal copy with the Agents enabled from those roles and records its origin; copies with script nodes must have their scripts confirmed before the first run.
Adds a read-only role-by-Skill matrix and an optional per-directory role selection. Pull installs only the selected roles' Skills there and retires other team-owned Skills with backups; the selection lives only in local workspace configuration.
Members can export one or all team Skills from the Skills tab. The main process packs the working-copy files with executable bits and a fixed timestamp and writes through the owner window's save dialog.
# Conflicts:
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-workspace-page.tsx
#	apps/main-2.0/src/renderer/src/styles/team-workspace.css
#	docs/adr/README.md
#	docs/v2/team-workspace.md
# Conflicts:
#	apps/main-2.0/src/main/ipc/team-workspace.test.ts
#	apps/main-2.0/src/main/services/team-push-service.test.ts
#	apps/main-2.0/src/main/services/team-push-service.ts
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-agent-roles-panel.test.tsx
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-assets-panel.test.tsx
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-workspace-page.tsx
#	apps/main-2.0/src/shared/team-push.ts
#	docs/adr/README.md
#	docs/spec/team-assets.md
#	docs/v2/team-assets.md
#	docs/v2/team-workspace.md
#	packages/workspace-core/src/asset-format.ts
#	packages/workspace-core/src/asset-inspection.ts
#	packages/workspace-core/src/configuration-format.ts
#	packages/workspace-core/src/git-assets.ts
#	packages/workspace-core/src/index.ts
#	packages/workspace-core/src/secret-guard.ts
#	packages/workspace-core/src/team-assets.ts
# Conflicts:
#	apps/cli/test/team-pull.test.ts
#	apps/main-2.0/src/renderer/src/styles/team-workspace.css
#	docs/adr/README.md
#	packages/workspace-core/src/index.ts
#	packages/workspace-core/src/team-pull.ts
# Conflicts:
#	apps/cli/test/configuration-authoring.test.ts
#	apps/main-2.0/src/main/services/team-workspace-service.ts
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-assets-panel.test.tsx
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-workspace-page.tsx
#	apps/main-2.0/src/renderer/src/styles/team-workspace.css
# Conflicts:
#	docs/spec/team-assets.md
#	docs/v2/team-workspace.md
# Conflicts:
#	apps/cli/test/configuration-authoring.test.ts
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-assets-panel.test.tsx
#	apps/main-2.0/src/renderer/src/features/team-workspace/team-workspace-page.tsx
#	apps/main-2.0/src/renderer/src/styles/team-workspace.css
#	apps/main-2.0/src/shared/ipc/team-workspace.ts
#	docs/adr/README.md
#	docs/spec/team-assets.md
#	packages/workspace-core/src/configuration-format.ts
#	packages/workspace-core/src/git-assets.ts
#	packages/workspace-core/src/index.ts
#	packages/workspace-core/src/team-assets.ts
…ation

Keep writing empty legacy team fields so builds released before the removal can still restore the payload.
@Blue-Berrys Blue-Berrys changed the title feat(v2): team roles, Workflow templates, outcomes, trust and review routing feat(v2): team roles, Workflow templates, outcomes, trust and review routing; remove Agent Team engine Oct 23, 2026
- Prefill the template name when publishing a personal Workflow
- Clear the script confirmation banner once confirmed, even if the run fails
- Keep the existing file path when previewing updates to roles, documents and outcomes
- Keep review submissions and their pull request link visible in the Push dialog
- Label templates, outcomes and review rules in the activity list
- Reload team pages when Pull applied resources but shared sessions did not finish
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.

1 participant