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
+3 -3
View File
@@ -65,7 +65,7 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md``docs/GLOBAL_STATE.md`
2. 确认环境变量已设置(GITEA_USER + ~/.gitea/config.yaml
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 product-code` — 先捡带 `product-code` 标签的 Issue
@@ -156,8 +156,8 @@ python scripts/agent_poller.py --action get --issue N
```
1. [判定] 是代码级修复还是质量级修复?
2. git pull origin main
3. git checkout -b dev/issue-N-<slug>
2. git fetch origin
3. git checkout -b dev/issue-N-<slug> origin/main
4. 修改功能代码 + 更新/补充 UT 和接口集成测试
5. python -m pytest -v # 本地全量 UT/集成测试
6. [仅质量级修复] python scripts/run_pipeline.py --input "input/<文档>.docx"