fix: 统一输出文件目录结构 - Closes #3
CI / test (pull_request) Successful in 7s

- 新增 PROJECT_OUTPUT (项目根/output/),统一所有输出文件
- IR 中间产物 → output/ir/,最终交付物 → output/final/
- agent_poller.py 新增 pr-status/merge-pr/close-issue/lifecycle 命令
- DEV_AGENT.md 同步更新完整闭环流程
- 更新 conftest/test_sample 中的默认路径

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-31 14:38:37 +08:00
parent 9be264250a
commit 884848f15f
6 changed files with 219 additions and 54 deletions
+38 -24
View File
@@ -96,40 +96,54 @@ python scripts/agent_poller.py --action get --issue N
### 4. 提交 PR
Push 后立即创建 PR(每个 Issue 对应一个 PR
Push 后立即`agent_poller.py` 创建 PR
```bash
gh pr create \
--title "fix: <描述> - Closes #N" \
--body "$(cat <<'EOF'
## Summary
python scripts/agent_poller.py --action create-pr \
--issue N --branch dev/issue-N-<slug> \
--body "## Summary
- <改动摘要>
## Test
- [ ] pytest 全量通过
- [ ] UT / 集成测试已更新
- [x] pytest 全量通过 (XX passed, Y skipped)
- [x] UT / 集成测试已更新
Closes #N
🤖 Generated with [Claude Code](https://claude.com/claude-code)
EOF
)"
Closes #N"
```
### 5. 等待 CI
PR 创建后 CI 自动触发。可通过 Gitea Actions 页面或 `gh pr checks` 查看状态
PR 创建后 CI 自动触发。用 agent_poller 监控状态
### 6. 处理结果
```bash
python scripts/agent_poller.py --action pr-status --pr <PR_NUM>
```
- **CI 通过**
1. Merge PR 到 main`gh pr merge <PR-URL> --merge`
2. 在 Issue 中评论 PR 信息和合并结果
3. `Closes #N` 自动关闭 Issue
- **CI 失败**
1. CI 自动创建 `ci-failure` Issue
2. 分析失败原因,在 PR 上 push 修复 commit
3. CI 重新触发,直到通过
### 6. Merge & 关闭
CI 通过后,执行 merge 并关闭 Issue
```bash
# Merge PR(会自动检查 CI 状态)
python scripts/agent_poller.py --action merge-pr --pr <PR_NUM>
# 如果 Issue 未被自动关闭,手动关闭
python scripts/agent_poller.py --action close-issue --issue N \
--body "PR #<NUM> merged. 变更已合入 main."
```
**一键查看完整生命周期:**
```bash
python scripts/agent_poller.py --action lifecycle --issue N
```
### 7. CI 失败处理
CI 失败时 Gitea 自动创建 `ci-failure` Issue
1. `agent_poller.py --action get --issue <NEW_NUM>` 分析失败原因
2. 在修复分支上修改代码,`git commit --amend` 或新 commit
3. `git push origin dev/issue-N-<slug>` 触发 CI 重跑
4. 重复步骤 5-6 直到 CI 通过
## 闭环
@@ -138,11 +152,11 @@ QE-Agent 开 Issue (qe-feedback)
Dev-Agent 分析 → 开发/重构 → 更新测试
git push → 创建 PR → CI (pytest)
git push → create-pr → CI (pytest)
┌─ 失败 → 自动开 Issue → push 修复 → 回到 CI
└─ 成功 → Merge PR → 评论 Issue → 关闭 → QE-Agent 验证 → 新反馈
└─ 成功 → merge-pr → close-issue → QE-Agent 验证 → 新反馈
```
## 提交规范