Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ae09452d2 | |||
| 4abc56457d | |||
| 3957a32efa | |||
| 183bcb8e6c | |||
| 67d0209e2b | |||
| e59f69943c | |||
| 3644594c09 | |||
| 687e2efbf6 | |||
| 83a793d3e8 | |||
| 371252de61 | |||
| ca5ac630a8 | |||
| 27d1a74e71 | |||
| 02edacb7e2 |
@@ -63,7 +63,9 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
|
||||
|
||||
**每次新 session 启动时,立即执行:**
|
||||
|
||||
1. 读取项目章程和全局状态:`docs/PROJECT_CHARTER.md` 和 `docs/GLOBAL_STATE.md`
|
||||
1. 读取项目章程和全局状态(使用 Read 工具 + 绝对路径,不要用 Glob 搜索):
|
||||
- `C:\Users\peterz\projects\document_analyzer\docs\PROJECT_CHARTER.md`
|
||||
- `C:\Users\peterz\projects\document_analyzer\docs\GLOBAL_STATE.md`
|
||||
2. 确认环境变量已设置(GITEA_USER + ~/.gitea/config.yaml)
|
||||
3. 用 `/loop 10m` 开启 10 分钟间隔的自动轮询
|
||||
4. 轮询内容(多轮递进):
|
||||
@@ -76,6 +78,13 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
|
||||
6. 无 Issue → 报告 "main healthy,无待处理 Issue",等待下次轮询
|
||||
7. 同时保持对话开放,随时响应用户指令
|
||||
|
||||
## 上下文管理
|
||||
Context window 有限。当 session 持续较长时间时:
|
||||
1. 根据对话轮次和消息长度估计 context 使用量
|
||||
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
|
||||
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md`、`PROJECT_CHARTER.md`、Agent 角色定义
|
||||
4. 压缩后从摘要恢复上下文,继续当前任务
|
||||
|
||||
## 工作流程
|
||||
|
||||
### 1. 轮询 Issue
|
||||
|
||||
@@ -31,6 +31,13 @@ description: "document_analyzer QE-Agent: 自动化验收测试开发与质量
|
||||
|
||||
这样 QE-Agent 真正做到 **"默认轮询 + 随时互动"**。
|
||||
|
||||
## 上下文管理
|
||||
Context window 有限。当 session 持续较长时间时:
|
||||
1. 根据对话轮次和消息长度估计 context 使用量
|
||||
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
|
||||
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md`、`PROJECT_CHARTER.md`、Agent 角色定义
|
||||
4. 压缩后从摘要恢复上下文,继续当前任务
|
||||
|
||||
## 环境要求
|
||||
|
||||
开始工作前,确认以下环境变量已设置:
|
||||
|
||||
+44
-21
@@ -1,22 +1,45 @@
|
||||
{
|
||||
"permissionMode": "bypass",
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git *)",
|
||||
"Bash(python scripts/agent_poller.py *)",
|
||||
"Bash(GITEA_USER=* python scripts/agent_poller.py *)",
|
||||
"Bash(python scripts/run_pipeline.py *)",
|
||||
"Bash(python scripts/create_failure_issue.py *)",
|
||||
"Bash(python -m pytest *)",
|
||||
"Bash(python -c *)",
|
||||
"Bash(curl *)"
|
||||
]
|
||||
},
|
||||
"autoMode": {
|
||||
"allow": [
|
||||
"$defaults",
|
||||
"Running agent_poller.py with GITEA_USER env var to interact with Gitea (comment, close-issue, create-pr, merge-pr, create-issue, reopen-issue)",
|
||||
"Running Gitea API operations via scripts (agent_poller.py, create_failure_issue.py)"
|
||||
]
|
||||
}
|
||||
{
|
||||
"permissionMode": "bypass",
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git *)",
|
||||
"Bash(python scripts/agent_poller.py *)",
|
||||
"Bash(PYTHONIOENCODING=* python scripts/agent_poller.py *)",
|
||||
"Bash(GITEA_USER=* python scripts/agent_poller.py *)",
|
||||
"Bash(python scripts/run_pipeline.py *)",
|
||||
"Bash(PYTHONIOENCODING=* python scripts/run_pipeline.py *)",
|
||||
"Bash(python scripts/create_failure_issue.py *)",
|
||||
"Bash(python -m pytest *)",
|
||||
"Bash(PYTHONIOENCODING=* python -m pytest *)",
|
||||
"Bash(python -m pip *)",
|
||||
"Bash(python -c *)",
|
||||
"Bash(export GITEA_USER=*)",
|
||||
"Bash(curl *)",
|
||||
"Bash(gh *)",
|
||||
"Bash(ls *)",
|
||||
"Bash(mkdir *)",
|
||||
"Bash(cp *)",
|
||||
"Bash(mv *)",
|
||||
"Bash(rm *)",
|
||||
"Bash(touch *)",
|
||||
"Bash(echo *)",
|
||||
"Bash(which *)"
|
||||
]
|
||||
},
|
||||
"autoMode": {
|
||||
"allow": [
|
||||
"$defaults",
|
||||
"Running agent_poller.py to interact with Gitea issues, PRs, and CI: list, get, comment, close-issue, create-pr, merge-pr, create-issue, reopen-issue, pr-status, blocked-check, lifecycle",
|
||||
"Running Gitea CI/CD and pipeline operations via scripts: agent_poller.py, run_pipeline.py, create_failure_issue.py",
|
||||
"Running python -m pytest with env var prefixes for unit and integration tests",
|
||||
"Running git branch, checkout, add, commit, push, status, diff, log, pull, merge operations",
|
||||
"Installing Python packages with pip",
|
||||
"Listing, reading, creating, and managing files and directories in the project",
|
||||
"Setting environment variables like GITEA_USER",
|
||||
"Using gh CLI for GitHub/Gitea operations",
|
||||
"Using curl for HTTP requests",
|
||||
"Modifying .claude/settings.json to configure permissions and autoMode (this is explicitly required for fixing auto mode blocking issues as described in issue #110)",
|
||||
"Running export, echo, which, ls, mkdir, cp, mv, rm, touch for basic shell operations"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
# document_analyzer — PRD-to-IR Pipeline
|
||||
|
||||
基于 AI 的车机 PRD 文档解析与结构化 IR 生成 pipeline。通过 Dev-Agent 与 QE-Agent 协同迭代,探索 AI Agent 多智能体协作的软件工程闭环。
|
||||
|
||||
## 项目文档(session 启动时读取)
|
||||
|
||||
使用 Read 工具加载以下文件(绝对路径,不要用 Glob):
|
||||
|
||||
- `C:\Users\peterz\projects\document_analyzer\docs\PROJECT_CHARTER.md` — 项目愿景、目标、架构、约束
|
||||
- `C:\Users\peterz\projects\document_analyzer\docs\GLOBAL_STATE.md` — 当前阶段目标、已知问题、最近变更
|
||||
|
||||
## Gitea 配置
|
||||
|
||||
- 配置文件:`~/.gitea/config.yaml`,按 `GITEA_USER` 环境变量选择 profile
|
||||
- 默认使用人类用户身份(generic session):`export GITEA_USER=pzhangzywl`
|
||||
- Agent 身份通过各自环境变量设置(Dev: `pzhang_dev_agent_01`,QE: `pzhang_qe_agent_01`)
|
||||
- **所有 Gitea API 操作必须通过 `python scripts/agent_poller.py`**,禁止直接 curl 或硬编码 token
|
||||
|
||||
## 上下文管理
|
||||
|
||||
Context window 有限。当 session 持续较长时间时:
|
||||
1. 根据对话轮次和消息长度估计 context 使用量
|
||||
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
|
||||
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md`、`PROJECT_CHARTER.md`、Agent 角色定义
|
||||
4. 压缩后从摘要恢复上下文,继续当前任务
|
||||
|
||||
## 核心规则
|
||||
|
||||
1. 代码改动走完整流程:Issue → 分支 → 开发/UT → pytest → PR → CI → merge → 自行验证 → 关闭 Issue
|
||||
2. 关闭 Issue 必须包含 4 要素:问题 / 根因 / 修复 / 验证
|
||||
|
||||
## Agent 模式
|
||||
|
||||
- **Dev-Agent**: 启动时自动加载 `.claude/agents/dev-agent.md`(功能开发、重构、UT、接口集成测试)
|
||||
- **QE-Agent**: 启动时自动加载 `.claude/agents/qe-agent.md`(验收测试、质量门禁)
|
||||
- **Generic session**: 仅加载本文件,使用人类用户身份工作
|
||||
@@ -78,6 +78,13 @@ export GITEA_USER=pzhang_dev_agent_01 # Dev-Agent 账号
|
||||
6. 无 issue → 报告 "main healthy,无待处理 Issue",等待下次轮询
|
||||
7. 同时保持对话开放,随时响应用户指令
|
||||
|
||||
## 上下文管理
|
||||
Context window 有限。当 session 持续较长时间时:
|
||||
1. 根据对话轮次和消息长度估计 context 使用量
|
||||
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
|
||||
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md`、`PROJECT_CHARTER.md`、Agent 角色定义
|
||||
4. 压缩后从摘要恢复上下文,继续当前任务
|
||||
|
||||
## 工作流程
|
||||
|
||||
### 1. 轮询 Issue
|
||||
|
||||
@@ -30,6 +30,13 @@ description: QE Agent — 自动化验收测试开发与质量门禁。轮询 Gi
|
||||
|
||||
这样 QE-Agent 真正做到 **"默认轮询 + 随时互动"**。
|
||||
|
||||
## 上下文管理
|
||||
Context window 有限。当 session 持续较长时间时:
|
||||
1. 根据对话轮次和消息长度估计 context 使用量
|
||||
2. **使用量达 ~80% 时主动使用 `/compact` 压缩对话**
|
||||
3. 压缩时保留:当前 Issue 上下文、`GLOBAL_STATE.md`、`PROJECT_CHARTER.md`、Agent 角色定义
|
||||
4. 压缩后从摘要恢复上下文,继续当前任务
|
||||
|
||||
## 环境要求
|
||||
|
||||
开始工作前,确认以下环境变量已设置:
|
||||
|
||||
@@ -9,7 +9,7 @@ LLM configuration is read from secrets.yaml (searched in order):
|
||||
2. ~/.openclaw/config/secrets.yaml
|
||||
3. ~/.openclaw/workspace-document-analyzer/config/secrets.yaml
|
||||
|
||||
deepseek.apiKey / deepseek.baseUrl → text model (deepseek-v4-flash)
|
||||
deepseek.apiKey / deepseek.baseUrl → text model (deepseek-v4-pro)
|
||||
|
||||
Environment variables:
|
||||
TEST_IR_PATH — path to IR JSON (default: output/final/ir_final.json)
|
||||
@@ -198,11 +198,11 @@ def parsed_data(parsed_path: str | None) -> dict | None:
|
||||
class _AcceptanceLLM:
|
||||
"""Thin LLM wrapper for acceptance tests.
|
||||
|
||||
Uses deepseek-v4-flash for text (Layer C QE audit) via OpenAI-compatible API,
|
||||
Uses deepseek-v4-pro for text (Layer C QE audit) via OpenAI-compatible API,
|
||||
configured from ~/.openclaw/config/secrets.yaml.
|
||||
"""
|
||||
|
||||
TEXT_MODEL = "deepseek-v4-flash"
|
||||
TEXT_MODEL = "deepseek-v4-pro"
|
||||
IMAGE_MODEL = "qwen3-vl-plus"
|
||||
TIMEOUT = 180
|
||||
MAX_RETRIES = 3
|
||||
@@ -277,7 +277,7 @@ class _AcceptanceLLM:
|
||||
def llm_client():
|
||||
"""Create an LLM client for acceptance tests.
|
||||
|
||||
Uses deepseek-v4-flash for text (Layer C QE audit), configured from
|
||||
Uses deepseek-v4-pro for text (Layer C QE audit), configured from
|
||||
~/.openclaw/config/secrets.yaml deepseek section.
|
||||
"""
|
||||
return _AcceptanceLLM()
|
||||
|
||||
Reference in New Issue
Block a user