refactor(agent-collaboration-kit): split stable core from project overrides
- Reorganize flat files into core/ templates/ examples/ scripts/ with VERSION - Deduplicate: single-source state machine, three-round policy, acceptance signals - Abstract orchestration in closed-loop.md with manual mode; move Orca commands to orca-adapter.md - Add tasks.schema.json + validate_tasks.py (jsonschema or builtin rules, no hard deps) - Add filled examples, concurrency write rule, kitVersion tracking; unify to Chinese Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
# notes-web Agent 协作协议(示例)
|
||||
|
||||
> 本项目基于 agent-collaboration-kit v0.2.0。
|
||||
> 稳定规范引用 `docs/agent-collaboration-kit/core/`,本文件只填项目差异。
|
||||
|
||||
## 项目概览
|
||||
|
||||
- 项目:`notes-web`
|
||||
- 技术栈:`TypeScript + React (Vite) + Go`
|
||||
- 运行命令:`npm run dev`(前端)、`go run ./server`(后端)
|
||||
- Base URL:`http://localhost:5173`
|
||||
- 任务板:`tasks.yaml`
|
||||
|
||||
## 稳定规范(引用,不重复)
|
||||
|
||||
- 角色 / 权限 / 状态机 / 完成定义:`docs/agent-collaboration-kit/core/roles-and-permissions.md`
|
||||
- 闭环流程(含手动模式、worktree 对齐):`docs/agent-collaboration-kit/core/closed-loop.md`
|
||||
- 优化方法(验收信号、三轮策略):`docs/agent-collaboration-kit/core/optimization-method.md`
|
||||
- 派发 prompt 模板:`docs/agent-collaboration-kit/core/prompt-templates.md`
|
||||
- Orca 编排命令:`docs/agent-collaboration-kit/core/orca-adapter.md`
|
||||
|
||||
## 路径权限
|
||||
|
||||
| 路径 | Product/Test | Developer | 说明 |
|
||||
|------|:------------:|:---------:|------|
|
||||
| `docs/spec/**` | R/W | Read-only | 产品规格 |
|
||||
| `tests/browser/**` | R/W | Read-only | 浏览器回归用例 |
|
||||
| `.qa-records/**` | R/W | Read-only | 复测记录(gitignore) |
|
||||
| `web/**`、`server/**` | Read-only | R/W | 应用源码 |
|
||||
| `**/*_test.go`、`web/**/*.test.tsx` | Read-only | R/W | 单元测试 |
|
||||
| `config/*.example.*` | Read-only | R/W | 可提交配置模板 |
|
||||
| `.env`、`config/local.*` | Read-only | Read-only | 本地私有配置 |
|
||||
| `tasks.yaml` | R/W | Read-only | 只有 Coordinator 写 |
|
||||
|
||||
## 命令
|
||||
|
||||
Developer 白盒验证:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
go test ./...
|
||||
npm run dev # 本地起前端
|
||||
```
|
||||
|
||||
Product/Test 黑盒验证:
|
||||
|
||||
```bash
|
||||
curl -s http://localhost:5173/api/health
|
||||
curl -s -X POST http://localhost:5173/api/fix/preview -d @fixtures/preview.json
|
||||
# 浏览器回归:tests/browser/cases/*.md
|
||||
```
|
||||
|
||||
任务板校验:
|
||||
|
||||
```bash
|
||||
python3 docs/agent-collaboration-kit/scripts/validate_tasks.py tasks.yaml
|
||||
```
|
||||
|
||||
## 硬规则(其余见 core/)
|
||||
|
||||
- `worker_done` 不等于完成,必须独立复测后才能 `verified`。
|
||||
- 只有 Coordinator 写 `tasks.yaml`。
|
||||
- 每个任务最多派发 3 轮,仍不过标记 `leftover` 并继续。
|
||||
- 不提交或推送,除非用户明确要求。
|
||||
@@ -0,0 +1,113 @@
|
||||
# 填好的最小示例(虚构的 notes-web 项目)。可用 scripts/validate_tasks.py 校验通过。
|
||||
version: 1
|
||||
updatedAt: "2026-07-06T09:40:00+08:00"
|
||||
source: "Product/Test Agent"
|
||||
kitVersion: "0.2.0"
|
||||
project:
|
||||
name: "notes-web"
|
||||
repoPath: "/home/dev/notes-web"
|
||||
baseUrl: "http://localhost:5173"
|
||||
devWorktree: "/home/dev/notes-web-wt/fix-preview"
|
||||
|
||||
summary:
|
||||
verified: ["BUG-002"]
|
||||
open: []
|
||||
failedRetest: []
|
||||
leftovers: ["BUG-003"]
|
||||
|
||||
tasks:
|
||||
- id: "BUG-002"
|
||||
type: "bug"
|
||||
title: "预览变更点击后不显示 diff 行"
|
||||
priority: "P0"
|
||||
status: "verified"
|
||||
assignee: "developer"
|
||||
component: "web/app/fix/page.tsx"
|
||||
specRefs:
|
||||
- "docs/spec/fix-preview.md#preview"
|
||||
testRefs:
|
||||
- "tests/browser/cases/01-preview.md"
|
||||
description: >
|
||||
用户在 /fix 页点击“预览变更”后,确认区不渲染 API 返回的 diff。
|
||||
stepsToReproduce:
|
||||
- "打开 /fix?fileId=1"
|
||||
- "搜索并选择候选项"
|
||||
- "点击“预览变更”"
|
||||
expected: >
|
||||
确认区出现 title、修改前值、修改后值、coverChanged 提示四行。
|
||||
actual: >
|
||||
API 返回 code=0,但页面确认区为空。
|
||||
evidence:
|
||||
browser: "确认区 DOM 为空,无 diff 行"
|
||||
api: "POST /api/fix/preview -> code=0, 含 diff 字段"
|
||||
logs: "无报错"
|
||||
verification:
|
||||
commands:
|
||||
- "npm run build"
|
||||
- "curl -s -X POST localhost:5173/api/fix/preview -d @fixtures/preview.json"
|
||||
browser:
|
||||
page: "/fix?fileId=1"
|
||||
checks:
|
||||
- "预览后出现 4 行 diff:title/before/after/coverChanged"
|
||||
dispatch:
|
||||
taskId: "orca-task-88"
|
||||
dispatchId: "orca-disp-91"
|
||||
worker: "dev-worker-1"
|
||||
rounds:
|
||||
- round: 1
|
||||
result: failed
|
||||
evidence: "只渲染了 title,缺少 before/after/coverChanged"
|
||||
- round: 2
|
||||
result: passed
|
||||
evidence: "复测 4 行 diff 全部出现,取消不触发写入"
|
||||
resolution:
|
||||
fixedBy: "dev-worker-1"
|
||||
verifiedAt: "2026-07-06T09:38:00+08:00"
|
||||
leftoverReason: null
|
||||
|
||||
- id: "BUG-003"
|
||||
type: "bug"
|
||||
title: "并发保存偶发覆盖他人修改"
|
||||
priority: "P1"
|
||||
status: "leftover"
|
||||
assignee: "developer"
|
||||
component: "server/store/notes.go"
|
||||
specRefs:
|
||||
- "docs/spec/concurrency.md"
|
||||
testRefs: []
|
||||
description: >
|
||||
两个会话同时保存同一条 note 时,后写覆盖先写,无冲突提示。
|
||||
stepsToReproduce:
|
||||
- "会话 A、B 同时打开 note 42"
|
||||
- "A 保存,B 保存"
|
||||
expected: >
|
||||
B 保存时应检测到版本变化并提示冲突,而非静默覆盖。
|
||||
actual: >
|
||||
B 直接覆盖 A 的修改,无提示。
|
||||
evidence:
|
||||
api: "两次 PUT /api/notes/42 均返回 200,无版本校验"
|
||||
verification:
|
||||
commands:
|
||||
- "go test ./server/store/..."
|
||||
browser:
|
||||
page: "/notes/42"
|
||||
checks:
|
||||
- "并发保存时后写方收到冲突提示"
|
||||
dispatch:
|
||||
taskId: "orca-task-90"
|
||||
dispatchId: "orca-disp-95"
|
||||
worker: "dev-worker-1"
|
||||
rounds:
|
||||
- round: 1
|
||||
result: failed
|
||||
evidence: "加了版本号但未在写入路径校验"
|
||||
- round: 2
|
||||
result: failed
|
||||
evidence: "校验只覆盖 API,未覆盖批量导入路径"
|
||||
- round: 3
|
||||
result: failed
|
||||
evidence: "乐观锁与前端重试逻辑冲突,需重新设计"
|
||||
resolution:
|
||||
fixedBy: null
|
||||
verifiedAt: null
|
||||
leftoverReason: "failed after 3 supervised developer rounds; 需重新设计并发模型"
|
||||
Reference in New Issue
Block a user