@namewta/speculo 0.8.10 → 0.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/canonical/canonical-specdev-goal-plan.md +14 -4
- package/template/canonical/canonical-specdev-orchestrate-implementation.md +27 -7
- package/template/canonical/canonical-specdev-tickets.md +5 -2
- package/template/workflows/specdev/I-implement/I-implement.md +6 -3
- package/template/workflows/specdev/I-implement/evidence-template.md +13 -0
- package/template/workflows/specdev/O-orchestrate-implementation/execution-loop.md +3 -2
- package/template/workflows/specdev/P-goal-plan/completion-control.md +3 -0
- package/template/workflows/specdev/P-goal-plan/lead-orchestration.md +6 -2
- package/template/workflows/specdev/common/skills/dev-worktree/references/finalize.md +5 -2
package/package.json
CHANGED
|
@@ -331,9 +331,13 @@ implementation 返回至少包含:Ticket ID、workspace locator、最终 commi
|
|
|
331
331
|
|
|
332
332
|
## 6. Lead 验收
|
|
333
333
|
|
|
334
|
-
Lead 核对基线、路径、commit、dirty 状态、项目事实与非 E2E 结果;不接受 subagent 自报的 Evidence 或 E2E pass。required implementation 候选进入 dev-worktree candidate-merge;current implementation 由 Lead 在同一 parent branch/current workspace 做 direct-parent 验证。read-only 结果由 Lead
|
|
334
|
+
Lead 核对基线、路径、commit、dirty 状态、项目事实与非 E2E 结果;不接受 subagent 自报的 Evidence 或 E2E pass。required implementation 候选进入 dev-worktree candidate-merge;current implementation 由 Lead 在同一 parent branch/current workspace 做 direct-parent 验证。read-only 结果由 Lead 复核后写入对应权威工件。首次失败可返回同一 workspace/worktree 修正或标记 blocked。
|
|
335
335
|
|
|
336
|
-
|
|
336
|
+
同一 Ticket 在 implementation/review 反复返回相同 blocker、下一轮没有产生新证据,或 integration attempts 达到有效 Plan 的 `integration_attempt_limit` 时,停止把相同请求直接退回原 implementation owner。Lead 保留 workspace、commit/candidate 与失败事实,在现有 Ticket Evidence 中回答四项:共同失败模式、最可能原因、下一轮具体改变、下一 owner/路由。Lead 可改写指导、调整 Ticket 内实现路径、更换 implementation owner 或自行实现;若发现 Ticket、Goal、父 Plan、Spec/ADR 已失效,则返回对应 owner。
|
|
337
|
+
|
|
338
|
+
只有 Lead 的复盘决定已写入 Evidence,才可将当前 Ticket 的 `attempts` 重置为 `0` 并发出新 Dispatch Packet;新 Packet 必须引用该 Evidence 并明确相较上一轮改变了什么。没有实质变化时不得重新派发同一请求。上限因此是 Lead 复盘触发点,不是 Ticket 的永久失败终态。
|
|
339
|
+
|
|
340
|
+
**完成标准**:每次写入只有一个 Ticket/owner/worktree;所有 SpecDev 状态由 Lead 落盘;派单、返回与重复失败后的 Lead 决定可从 Evidence 恢复。
|
|
337
341
|
|
|
338
342
|
</lead-orchestration>
|
|
339
343
|
|
|
@@ -371,9 +375,12 @@ Lead 在每个 Gate 汇总覆盖 Evidence、接口/数据/兼容状态、candida
|
|
|
371
375
|
- direct-parent/candidate 冲突或检查失败:父分支不动,integration 记 `failed`,Ticket 回到 `in_progress`/`blocked`;
|
|
372
376
|
- 父 HEAD 漂移:integration 记 `stale`,从最新父分支重建并重跑;
|
|
373
377
|
- E2E required 失败:父分支不动,保留失败命令、适用 checkpoint 和恢复条件;
|
|
378
|
+
- 同一 blocker 反复出现、下一轮没有新证据,或 integration attempts 达到有效上限:停止自动重复,保留 workspace、checkpoint/candidate 和全部失败事实,将受影响 Ticket 标为 `blocked` 并返回有效 Lead;Lead 按 lead-orchestration 在 Evidence 写复盘决定后,才可重置该 Ticket 的 `attempts` 并以有实质变化的新 Packet 重新派发;
|
|
374
379
|
- 命中当次 Dispatch Packet/候选协议的停止条件、继续修正已无合理收益或需要新产品决定:停止受影响 Wave,按 deviation control 返回契约 owner;
|
|
375
380
|
- Lead 会话变化:读取 Goal Plan、Ticket、change worktree 状态与最新 Evidence,从最后不可变 checkpoint 恢复。
|
|
376
381
|
|
|
382
|
+
父 O-orchestrate-implementation 的 Lead 可继续其他不受影响的 ready frontier;单个 Ticket 进入 Lead 复盘不自动终止整个父循环。
|
|
383
|
+
|
|
377
384
|
## 5. Change 完成 owner
|
|
378
385
|
|
|
379
386
|
Lead 是 Goal Plan change 的唯一完成 owner。没有 Goal Plan 的单 Ticket/Direct Spec 由当前 I-implement owner 按 change completion 规则完成。Archive 不补造完成证据。
|
|
@@ -1028,7 +1035,9 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1028
1035
|
4. 确认 source-worktree 必跑非 E2E 检查已执行,且没有把 E2E 自报为通过;
|
|
1029
1036
|
5. 重读父分支 checkout clean、HEAD 与 remote/本地约定,记录 `parent_before_sha`。
|
|
1030
1037
|
|
|
1031
|
-
|
|
1038
|
+
建立新 candidate 前先比较 Ticket `attempts` 与有效 Plan 的 `integration_attempt_limit`。若前一轮尚未通过且当前 attempts 已达到上限,不创建或重建 candidate、不增加 attempts;保留 source workspace、旧 candidate 与失败记录,将 Ticket/worktree 标为 `blocked`,向有效 Lead 返回 `integration-attempt-limit`。
|
|
1039
|
+
|
|
1040
|
+
其他预检失败时保持 `review`/`blocked`,不开始候选合并。
|
|
1032
1041
|
|
|
1033
1042
|
## 2. 建立 parent-candidate checkout
|
|
1034
1043
|
|
|
@@ -1049,7 +1058,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1049
1058
|
- 项目要求的 typecheck/lint/build 或其他父状态检查;
|
|
1050
1059
|
- 仅当 Ticket/Goal Plan `e2e.required=true` 时运行对应 E2E。
|
|
1051
1060
|
|
|
1052
|
-
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha
|
|
1061
|
+
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha`。当本轮失败使 attempts 达到 Goal Plan 快照的 `integration_attempt_limit` 时,保存本轮失败并返回 Lead 复盘;不得继续机械修正、放宽断言、删除检查或发明行为。上限是 Lead 复盘触发点,不是永久禁止恢复。
|
|
1053
1062
|
|
|
1054
1063
|
## 4. 推进父分支
|
|
1055
1064
|
|
|
@@ -1064,6 +1073,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1064
1073
|
## 5. 失败、清理与恢复
|
|
1065
1074
|
|
|
1066
1075
|
- candidate 检查失败:父分支不动,Ticket 回 `in_progress` 或 `blocked`,来源 worktree 保留;
|
|
1076
|
+
- 达到 integration attempt 上限:保留全部 source/candidate checkpoint 与失败记录,等待 Lead 在 Ticket Evidence 写明共同失败模式、最可能原因、下一轮改变和下一 owner/路由;只有形成有实质变化的新 Dispatch Packet 后,Lead 才可将当前 Ticket `attempts` 重置为 `0` 并重新进入 finalize;
|
|
1067
1077
|
- 父 HEAD 漂移:旧 candidate 记 `stale`,完整重建并重跑;
|
|
1068
1078
|
- 成功后可按 candidate integration 授权回收 transient integration worktree/branch;来源 branch/worktree 不自动清理。获得独立 cleanup 授权并清理后,只将生命周期状态改为 `removed`,完整保留已经通过的集成与 E2E 证据;
|
|
1069
1079
|
- push、PR、remote merge、deploy、migration 和生产动作仍需各自授权。
|
|
@@ -221,12 +221,13 @@ current 策略每个 Wave 只能含一个节点。required 策略可以放入多
|
|
|
221
221
|
|
|
222
222
|
## 自动继续边界
|
|
223
223
|
|
|
224
|
-
子 Ticket 正常完成、candidate stale
|
|
224
|
+
子 Ticket 正常完成、candidate stale 后可机械重建、已批准且产生新证据的局部实现修正和下一 frontier 选择不再次询问用户。同一 Ticket 反复返回相同 blocker、没有新证据或达到 integration attempt 上限时,停止该 Ticket 的自动重复并回到父 Lead 决策点;父 Lead 重读其全部 Evidence,记录共同失败模式、最可能原因、下一轮改变和下一 owner/路由,再决定改写指导、换 owner、自行实现或返回上游契约 owner。只有形成有实质变化的新 Dispatch Packet 后,才可重置该 Ticket attempts 并重新派发。
|
|
225
|
+
|
|
226
|
+
这个回转不自动终止整个父循环;父 Lead 可以继续其他不受影响的 ready frontier。以下情况才停止并等待用户或上游新决定:
|
|
225
227
|
|
|
226
228
|
- 高影响合同、范围、架构、数据、安全、迁移或验收需要新决定;
|
|
227
229
|
- implementation commit、integration 或不可逆动作缺少授权;
|
|
228
230
|
- dependency/serialization/path owner 无法由权威事实裁决;
|
|
229
|
-
- 连续集成尝试达到父 Plan 上限;
|
|
230
231
|
- 无合法 frontier 但仍有非终态 Ticket。
|
|
231
232
|
|
|
232
233
|
停止时父 Plan 保存最后 accepted 节点、active/stale dispatch、Git checkpoint、blocker、owner、下一合法动作和恢复重读清单。
|
|
@@ -563,15 +564,17 @@ E2E 是否需要由 Ticket/Goal Plan 的实际跨边界风险决定,不限于
|
|
|
563
564
|
|
|
564
565
|
`current` Ticket 模式跳过 source worktree、candidate merge 和 candidate checkout。Lead 在当前 workspace 运行 Ticket 要求的适用集成/回归与 E2E,记录运行环境、命令、退出码和摘要;E2E 不得派给其他 agent。失败时不声明完成,保留 Ticket commit、父 HEAD 和恢复条件。全部通过后重读父 HEAD/tree 并记录 `result_sha`。Direct Spec 模式同样跳过 source worktree、candidate merge 和父分支推进。
|
|
565
566
|
|
|
567
|
+
无论失败发生在 implementation、review、direct-parent 还是 parent-candidate,同一 Ticket 反复返回相同 blocker、下一轮没有产生新证据,或 integration attempts 达到有效 Plan 上限时,都停止自动退回原 implementation owner。Lead 保留当前 workspace/worktree、implementation/source commit、旧 candidate 和失败命令,在 Ticket Evidence 记录失败历史,并将 Ticket/worktree 标为 `blocked`。当前 change 属于父实现时返回父 O Lead;否则返回 Goal Plan Lead,或无 Goal Plan 时的当前 I Lead。Lead 按 lead-orchestration 完成最小复盘并形成有实质变化的新 Dispatch Packet 后,才可重置 attempts 和重新派发;契约已失效则返回真正 owner。
|
|
568
|
+
|
|
566
569
|
### 8. Evidence、状态与完成
|
|
567
570
|
|
|
568
|
-
Lead 使用 下方 `<evidence-template>` 标签 写入 Ticket Evidence;Direct Spec 按该模板的 Direct Spec 适配说明写 `specdev/changes/{change}/evidence/direct-spec.md`。Ticket Evidence 按策略记录 implementation/source、适用 candidate/result SHA、派单/返回、两层验证、双轴审查、E2E disposition
|
|
571
|
+
Lead 使用 下方 `<evidence-template>` 标签 写入 Ticket Evidence;Direct Spec 按该模板的 Direct Spec 适配说明写 `specdev/changes/{change}/evidence/direct-spec.md`。Ticket Evidence 按策略记录 implementation/source、适用 candidate/result SHA、派单/返回、两层验证、双轴审查、E2E disposition、路径审计、失败历史与适用 Lead 复盘、偏差和残余风险;Direct Spec Evidence 使用实施前基线与 current workspace 最终 checkpoint,不伪造 Ticket/worktree/candidate 字段。
|
|
569
572
|
|
|
570
573
|
Ticket 正常状态:`ready → in_progress → review → done`。`required` 的 `done` 要求 change worktree 已完成集成(`integrated` 或 `removed`)、父 HEAD=result SHA 且包含 source commit;`current` 的 `done` 要求 current workspace clean、direct-parent 验证通过且父 HEAD=result SHA。阻塞使用 `blocked`,契约偏差使用 `deviated`,无需改动使用 `cancelled`。Direct Spec 由当前 I-implement owner 按 下方 `<change-completion>` 标签 关闭 change。
|
|
571
574
|
|
|
572
575
|
按存在和当前模式同步 Ticket、Tickets Map、Goal Plan、`specdev/changes/{change}/.status.json` 和全局状态;Direct Spec 不创建缺失的 Ticket/Map/Goal Plan。最后一个计划内 Ticket 完成后,Goal Plan 的 Lead 按 change completion 关闭;无 Goal Plan 的当前 I owner 承担同一门禁。需要远程 reconcile 时返回 T-triage,否则进入 Archive。
|
|
573
576
|
|
|
574
|
-
当前 change 属于未完成父实现 change 时,单个组合 Ticket
|
|
577
|
+
当前 change 属于未完成父实现 change 时,单个组合 Ticket 完成、阻塞或触发 Lead 复盘,且子状态与 Evidence 已写入后,必须自动返回 “跨 change 实现编排阶段”,由父 Lead 重读全部成员并决定重新派发、返回上游或继续下一 frontier;不得要求用户逐个重新激活,不得直接归档子 change,也不得从本 Work 实现另一个成员。
|
|
575
578
|
|
|
576
579
|
运行:
|
|
577
580
|
|
|
@@ -584,13 +587,14 @@ node Speculo Node 校验器 \
|
|
|
584
587
|
|
|
585
588
|
### 9. 返回
|
|
586
589
|
|
|
587
|
-
Ticket 模式返回 Ticket/change 状态、Evidence 完整路径、workspace locator、implementation/source、适用 candidate/result SHA、父分支、E2E disposition
|
|
590
|
+
Ticket 模式返回 Ticket/change 状态、Evidence 完整路径、workspace locator、implementation/source、适用 candidate/result SHA、父分支、E2E disposition、适用 Lead 复盘决定、未验证项和下一路由。Direct Spec 返回 change 状态、`specdev/changes/{change}/evidence/direct-spec.md`、current workspace、实施前/最终 checkpoint、适用 E2E 和下一路由。push、PR、remote merge、deploy、migration、生产动作及来源 branch/worktree cleanup 只在独立授权时执行。
|
|
588
591
|
|
|
589
592
|
## 完成标准
|
|
590
593
|
|
|
591
594
|
- Ticket 模式按策略完成 current workspace/direct-parent 或 worktree/implementation commit/candidate gate;Direct Spec 的轻量合同、current workspace checkpoint、双轴审查和最终验证完整;
|
|
592
595
|
- current Ticket 的适用 E2E 由 Lead 在 current workspace 运行;required Ticket 的适用 E2E 由 Lead 在 parent-candidate 运行;Direct Spec 适用 E2E 由 Lead 在 current workspace 运行;
|
|
593
596
|
- Lead 独立核对并写全部 SpecDev 工件;
|
|
597
|
+
- 重复失败或 integration attempt 上限只触发 Lead 复盘;没有 Evidence 中的原因、改变和 owner 决定,不得重置 attempts 或重复派发;
|
|
594
598
|
- current Ticket 父分支只推进到通过的 direct-parent 验证 commit;required Ticket 父分支只推进到通过的 candidate;两者 Ticket Done 都必须与实际 Git 一致;Direct Spec 的完成状态与 current workspace 最终 checkpoint 一致;
|
|
595
599
|
- 实际路径、验证、偏差和状态可由 Evidence 恢复;
|
|
596
600
|
- validator 无 error。
|
|
@@ -878,6 +882,19 @@ subagent 不写本 Evidence;以上内容由 Lead 从实际 workspace、Git 和
|
|
|
878
882
|
|
|
879
883
|
集成失败时明确父 HEAD 是否推进、失败命令、旧 SHA 和恢复条件。
|
|
880
884
|
|
|
885
|
+
### Failure History And Lead Recovery
|
|
886
|
+
|
|
887
|
+
| 轮次 | 阶段 | Checkpoint/candidate | 失败事实 | 下一轮变化 |
|
|
888
|
+
|---|---|---|---|---|
|
|
889
|
+
| ... | implementation / review / direct-parent / parent-candidate | `<sha-or-locator>` | blocker、命令与摘要 | 首次失败待定 / Lead 决定 |
|
|
890
|
+
|
|
891
|
+
- **共同失败模式:** not-applicable / ...
|
|
892
|
+
- **最可能原因:** not-applicable / ...
|
|
893
|
+
- **下一轮具体改变:** not-applicable / ...
|
|
894
|
+
- **下一 owner/路由:** not-applicable / same owner / new owner / Lead / upstream owner
|
|
895
|
+
|
|
896
|
+
首次失败不要求额外分类;同一 blocker 反复出现、下一轮没有新证据,或 integration attempts 达到有效上限时,Lead 必须填写以上四项。重置 attempts 后仍保留此前轮次,不覆盖失败历史。
|
|
897
|
+
|
|
881
898
|
## 8. 偏差与决策
|
|
882
899
|
|
|
883
900
|
- **偏差:** 无 / `<deviation-id>`
|
|
@@ -1703,7 +1720,9 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1703
1720
|
4. 确认 source-worktree 必跑非 E2E 检查已执行,且没有把 E2E 自报为通过;
|
|
1704
1721
|
5. 重读父分支 checkout clean、HEAD 与 remote/本地约定,记录 `parent_before_sha`。
|
|
1705
1722
|
|
|
1706
|
-
|
|
1723
|
+
建立新 candidate 前先比较 Ticket `attempts` 与有效 Plan 的 `integration_attempt_limit`。若前一轮尚未通过且当前 attempts 已达到上限,不创建或重建 candidate、不增加 attempts;保留 source workspace、旧 candidate 与失败记录,将 Ticket/worktree 标为 `blocked`,向有效 Lead 返回 `integration-attempt-limit`。
|
|
1724
|
+
|
|
1725
|
+
其他预检失败时保持 `review`/`blocked`,不开始候选合并。
|
|
1707
1726
|
|
|
1708
1727
|
## 2. 建立 parent-candidate checkout
|
|
1709
1728
|
|
|
@@ -1724,7 +1743,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1724
1743
|
- 项目要求的 typecheck/lint/build 或其他父状态检查;
|
|
1725
1744
|
- 仅当 Ticket/Goal Plan `e2e.required=true` 时运行对应 E2E。
|
|
1726
1745
|
|
|
1727
|
-
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha
|
|
1746
|
+
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha`。当本轮失败使 attempts 达到 Goal Plan 快照的 `integration_attempt_limit` 时,保存本轮失败并返回 Lead 复盘;不得继续机械修正、放宽断言、删除检查或发明行为。上限是 Lead 复盘触发点,不是永久禁止恢复。
|
|
1728
1747
|
|
|
1729
1748
|
## 4. 推进父分支
|
|
1730
1749
|
|
|
@@ -1739,6 +1758,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1739
1758
|
## 5. 失败、清理与恢复
|
|
1740
1759
|
|
|
1741
1760
|
- candidate 检查失败:父分支不动,Ticket 回 `in_progress` 或 `blocked`,来源 worktree 保留;
|
|
1761
|
+
- 达到 integration attempt 上限:保留全部 source/candidate checkpoint 与失败记录,等待 Lead 在 Ticket Evidence 写明共同失败模式、最可能原因、下一轮改变和下一 owner/路由;只有形成有实质变化的新 Dispatch Packet 后,Lead 才可将当前 Ticket `attempts` 重置为 `0` 并重新进入 finalize;
|
|
1742
1762
|
- 父 HEAD 漂移:旧 candidate 记 `stale`,完整重建并重跑;
|
|
1743
1763
|
- 成功后可按 candidate integration 授权回收 transient integration worktree/branch;来源 branch/worktree 不自动清理。获得独立 cleanup 授权并清理后,只将生命周期状态改为 `removed`,完整保留已经通过的集成与 E2E 证据;
|
|
1744
1764
|
- push、PR、remote merge、deploy、migration 和生产动作仍需各自授权。
|
|
@@ -1141,7 +1141,9 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1141
1141
|
4. 确认 source-worktree 必跑非 E2E 检查已执行,且没有把 E2E 自报为通过;
|
|
1142
1142
|
5. 重读父分支 checkout clean、HEAD 与 remote/本地约定,记录 `parent_before_sha`。
|
|
1143
1143
|
|
|
1144
|
-
|
|
1144
|
+
建立新 candidate 前先比较 Ticket `attempts` 与有效 Plan 的 `integration_attempt_limit`。若前一轮尚未通过且当前 attempts 已达到上限,不创建或重建 candidate、不增加 attempts;保留 source workspace、旧 candidate 与失败记录,将 Ticket/worktree 标为 `blocked`,向有效 Lead 返回 `integration-attempt-limit`。
|
|
1145
|
+
|
|
1146
|
+
其他预检失败时保持 `review`/`blocked`,不开始候选合并。
|
|
1145
1147
|
|
|
1146
1148
|
## 2. 建立 parent-candidate checkout
|
|
1147
1149
|
|
|
@@ -1162,7 +1164,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1162
1164
|
- 项目要求的 typecheck/lint/build 或其他父状态检查;
|
|
1163
1165
|
- 仅当 Ticket/Goal Plan `e2e.required=true` 时运行对应 E2E。
|
|
1164
1166
|
|
|
1165
|
-
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha
|
|
1167
|
+
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha`。当本轮失败使 attempts 达到 Goal Plan 快照的 `integration_attempt_limit` 时,保存本轮失败并返回 Lead 复盘;不得继续机械修正、放宽断言、删除检查或发明行为。上限是 Lead 复盘触发点,不是永久禁止恢复。
|
|
1166
1168
|
|
|
1167
1169
|
## 4. 推进父分支
|
|
1168
1170
|
|
|
@@ -1177,6 +1179,7 @@ implementation owner 只在来源 worktree 修改授权项目路径,运行 Tic
|
|
|
1177
1179
|
## 5. 失败、清理与恢复
|
|
1178
1180
|
|
|
1179
1181
|
- candidate 检查失败:父分支不动,Ticket 回 `in_progress` 或 `blocked`,来源 worktree 保留;
|
|
1182
|
+
- 达到 integration attempt 上限:保留全部 source/candidate checkpoint 与失败记录,等待 Lead 在 Ticket Evidence 写明共同失败模式、最可能原因、下一轮改变和下一 owner/路由;只有形成有实质变化的新 Dispatch Packet 后,Lead 才可将当前 Ticket `attempts` 重置为 `0` 并重新进入 finalize;
|
|
1180
1183
|
- 父 HEAD 漂移:旧 candidate 记 `stale`,完整重建并重跑;
|
|
1181
1184
|
- 成功后可按 candidate integration 授权回收 transient integration worktree/branch;来源 branch/worktree 不自动清理。获得独立 cleanup 授权并清理后,只将生命周期状态改为 `removed`,完整保留已经通过的集成与 E2E 证据;
|
|
1182
1185
|
- push、PR、remote merge、deploy、migration 和生产动作仍需各自授权。
|
|
@@ -141,15 +141,17 @@ E2E 是否需要由 Ticket/Goal Plan 的实际跨边界风险决定,不限于
|
|
|
141
141
|
|
|
142
142
|
`current` Ticket 模式跳过 source worktree、candidate merge 和 candidate checkout。Lead 在当前 workspace 运行 Ticket 要求的适用集成/回归与 E2E,记录运行环境、命令、退出码和摘要;E2E 不得派给其他 agent。失败时不声明完成,保留 Ticket commit、父 HEAD 和恢复条件。全部通过后重读父 HEAD/tree 并记录 `result_sha`。Direct Spec 模式同样跳过 source worktree、candidate merge 和父分支推进。
|
|
143
143
|
|
|
144
|
+
无论失败发生在 implementation、review、direct-parent 还是 parent-candidate,同一 Ticket 反复返回相同 blocker、下一轮没有产生新证据,或 integration attempts 达到有效 Plan 上限时,都停止自动退回原 implementation owner。Lead 保留当前 workspace/worktree、implementation/source commit、旧 candidate 和失败命令,在 Ticket Evidence 记录失败历史,并将 Ticket/worktree 标为 `blocked`。当前 change 属于父实现时返回父 O Lead;否则返回 Goal Plan Lead,或无 Goal Plan 时的当前 I Lead。Lead 按 lead-orchestration 完成最小复盘并形成有实质变化的新 Dispatch Packet 后,才可重置 attempts 和重新派发;契约已失效则返回真正 owner。
|
|
145
|
+
|
|
144
146
|
### 8. Evidence、状态与完成
|
|
145
147
|
|
|
146
|
-
Lead 使用 `<Path>{roots.workflows}/specdev/I-implement/evidence-template.md</Path>` 写入 Ticket Evidence;Direct Spec 按该模板的 Direct Spec 适配说明写 `<Path>{roots.state}/specdev/changes/{change}/evidence/direct-spec.md</Path>`。Ticket Evidence 按策略记录 implementation/source、适用 candidate/result SHA、派单/返回、两层验证、双轴审查、E2E disposition
|
|
148
|
+
Lead 使用 `<Path>{roots.workflows}/specdev/I-implement/evidence-template.md</Path>` 写入 Ticket Evidence;Direct Spec 按该模板的 Direct Spec 适配说明写 `<Path>{roots.state}/specdev/changes/{change}/evidence/direct-spec.md</Path>`。Ticket Evidence 按策略记录 implementation/source、适用 candidate/result SHA、派单/返回、两层验证、双轴审查、E2E disposition、路径审计、失败历史与适用 Lead 复盘、偏差和残余风险;Direct Spec Evidence 使用实施前基线与 current workspace 最终 checkpoint,不伪造 Ticket/worktree/candidate 字段。
|
|
147
149
|
|
|
148
150
|
Ticket 正常状态:`ready → in_progress → review → done`。`required` 的 `done` 要求 change worktree 已完成集成(`integrated` 或 `removed`)、父 HEAD=result SHA 且包含 source commit;`current` 的 `done` 要求 current workspace clean、direct-parent 验证通过且父 HEAD=result SHA。阻塞使用 `blocked`,契约偏差使用 `deviated`,无需改动使用 `cancelled`。Direct Spec 由当前 I-implement owner 按 `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>` 关闭 change。
|
|
149
151
|
|
|
150
152
|
按存在和当前模式同步 Ticket、Tickets Map、Goal Plan、`<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>` 和全局状态;Direct Spec 不创建缺失的 Ticket/Map/Goal Plan。最后一个计划内 Ticket 完成后,Goal Plan 的 Lead 按 change completion 关闭;无 Goal Plan 的当前 I owner 承担同一门禁。需要远程 reconcile 时返回 T-triage,否则进入 Archive。
|
|
151
153
|
|
|
152
|
-
当前 change 属于未完成父实现 change 时,单个组合 Ticket
|
|
154
|
+
当前 change 属于未完成父实现 change 时,单个组合 Ticket 完成、阻塞或触发 Lead 复盘,且子状态与 Evidence 已写入后,必须自动返回 `<Path>{roots.workflows}/specdev/O-orchestrate-implementation/O-orchestrate-implementation.md</Path>`,由父 Lead 重读全部成员并决定重新派发、返回上游或继续下一 frontier;不得要求用户逐个重新激活,不得直接归档子 change,也不得从本 Work 实现另一个成员。
|
|
153
155
|
|
|
154
156
|
运行:
|
|
155
157
|
|
|
@@ -162,13 +164,14 @@ node <Path>{roots.workflows}/specdev/common/tools/validate-specdev.mjs</Path> \
|
|
|
162
164
|
|
|
163
165
|
### 9. 返回
|
|
164
166
|
|
|
165
|
-
Ticket 模式返回 Ticket/change 状态、Evidence 完整路径、workspace locator、implementation/source、适用 candidate/result SHA、父分支、E2E disposition
|
|
167
|
+
Ticket 模式返回 Ticket/change 状态、Evidence 完整路径、workspace locator、implementation/source、适用 candidate/result SHA、父分支、E2E disposition、适用 Lead 复盘决定、未验证项和下一路由。Direct Spec 返回 change 状态、`<Path>{roots.state}/specdev/changes/{change}/evidence/direct-spec.md</Path>`、current workspace、实施前/最终 checkpoint、适用 E2E 和下一路由。push、PR、remote merge、deploy、migration、生产动作及来源 branch/worktree cleanup 只在独立授权时执行。
|
|
166
168
|
|
|
167
169
|
## 完成标准
|
|
168
170
|
|
|
169
171
|
- Ticket 模式按策略完成 current workspace/direct-parent 或 worktree/implementation commit/candidate gate;Direct Spec 的轻量合同、current workspace checkpoint、双轴审查和最终验证完整;
|
|
170
172
|
- current Ticket 的适用 E2E 由 Lead 在 current workspace 运行;required Ticket 的适用 E2E 由 Lead 在 parent-candidate 运行;Direct Spec 适用 E2E 由 Lead 在 current workspace 运行;
|
|
171
173
|
- Lead 独立核对并写全部 SpecDev 工件;
|
|
174
|
+
- 重复失败或 integration attempt 上限只触发 Lead 复盘;没有 Evidence 中的原因、改变和 owner 决定,不得重置 attempts 或重复派发;
|
|
172
175
|
- current Ticket 父分支只推进到通过的 direct-parent 验证 commit;required Ticket 父分支只推进到通过的 candidate;两者 Ticket Done 都必须与实际 Git 一致;Direct Spec 的完成状态与 current workspace 最终 checkpoint 一致;
|
|
173
176
|
- 实际路径、验证、偏差和状态可由 Evidence 恢复;
|
|
174
177
|
- validator 无 error。
|
|
@@ -91,6 +91,19 @@ subagent 不写本 Evidence;以上内容由 Lead 从实际 workspace、Git 和
|
|
|
91
91
|
|
|
92
92
|
集成失败时明确父 HEAD 是否推进、失败命令、旧 SHA 和恢复条件。
|
|
93
93
|
|
|
94
|
+
### Failure History And Lead Recovery
|
|
95
|
+
|
|
96
|
+
| 轮次 | 阶段 | Checkpoint/candidate | 失败事实 | 下一轮变化 |
|
|
97
|
+
|---|---|---|---|---|
|
|
98
|
+
| ... | implementation / review / direct-parent / parent-candidate | `<sha-or-locator>` | blocker、命令与摘要 | 首次失败待定 / Lead 决定 |
|
|
99
|
+
|
|
100
|
+
- **共同失败模式:** not-applicable / ...
|
|
101
|
+
- **最可能原因:** not-applicable / ...
|
|
102
|
+
- **下一轮具体改变:** not-applicable / ...
|
|
103
|
+
- **下一 owner/路由:** not-applicable / same owner / new owner / Lead / upstream owner
|
|
104
|
+
|
|
105
|
+
首次失败不要求额外分类;同一 blocker 反复出现、下一轮没有新证据,或 integration attempts 达到有效上限时,Lead 必须填写以上四项。重置 attempts 后仍保留此前轮次,不覆盖失败历史。
|
|
106
|
+
|
|
94
107
|
## 8. 偏差与决策
|
|
95
108
|
|
|
96
109
|
- **偏差:** 无 / `<deviation-id>`
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
|
|
20
20
|
## 自动继续边界
|
|
21
21
|
|
|
22
|
-
子 Ticket 正常完成、candidate stale
|
|
22
|
+
子 Ticket 正常完成、candidate stale 后可机械重建、已批准且产生新证据的局部实现修正和下一 frontier 选择不再次询问用户。同一 Ticket 反复返回相同 blocker、没有新证据或达到 integration attempt 上限时,停止该 Ticket 的自动重复并回到父 Lead 决策点;父 Lead 重读其全部 Evidence,记录共同失败模式、最可能原因、下一轮改变和下一 owner/路由,再决定改写指导、换 owner、自行实现或返回上游契约 owner。只有形成有实质变化的新 Dispatch Packet 后,才可重置该 Ticket attempts 并重新派发。
|
|
23
|
+
|
|
24
|
+
这个回转不自动终止整个父循环;父 Lead 可以继续其他不受影响的 ready frontier。以下情况才停止并等待用户或上游新决定:
|
|
23
25
|
|
|
24
26
|
- 高影响合同、范围、架构、数据、安全、迁移或验收需要新决定;
|
|
25
27
|
- implementation commit、integration 或不可逆动作缺少授权;
|
|
26
28
|
- dependency/serialization/path owner 无法由权威事实裁决;
|
|
27
|
-
- 连续集成尝试达到父 Plan 上限;
|
|
28
29
|
- 无合法 frontier 但仍有非终态 Ticket。
|
|
29
30
|
|
|
30
31
|
停止时父 Plan 保存最后 accepted 节点、active/stale dispatch、Git checkpoint、blocker、owner、下一合法动作和恢复重读清单。
|
|
@@ -30,9 +30,12 @@ Lead 在每个 Gate 汇总覆盖 Evidence、接口/数据/兼容状态、candida
|
|
|
30
30
|
- direct-parent/candidate 冲突或检查失败:父分支不动,integration 记 `failed`,Ticket 回到 `in_progress`/`blocked`;
|
|
31
31
|
- 父 HEAD 漂移:integration 记 `stale`,从最新父分支重建并重跑;
|
|
32
32
|
- E2E required 失败:父分支不动,保留失败命令、适用 checkpoint 和恢复条件;
|
|
33
|
+
- 同一 blocker 反复出现、下一轮没有新证据,或 integration attempts 达到有效上限:停止自动重复,保留 workspace、checkpoint/candidate 和全部失败事实,将受影响 Ticket 标为 `blocked` 并返回有效 Lead;Lead 按 lead-orchestration 在 Evidence 写复盘决定后,才可重置该 Ticket 的 `attempts` 并以有实质变化的新 Packet 重新派发;
|
|
33
34
|
- 命中当次 Dispatch Packet/候选协议的停止条件、继续修正已无合理收益或需要新产品决定:停止受影响 Wave,按 deviation control 返回契约 owner;
|
|
34
35
|
- Lead 会话变化:读取 Goal Plan、Ticket、change worktree 状态与最新 Evidence,从最后不可变 checkpoint 恢复。
|
|
35
36
|
|
|
37
|
+
父 O-orchestrate-implementation 的 Lead 可继续其他不受影响的 ready frontier;单个 Ticket 进入 Lead 复盘不自动终止整个父循环。
|
|
38
|
+
|
|
36
39
|
## 5. Change 完成 owner
|
|
37
40
|
|
|
38
41
|
Lead 是 Goal Plan change 的唯一完成 owner。没有 Goal Plan 的单 Ticket/Direct Spec 由当前 I-implement owner 按 change completion 规则完成。Archive 不补造完成证据。
|
|
@@ -29,6 +29,10 @@ implementation 返回至少包含:Ticket ID、workspace locator、最终 commi
|
|
|
29
29
|
|
|
30
30
|
## 6. Lead 验收
|
|
31
31
|
|
|
32
|
-
Lead 核对基线、路径、commit、dirty 状态、项目事实与非 E2E 结果;不接受 subagent 自报的 Evidence 或 E2E pass。required implementation 候选进入 dev-worktree candidate-merge;current implementation 由 Lead 在同一 parent branch/current workspace 做 direct-parent 验证。read-only 结果由 Lead
|
|
32
|
+
Lead 核对基线、路径、commit、dirty 状态、项目事实与非 E2E 结果;不接受 subagent 自报的 Evidence 或 E2E pass。required implementation 候选进入 dev-worktree candidate-merge;current implementation 由 Lead 在同一 parent branch/current workspace 做 direct-parent 验证。read-only 结果由 Lead 复核后写入对应权威工件。首次失败可返回同一 workspace/worktree 修正或标记 blocked。
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
同一 Ticket 在 implementation/review 反复返回相同 blocker、下一轮没有产生新证据,或 integration attempts 达到有效 Plan 的 `integration_attempt_limit` 时,停止把相同请求直接退回原 implementation owner。Lead 保留 workspace、commit/candidate 与失败事实,在现有 Ticket Evidence 中回答四项:共同失败模式、最可能原因、下一轮具体改变、下一 owner/路由。Lead 可改写指导、调整 Ticket 内实现路径、更换 implementation owner 或自行实现;若发现 Ticket、Goal、父 Plan、Spec/ADR 已失效,则返回对应 owner。
|
|
35
|
+
|
|
36
|
+
只有 Lead 的复盘决定已写入 Evidence,才可将当前 Ticket 的 `attempts` 重置为 `0` 并发出新 Dispatch Packet;新 Packet 必须引用该 Evidence 并明确相较上一轮改变了什么。没有实质变化时不得重新派发同一请求。上限因此是 Lead 复盘触发点,不是 Ticket 的永久失败终态。
|
|
37
|
+
|
|
38
|
+
**完成标准**:每次写入只有一个 Ticket/owner/worktree;所有 SpecDev 状态由 Lead 落盘;派单、返回与重复失败后的 Lead 决定可从 Evidence 恢复。
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
4. 确认 source-worktree 必跑非 E2E 检查已执行,且没有把 E2E 自报为通过;
|
|
11
11
|
5. 重读父分支 checkout clean、HEAD 与 remote/本地约定,记录 `parent_before_sha`。
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
建立新 candidate 前先比较 Ticket `attempts` 与有效 Plan 的 `integration_attempt_limit`。若前一轮尚未通过且当前 attempts 已达到上限,不创建或重建 candidate、不增加 attempts;保留 source workspace、旧 candidate 与失败记录,将 Ticket/worktree 标为 `blocked`,向有效 Lead 返回 `integration-attempt-limit`。
|
|
14
|
+
|
|
15
|
+
其他预检失败时保持 `review`/`blocked`,不开始候选合并。
|
|
14
16
|
|
|
15
17
|
## 2. 建立 parent-candidate checkout
|
|
16
18
|
|
|
@@ -31,7 +33,7 @@
|
|
|
31
33
|
- 项目要求的 typecheck/lint/build 或其他父状态检查;
|
|
32
34
|
- 仅当 Ticket/Goal Plan `e2e.required=true` 时运行对应 E2E。
|
|
33
35
|
|
|
34
|
-
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha
|
|
36
|
+
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha`。当本轮失败使 attempts 达到 Goal Plan 快照的 `integration_attempt_limit` 时,保存本轮失败并返回 Lead 复盘;不得继续机械修正、放宽断言、删除检查或发明行为。上限是 Lead 复盘触发点,不是永久禁止恢复。
|
|
35
37
|
|
|
36
38
|
## 4. 推进父分支
|
|
37
39
|
|
|
@@ -46,6 +48,7 @@
|
|
|
46
48
|
## 5. 失败、清理与恢复
|
|
47
49
|
|
|
48
50
|
- candidate 检查失败:父分支不动,Ticket 回 `in_progress` 或 `blocked`,来源 worktree 保留;
|
|
51
|
+
- 达到 integration attempt 上限:保留全部 source/candidate checkpoint 与失败记录,等待 Lead 在 Ticket Evidence 写明共同失败模式、最可能原因、下一轮改变和下一 owner/路由;只有形成有实质变化的新 Dispatch Packet 后,Lead 才可将当前 Ticket `attempts` 重置为 `0` 并重新进入 finalize;
|
|
49
52
|
- 父 HEAD 漂移:旧 candidate 记 `stale`,完整重建并重跑;
|
|
50
53
|
- 成功后可按 candidate integration 授权回收 transient integration worktree/branch;来源 branch/worktree 不自动清理。获得独立 cleanup 授权并清理后,只将生命周期状态改为 `removed`,完整保留已经通过的集成与 E2E 证据;
|
|
51
54
|
- push、PR、remote merge、deploy、migration 和生产动作仍需各自授权。
|