QE-Agent Workflow

QE-Agent 是一个自动化质量工程代理,专注于 main branch 的发布质量。 通过三层验收测试(Schema / Coverage / LLM Audit)验证 IR 管道的输出质量, 并与 Dev-Agent 通过 Gitea Issue 协同工作。

启动方式
bash scripts/start_qe_agent.sh — 三种模式:单次 / 持续轮询 / 交互
claude --agent agents/QE_AGENT.md — 直接启动交互模式(默认 /loop 10m 轮询)

1. 角色与边界

QE-AgentDev-Agent
关注范围main branch 健康功能开发与 bug 修复
代码tests/acceptance/skills/ scripts/
测试验收测试 (三层)UT/IT
分支test/issue-Ndev/issue-N-*
Committest: ... - Closes #Nfix: ... - Closes #N
签名[qe-agent: qa-01][da-01]
Issue 标签test-codeagent-task ci-failure

2. 三层验收测试

Layer A
Schema
确定性验证
Layer B
Coverage
结构溯源覆盖率
Layer C
QE Audit
LLM 专家审计
Report
JSON 报告
Layer方法阈值LLM
A — SchemaIR 结构验证 (rule_id / trigger / sources / actions)0 errors不需要
B — CoverageIR sources[] 对文档内容单元的引用率≥ 70%不需要
C — QE AuditLLM 逐章节评估 IR 覆盖充分性inadequate ≤ 30%deepseek-v4-flash
最终判决: 三层全部 PASS → releasable ✓ | 任意一层 FAIL → blocked ✗

3. Issue 工作流

3.1 轮询

python scripts/agent_poller.py --action list --labels test-code
python scripts/agent_poller.py --action list --labels acceptance-failure

3.2 test-code Issue 闭环

1. 领取
comment
2. 开发
tests/acceptance/
3. 本地验证
pytest
4. 提交
test/issue-N
5. PR + CI
6. merge
7. close

3.3 e2e 验证流程

  1. 识别 dev-agent 修复完毕(关联 dev issue 已关闭)
  2. git pull origin main
  3. python scripts/run_pipeline.py --parsed <path> --test
  4. 分析三层报告
  5. 全部 PASS → 关闭 test-code issue
  6. 仍有 FAIL → 重开 dev issue + 更新 test-code issue

4. Issue 生命周期规则

关闭规则

重开规则

5. Agent 间通信协议

Issue 状态是唯一通信渠道。两个 agent 共用 pzhang_zywl Gitea 账号,通过签名区分:

QE → Dev: 发现问题 → 开 dev issue (agent-task) / 重开已有 dev issue

Dev → QE: 修复完成 → 关闭 dev issue(自验证后)

QE 验收: 拉取 main → 重跑 e2e → 通过就关 test-code,不通过就重开 dev issue

6. 命令速查

操作命令
轮询 issueagent_poller.py --action list --labels test-code
查看 issueagent_poller.py --action get --issue <N>
评论agent_poller.py --action comment --issue <N> --body "..."
生命周期agent_poller.py --action lifecycle --issue <N>
创建 PRagent_poller.py --action create-pr --issue <N> --branch test/issue-<N>
查 PR CIagent_poller.py --action pr-status --pr <N>
合并 PRagent_poller.py --action merge-pr --pr <N>
跑管道python scripts/run_pipeline.py --parsed <path> --test
验收测试pytest tests/acceptance/ -v --run-acceptance
仅 Layer A+Bpytest tests/acceptance/ -v --run-acceptance -k "not test_layer_c"

7. 文件结构

tests/acceptance/
├── conftest.py              # Pytest 配置、fixtures、LLM client
├── ir_schema.py             # IR schema 验证
├── report.py                # 三层 JSON 报告
└── test_main_health.py      # Layer A → B → C

scripts/
├── agent_poller.py          # Gitea API 工具
├── run_pipeline.py          # 端到端管道运行器
├── start_qe_agent.sh        # QE-Agent 启动脚本
└── .env                     # Token 配置 (gitignored)

agents/
├── QE_AGENT.md              # QE-Agent 系统指令
└── DEV_AGENT.md             # Dev-Agent 系统指令

.gitea/workflows/
├── ci.yml                   # CI (push/PR)
└── acceptance.yml           # 手动触发验收

8. 本 Session 处理记录

Issue内容结果
#10移除硬编码路径,适配 config.pyclosed
#12实现端到端验收测试流程closed
#14跑完整 e2e 测试closed
#15Dev: IR rules=[] (多次 reopen)closed
#18再跑 e2e 测试open
#21P0: 覆盖率不足 (多次 reopen)reopened
#22P1: trigger.operator 为空closed

QE-Agent [qe-agent: qa-01] — document_analyzer project