🐛 fix(main_loop): enforce plan lifecycle ordering

Claim the first executable plan in plan-file order after resuming any in-progress plan, preserve skipped as its own workflow phase, and document the required post-done commit gate in the agent rules.
This commit is contained in:
csh
2026-05-27 14:07:09 +08:00
parent 61afff9d48
commit 1a3ea1f425
6 changed files with 221 additions and 48 deletions
@@ -17,7 +17,8 @@
## 规则
-果任务状态变更,优先通过 `main_loop.py finish` 留痕
-本轮来自 `main_loop.py claim` 且任务状态变更,优先通过
`main_loop.py finish` 留痕
- 未验证内容必须显式说明
- 只写对下一轮仍重要的信息
- 不手工改写 `workflow-state``plan-status` 状态块
@@ -26,15 +27,18 @@
1. 核对已完成项与未完成项
2. 核对已运行验证与未运行验证
3. 核对 `main_loop.py finish` 是否已经写回 `plan-status`
4. 核对 `workflow-state.phase` 是否与当前结果一致
3. 如本轮来自 `main_loop.py claim`,核对 `main_loop.py finish`
是否已经写回 `plan-status`
4. 如本轮来自 `main_loop.py claim`,核对 `workflow-state.phase`
是否与当前结果一致
5. 如需回写上下文,更新 `active-context``progress` 上半部分和 `decisions`
6. 输出本轮摘要与下一步
## 状态留痕复核
- `main_loop.py finish` 是否已经写回 `plan-status`
- `workflow-state.phase` 是否与当前结果一致
- 如本轮来自 `main_loop.py claim``main_loop.py finish` 是否已经写回
`plan-status`
- 如本轮来自 `main_loop.py claim``workflow-state.phase` 是否与当前结果一致
- 如为代码类执行,`workflow-state` 中是否保留了
`executor=executing-plans` 与既定 `constraints`
@@ -59,7 +63,7 @@
## 停止条件
- 如状态未写回,先完成留痕再收尾
-已领取 Plan 但状态未写回,先完成留痕再收尾
- 如验证不足以支持交付,停止并标记风险
---