20 Commits

Author SHA1 Message Date
pangtong-fujunshi 027ae59d40 Merge PR #105
Deploy / ci (push) Failing after 9s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 2s
Deploy / notify-deploy-success (push) Successful in 0s
2026-06-20 14:49:33 +00:00
cfdaily 12f6ac3b1f [moz] feat(prompt): toolchain steps 加文档同步 + 司马懿/庞统 review 加需求-设计-编码一致性检查
CI / lint (pull_request) Successful in 49s
CI / test (pull_request) Successful in 47s
CI / frontend (pull_request) Successful in 19s
CI / notify-on-failure (pull_request) Successful in 0s
改动:
- toolchain_routes.py: issue_assigned/review_result/ci_failure steps 加文档同步 step
- toolchain_handler.py: ToolchainConstraintsSection 加 §6 文档同步约束 + Red Flag
- bootstrap.py: reviewer 硬约束加需求-设计-编码一致性检查
- ticker.py: 庞统 round review 三问第 2 问加 docs/design 同步确认
- prompt_composer.py: DeliveryChecklistSection 从弱提醒改为强制步骤

Closes #105
2026-06-20 22:47:11 +08:00
pangtong-fujunshi 623942bd15 Merge PR #104: [moz] docs(§21): v3 discussion prompt 重构 + 分支创建时机 + L2 约束
Deploy / ci (push) Failing after 15s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 0s
Deploy / notify-deploy-success (push) Successful in 1s
2026-06-20 13:31:02 +00:00
cfdaily 280435119e [moz] docs(§21): 新增 §14b 分支与 PR 生命周期管理
CI / lint (pull_request) Successful in 24s
CI / test (pull_request) Successful in 1m7s
CI / frontend (pull_request) Successful in 23s
CI / notify-on-failure (pull_request) Successful in 0s
§14b.1 Sub Issue 完整生命周期(9 步:创建→分支→编码→PR→CI→Review→修改→Merge→清理)
§14b.2 Parent Issue 完整生命周期(5 步:创建→讨论→执行→Round Review→关闭)
§14b.3 核心规则(分支:Issue=1:1, 分支:PR=1:1, Closes #N, Parent #M)
§14b.4 多分支并行场景
§14b.5 PR body 标准模板
2026-06-20 21:28:46 +08:00
cfdaily 65eb7d6a99 [moz] docs(§21): fix 姜维 S1 分支名前缀按 type + S2 sub Issue body 加 Depends
CI / lint (pull_request) Successful in 19s
CI / test (pull_request) Successful in 1m4s
CI / frontend (pull_request) Successful in 12s
CI / notify-on-failure (pull_request) Successful in 0s
2026-06-20 21:24:28 +08:00
cfdaily f4c995270c [moz] docs(§21): v3 §13 discussion prompt 重构 + 分支创建时机 + L2 约束
CI / lint (pull_request) Successful in 22s
CI / test (pull_request) Successful in 36s
CI / frontend (pull_request) Successful in 15s
CI / notify-on-failure (pull_request) Successful in 0s
§13.2 Discussion Prompt 重构(参考 Edict/APM/PAV 优秀实践):
  - 新增'你是谁'段——agent 有角色定位感
  - 新增'你必须做什么'——4 条必须回应维度(定位/建议/认领/风险)
  - Comment 格式以角色名开头——其他人知道是谁在说
  - 底线约束:不 comment = 未参与

§13.4 Parent Issue sub 注册——agent 自己 comment 注册
§13.5 分支创建时机——明确 discussion 不碰 git,executor 创建分支
§13.6 L2 输入输出约束(PAV 循环)——每种 prompt 明确输入/输出/验证
2026-06-20 21:20:51 +08:00
pangtong-fujunshi 4a154f8e1a Merge pull request '[moz] fix(handler): ToolchainApiSection 补充 Gitea Review API curl 指引' (#102) from fix/toolchain-review-api-guidance into main
Deploy / ci (push) Failing after 8s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 2s
Deploy / notify-deploy-success (push) Successful in 0s
2026-06-20 11:28:48 +00:00
cfdaily 735b8c4fed [moz] fix(handler): ToolchainApiSection 补充 Gitea Review API curl 指引
CI / lint (pull_request) Successful in 23s
CI / test (pull_request) Successful in 39s
CI / frontend (pull_request) Successful in 23s
CI / notify-on-failure (pull_request) Successful in 0s
根因:姜维在 PR comment 中写 Review 而非通过 Review API 提交。
原因:steps 写了'提交 Review(Gitea API: POST .../reviews)'但
ToolchainApiSection 中没有 Review API 的 curl 示例。agent 找不到
怎么提交,就用最接近的 comment API 写 Review。

修复:在 ToolchainApiSection 中增加'提交 PR Review'段落,
含完整 curl 示例 + event 参数说明 + ⚠️ 必须用 Review API 提交。
2026-06-20 19:26:18 +08:00
pangtong-fujunshi 2e2edd2b00 Merge PR #101: [moz] docs(§21): v2 补充 AI native 能力完整性
Deploy / ci (push) Failing after 9s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 0s
Deploy / notify-deploy-success (push) Successful in 0s
2026-06-20 11:17:00 +00:00
cfdaily b384433c80 [moz] docs(§21): fix 姜维 S1(同步 §20 task_state DDL)+ S2(SQL 语义变化说明)
CI / lint (pull_request) Successful in 26s
CI / test (pull_request) Successful in 33s
CI / frontend (pull_request) Successful in 14s
CI / notify-on-failure (pull_request) Successful in 0s
2026-06-20 18:59:18 +08:00
cfdaily dceddeff45 [moz] docs(§21): fix M1 §11/§12 表格截断 + 重编号 §18 不做的事
CI / lint (pull_request) Successful in 14s
CI / test (pull_request) Successful in 24s
CI / frontend (pull_request) Successful in 11s
CI / notify-on-failure (pull_request) Successful in 0s
2026-06-20 18:58:26 +08:00
cfdaily 31028a7e6f [moz] docs(§21): v2 补充 §12-§17 AI native 能力完整性
CI / lint (pull_request) Successful in 20s
CI / test (pull_request) Successful in 43s
CI / frontend (pull_request) Successful in 14s
CI / notify-on-failure (pull_request) Successful in 0s
§12: 14 项 AI native 能力对照表(全部可保留)
§13: Discussion 能力保留(DISCUSSION_PROMPT + Boids 四条不变)
§14: Agent 自建 sub Issue 模式(标题 [repo][sub][parent #N])
  - 替代 claim 竞争:各 agent 自建 sub + assign 自己
  - 重复不怕:庞统 round review 引导统一
§15: @mention 通知迁移(mention_queue 数据源改为 webhook)
§16: Round review 迁移(task_state parent_issue 映射)
§17: 无缝接续完整迁移(handoff/depends_on/retry/状态转换)
2026-06-20 18:53:31 +08:00
pangtong-fujunshi 6a73d6d6c7 Merge PR #97: [moz] docs(21): 统一工具链设计定稿
Deploy / ci (push) Failing after 7s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 1s
Deploy / notify-deploy-success (push) Successful in 0s
2026-06-20 04:30:09 +00:00
cfdaily 576cd96b43 [moz] ci: 去掉 pip install --no-cache-dir,启用 pip 缓存加速 test job
CI / lint (pull_request) Successful in 17s
CI / test (pull_request) Successful in 2m34s
CI / frontend (pull_request) Successful in 23s
CI / notify-on-failure (pull_request) Successful in 0s
根因:--no-cache-dir 每次全量下载 8 个包(3 分钟),pytest 实际只跑 3 秒。
姜维确认安全去掉(commit f6f26d7 为排查 dist-info 问题添加,现已不适用)。
2026-06-20 12:04:35 +08:00
cfdaily 48c2b8ea3d [moz] docs(§21): 新增 §11 Issue closed 事件处理设计
CI / lint (pull_request) Successful in 18s
CI / test (pull_request) Successful in 9m35s
CI / frontend (pull_request) Successful in 14s
CI / notify-on-failure (pull_request) Successful in 0s
问题:Issue 被关闭时 daemon 不感知、创建者收不到通知
设计:_handle_issues 增加 action=closed 分支
  - 通知 Issue 创建者(非关闭者)
  - 纯通知类型(auto-pass)
  - 包含关闭者 + 修复摘要
2026-06-20 11:47:03 +08:00
cfdaily e89bd51d7c [moz] docs(§21): fix 姜维 S1-S4(模板关系说明 + ci_failure 终态修正 + action report 识别规范 + infrastructure 模板)
CI / lint (pull_request) Successful in 18s
CI / test (pull_request) Successful in 17m29s
CI / frontend (pull_request) Successful in 15s
CI / notify-on-failure (pull_request) Successful in 0s
2026-06-20 11:45:38 +08:00
cfdaily 4c3d125a30 [moz] docs(§21): fix S1 typo + S2 PriorContextSection 改造标注 + S3 CI status webhook 风险 + G1 refactor 测试命令 2026-06-20 11:45:38 +08:00
cfdaily 59499798ea [moz] docs(§21): Unified Toolchain Design — 统一工具链工作流
5 个割裂点统一解决:
1. agent API 统一到 Gitea(去掉黑板 API 引用)
2. steps 模板化(config/toolchain-templates.yaml)
3. issue_assigned 按 type/* 6 路分流(feature/impl/bug/docs/refactor/test)
4. action_type 和 business_type 分离
5. 完成检测改为终态事件 + 输出约束(output_template)

黑板无缝接续机制迁移:
- 前序产出 → Issue body Depends 引用
- handoff comment → Issue/PR comment
- 审查结果 → PR Review

L2 prompt section 重组(L0/L1/L3 不变)
2026-06-20 11:45:38 +08:00
jiangwei-infra 2febe54920 Merge PR #99: [moz] fix(ci): pin pydantic<2 for Python 3.9 compatibility
Deploy / ci (push) Failing after 8s
Deploy / deploy (push) Has been skipped
Deploy / notify-deploy-failure (push) Successful in 1s
Deploy / notify-deploy-success (push) Successful in 0s
2026-06-20 03:13:12 +00:00
cfdaily 59c95d4125 [moz] fix(ci): pin pydantic<2 for Python 3.9 compatibility
CI / lint (pull_request) Successful in 16s
CI / test (pull_request) Successful in 3m26s
CI / frontend (pull_request) Successful in 21s
CI / notify-on-failure (pull_request) Successful in 0s
CI runner 使用系统 Python 3.9.6,pydantic 2.x 需要 >=3.10。
不加约束时 pip 间歇性无法找到兼容版本(flaky)。
项目仅使用 BaseModel(1.x/2.x 均兼容),pin <2 安全。

Closes #98
2026-06-20 11:06:45 +08:00
8 changed files with 1062 additions and 10 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ jobs:
rm -rf /tmp/ci-venv-test
python3 -m venv /tmp/ci-venv-test
/tmp/ci-venv-test/bin/pip install --quiet --upgrade pip
/tmp/ci-venv-test/bin/pip install --quiet --no-cache-dir fastapi pydantic pyyaml uvicorn requests pytest pytest-asyncio httpx
/tmp/ci-venv-test/bin/pip install --quiet 'fastapi' 'pydantic<2' pyyaml uvicorn requests pytest pytest-asyncio httpx
- name: Debug environment
run: |
+1
View File
@@ -35,3 +35,4 @@ inbox/*.jsonl
# E2E test data
data/e2e-*/
data/_mail/
File diff suppressed because it is too large Load Diff
+7 -4
View File
@@ -650,9 +650,10 @@ async def _handle_pull_request_review(payload: Dict[str, Any]) -> None:
else: # REQUEST_CHANGES
tc_steps = [
"按审查意见逐条修改代码",
"文档同步:如审查涉及设计/接口变更,同步更新 docs/design/ 对应文档",
"push 到原分支 → CI 自动跑",
"CI 通过后等重新 Review",
"提交 action reportPOST http://localhost:8083/api/projects/_toolchain/tasks/<task_id>/commentscomment_type=action_report",
"提交 action reportPOST http://localhost:8083/api/projects/_toolchain/tasks/<task_id>/commentscomment_type=action_report— 报告中必须说明文档是否需要更新及处理结果",
]
_send_toolchain_task(
to_agent=pr_author,
@@ -1034,10 +1035,11 @@ async def _handle_issues(payload: Dict[str, Any]) -> None:
steps=[
f"在开发目录执行 git 操作:\n a. git checkout main && git pull origin main\n b. git checkout -b fix/{issue_number}-{brief}",
"编码 + 写 UT",
"文档同步:如果本次改动涉及设计变更或接口变更,在同一分支更新 docs/design/ 对应文档。如无需更新,在 action report 中说明「文档无需更新」",
f"git add -A && git commit -m \"[moz] fix: {issue_title[:30]}\" && git push origin fix/{issue_number}-{brief}",
f"CI 通过后创建 PRGitea API: POST /repos/{repo}/pullshead: fix/{issue_number}-{brief}, base: main",
f"CI 通过后创建 PRGitea API: POST /repos/{repo}/pullshead: fix/{issue_number}-{brief}, base: main— PR body 必须含 Closes #{issue_number}",
"等 Review",
"提交 action reportPOST http://localhost:8083/api/projects/_toolchain/tasks/<task_id>/commentscomment_type=action_report",
"提交 action reportPOST http://localhost:8083/api/projects/_toolchain/tasks/<task_id>/commentscomment_type=action_report— 报告中必须说明文档是否需要更新及处理结果",
],
context_data={
"issue_number": issue_number,
@@ -1153,7 +1155,8 @@ async def _handle_issue_comment(payload: Dict[str, Any]) -> None:
steps=[
"查看完整 CI 日志(PR 页面或 Gitea Actions 页面)",
"根据 CI 日志判断失败原因类型:\n a. 代码问题(lint/test 失败)→ 修复失败的测试 → push 到原分支 → CI 自动重跑\n b. 基础设施问题(runner 环境/Python/venv/Gitea/网络故障)→ 在该仓库创建 Issue 指派 jiangwei-infra(见下方「需要创建 Issue 时」),label 必须包含 type/infrastructure",
"提交 action reportPOST http://localhost:8083/api/projects/_toolchain/tasks/<task_id>/commentscomment_type=action_report)— 报告中说明判断的原因类型和执行的操作",
"文档同步:如修复涉及设计/接口变更,同步更新 docs/design/ 对应文档",
"提交 action reportPOST http://localhost:8083/api/projects/_toolchain/tasks/<task_id>/commentscomment_type=action_report)— 报告中说明判断的原因类型和执行的操作,以及文档是否需要更新",
],
context_data={
"pr_number": issue_number,
+1
View File
@@ -152,6 +152,7 @@ class BootstrapBuilder:
constraints.extend([
"- 审查结果必须明确 pass/fail",
"- 评审意见须附证据(文件:行号)",
"- 需求-设计-编码一致性:PR 改动是否和 Issue/设计文档描述一致?如改了实现但 docs/design 未同步更新,在 Review 中指出",
])
elif role == "planner":
constraints.extend([
+5 -4
View File
@@ -186,10 +186,11 @@ class DeliveryChecklistSection:
priority: int = 55 # CONSTRAINTS(50) 和 EXTENSION(60) 之间
CHECKLIST_TEXT = (
"## 交付检查\n"
"完成代码改动前确认\n"
"- 改了实现 → docs/design/ 对应设计文档是否需要更新\n"
"- 改了实现 → tests/ 是否有对应测试脚本需要更新\n"
"## 交付检查(强制)\n"
"⚠️ 这是必须执行的步骤,不是提醒。代码改动完成后,以下检查每一项都要有明确结论\n"
"- 改了实现 → docs/design/ 对应设计文档是否需要更新?需要则在同一 PR 中更新\n"
"- 改了实现 → tests/ 是否有对应测试脚本需要更新?需要则在同一 PR 中更新\n"
"- action report 中必须逐项说明上述检查结果(如「文档无需更新」「测试已补充」)\n"
"- 所有成果物变更通过 PR 流程:PR review 把关设计合理性,CI 把关代码质量,CD 把关部署正确性\n"
)
+1 -1
View File
@@ -513,7 +513,7 @@ class Ticker:
### 三问
1. Goal 还清晰吗?(是否有 goal drift)
2. 成果物覆盖 goal 了吗?(逐条检查验收标准)
2. 成果物覆盖 goal 了吗?(逐条检查验收标准 + 确认 docs/design 是否同步更新
3. 下一轮需要做什么?(创建新 sub tasks / 标记完成 / 调整方向)
### 失败处理
+19
View File
@@ -166,6 +166,19 @@ class ToolchainApiSection:
"",
"⚠️ 不要使用 Mail API(飞鸽传书)。所有协作通过 Gitea 留痕。",
"",
"### 提交 PR Review",
"",
"如果步骤中要求提交 Review(审查 PR):",
"```bash",
f'curl -s -X POST "{_GITEA_BASE}/repos/{{repo}}/pulls/{{pr_number}}/reviews" \\',
' -H "Authorization: token <your-token>" \\',
' -H "Content-Type: application/json" \\',
' -d \'{"event": "approved", "body": "审查结论"}\'',
"```",
"",
"event 可选:approved(通过)/ request_changes(驳回)",
"⚠️ 必须用 Review API 提交,不要在 PR comment 中写 Review。",
"",
"### 需要创建 Issue 时",
"",
"如果步骤中要求创建 Issue 指派他人(如 jiangwei-infra):",
@@ -235,6 +248,11 @@ class ToolchainConstraintsSection:
'- 不要使用 Mail API(飞鸽传书)发送消息',
'- 你的所有操作都在 toolchain 流程内,通过 Gitea 留痕',
"",
"### 6. 文档同步(涉及代码改动时)",
'- 改了实现 → 检查 docs/design/ 对应设计文档是否需要更新',
'- 改了实现 → 检查 tests/ 是否有对应测试脚本需要更新',
'- action report 中必须说明文档是否需要更新及处理结果(如「文档无需更新」)',
"",
"### Red Flags(如果脑海中出现以下想法,说明你错了)",
"",
'| Agent 想法 | Red Flag 驳回 |',
@@ -246,6 +264,7 @@ class ToolchainConstraintsSection:
'| “步骤太多了,选几个做就行” | ❌ 错!必须逐条执行,不可跳过 |',
'| “这个步骤不适用于当前情况” | ❌ 如果确实不适用,在 action report 中说明原因,但其他步骤必须执行 |',
'| “CI/部署失败不是我代码的问题,我什么也不用做” | ❌ 错!即使是基础设施问题,你也必须创建 Issue 指派 jiangwei-infrabody 含错误来源链接 + 日志 + 判断依据),并在 action report 中说明。不能只报告“不是我的问题”就完事 |',
'| "文档以后再说" | ❌ 错!文档同步和代码改动在同一 PR 中完成,action report 中必须说明文档处理情况 |',
"",
]
return "\n".join(lines)