fix: Git Workflow 多 Session 并发隔离改造 - Closes #124
CI / test (pull_request) Successful in 22s

核心变更:
- _common.sh: setup_worktree 改为 session-unique detached worktree (origin/main)
- 所有 Agent 文档移除 git checkout main / git pull origin main
- Feature branch 统一从 origin/main 创建: git fetch origin && git checkout -b <branch> origin/main
- CLAUDE.md: 新增工作区隔离章节, primary worktree 定义为只读参考区
- 新增 start_generic.sh: Generic session worktree 隔离启动器

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 16:11:32 +08:00
parent 9629eb6ae0
commit e4f0b77ca8
9 changed files with 80 additions and 66 deletions
+6 -12
View File
@@ -15,7 +15,7 @@ description: QE Agent — 自动化验收测试开发与质量门禁。轮询 Gi
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`
2. 设好环境变量(见下方"环境要求")
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/`),不与其他 agent 共享工作目录
3. 确认当前在独立的 git worktree 中(启动脚本已自动切到 `~/.gitea/worktrees/<user>/<timestamp>/`),不与其他 agent 共享工作目录。工作区始终基于 origin/main,请勿 checkout main 分支
4.`/loop 10m` 开启 10 分钟间隔的自动轮询
4. 轮询内容(多轮递进):
a. `--action list --labels test-code` — 先捡带 `test-code` 标签的 Issue
@@ -111,22 +111,16 @@ python scripts/agent_poller.py --action comment --issue <N> --body "QE-Agent 已
### Step 3: 实施测试
#### 3.1 确保代码最新
#### 3.1 确保代码最新并创建分支
```bash
git checkout main
git pull origin main
```
#### 3.2 创建分支
```bash
git checkout -b test/issue-<N>
git fetch origin
git checkout -b test/issue-<N> origin/main
```
分支命名规则:`test/issue-<N>``test/issue-<N>-<简短描述>`
#### 3.3 编写测试代码
#### 3.2 编写测试代码
测试代码在 `tests/acceptance/` 目录下。现有结构:
@@ -148,7 +142,7 @@ tests/acceptance/
- Layer B 覆盖率测试不需要 LLM API
- Layer C QE 审计需要 `deepseek-v4-flash` API
#### 3.4 本地验证
#### 3.3 本地验证
```bash
# 跑全部验收测试(需要 LLM API)