@namewta/speculo 0.7.2 → 0.7.3
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/dist/src/migrations.js +604 -23
- package/dist/src/migrations.js.map +1 -1
- package/package.json +1 -1
- package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +171 -455
- package/template/canonical/canonical-specdev-goal-plan.md +686 -1117
- package/template/canonical/canonical-specdev-grill-with-docs.md +172 -456
- package/template/canonical/canonical-specdev-spec.md +199 -493
- package/template/canonical/canonical-specdev-tickets.md +378 -597
- package/template/canonical/canonical-specdev-wayfinder.md +170 -454
- package/template/skills/migrate-runtime-state/SKILL.md +6 -6
- package/template/skills/migrate-runtime-state/references/migration-contract.md +9 -3
- package/template/skills/migrate-runtime-state/scripts/migrate-runtime-state.mjs +322 -33
- package/template/workflows/specdev/I-implement/I-implement.md +97 -143
- package/template/workflows/specdev/I-implement/evidence-template.md +60 -48
- package/template/workflows/specdev/I-implement/execution-preflight.md +29 -21
- package/template/workflows/specdev/I-implement/merge-conflict-protocol.md +12 -12
- package/template/workflows/specdev/I-init-setup/I-init-setup.md +4 -5
- package/template/workflows/specdev/I-init-setup/change-status-template.json +14 -1
- package/template/workflows/specdev/I-init-setup/config-template.json +3 -5
- package/template/workflows/specdev/I-init-setup/status-template.json +1 -1
- package/template/workflows/specdev/INDEX.md +11 -8
- package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +76 -102
- package/template/workflows/specdev/P-goal-plan/completion-control.md +26 -44
- package/template/workflows/specdev/P-goal-plan/goal-plan-template.md +40 -37
- package/template/workflows/specdev/P-goal-plan/lead-orchestration.md +34 -0
- package/template/workflows/specdev/P-goal-plan/orchestration-protocol.md +31 -46
- package/template/workflows/specdev/P-goal-plan/planning-modes.md +42 -76
- package/template/workflows/specdev/T-tickets/T-tickets.md +6 -3
- package/template/workflows/specdev/T-tickets/ticket-readiness.md +5 -3
- package/template/workflows/specdev/T-tickets/ticket-template.md +8 -1
- package/template/workflows/specdev/T-tickets/tickets-map-template.md +5 -4
- package/template/workflows/specdev/_state/status.json +1 -1
- package/template/workflows/specdev/common/README.md +2 -2
- package/template/workflows/specdev/common/rules/change-completion.md +17 -20
- package/template/workflows/specdev/common/rules/deviation-control.md +1 -1
- package/template/workflows/specdev/common/rules/evidence-and-verification.md +27 -37
- package/template/workflows/specdev/common/rules/path-ownership.md +21 -23
- package/template/workflows/specdev/common/rules/readiness-and-depth.md +1 -1
- package/template/workflows/specdev/common/schemas/change-status.schema.json +136 -373
- package/template/workflows/specdev/common/schemas/config.schema.json +9 -11
- package/template/workflows/specdev/common/schemas/goal-plan.schema.json +24 -16
- package/template/workflows/specdev/common/schemas/status.schema.json +7 -63
- package/template/workflows/specdev/common/skills/dev-worktree/SKILL.md +42 -21
- package/template/workflows/specdev/common/skills/dev-worktree/references/create.md +36 -21
- package/template/workflows/specdev/common/skills/dev-worktree/references/finalize.md +46 -18
- package/template/workflows/specdev/common/skills/subagent-delivery/SKILL.md +34 -31
- package/template/workflows/specdev/common/skills/subagent-delivery/references/external-web-subagent.md +10 -23
- package/template/workflows/specdev/common/skills/subagent-delivery/references/native-subagent.md +15 -25
- package/template/workflows/specdev/common/tools/validate-specdev.mjs +386 -209
- package/template/workflows/specdev/I-implement/delegated-evidence-template.md +0 -12
- package/template/workflows/specdev/P-goal-plan/delegated-execution-template.md +0 -35
- package/template/workflows/specdev/P-goal-plan/delegated-execution.md +0 -59
- package/template/workflows/specdev/P-goal-plan/workspace-execution-template.md +0 -24
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
- 若本地项目提供 Speculo Node 校验器,可运行它补充结构校验;纯网页环境按本文内联的 schema、Ready 清单和完成标准逐项核对,并明确记录未运行的自动校验。
|
|
14
14
|
- 提交、推送、合并、部署、发布、归档移动和不可逆迁移仍需用户明确授权。
|
|
15
15
|
|
|
16
|
-
Goal Plan
|
|
16
|
+
Goal Plan 只拥有单个 Ticket 无法独立决定的事情:整体 Outcome、跨 Ticket 顺序与并发、共享所有权、里程碑 Gate、动态派单边界、父分支集成、迁移/发布顺序、偏差升级和恢复。Ticket 继续拥有局部实现合同。
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
每次 Goal Plan 都采用 `lead-directed`:当前主会话是唯一 Lead,负责计划、SpecDev 状态、Evidence、派单、候选验收、父分支集成和最终回复。Lead 可以根据实际依赖与平台能力动态派遣 subagent,不需要用户预选协作模式。Agent 编排与 worktree 隔离是正交关系;每个进入 I-implement 的 Ticket 都必须拥有独立 worktree,无论由 Lead 还是 implementation subagent 实现。
|
|
19
19
|
|
|
20
20
|
产物写入 `specdev/changes/{change}/goal-plan.md`。
|
|
21
21
|
|
|
@@ -25,12 +25,12 @@ Goal Plan 只解决单个 Ticket 无法独立决定的事情:跨 Ticket 顺序
|
|
|
25
25
|
|
|
26
26
|
- 多个 Ticket 可以或需要并行;
|
|
27
27
|
- 存在 shared path、共享合同或集中 owner;
|
|
28
|
-
- 存在 Deep Ticket、expand-contract
|
|
29
|
-
-
|
|
30
|
-
- Ticket DAG
|
|
28
|
+
- 存在 Deep Ticket、expand-contract、迁移、兼容窗口或不可逆步骤;
|
|
29
|
+
- 存在多个 Gate、外部审批、发布窗口或高事故半径;
|
|
30
|
+
- Ticket DAG 的关键路径、汇合点或恢复策略无法由 Tickets Map 安全表达;
|
|
31
31
|
- 用户明确要求正式跨 Ticket Plan。
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
少量、线性、低风险的 Ready Tickets 可以跳过本 work,由 I-implement 逐 Ticket 建立 worktree 并执行。没有 Ticket 的获批小型 Direct Spec 不受 Ticket worktree 合同约束;一旦需要切片,先运行 T-tickets。
|
|
34
34
|
|
|
35
35
|
## 输入
|
|
36
36
|
|
|
@@ -43,97 +43,78 @@ Goal Plan 只解决单个 Ticket 无法独立决定的事情:跨 Ticket 顺序
|
|
|
43
43
|
|
|
44
44
|
按存在情况读取:
|
|
45
45
|
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
46
|
+
- 当前 change 架构决策:`specdev/changes/{change}/ADR.md`
|
|
47
|
+
- 当前 change 领域上下文:`specdev/changes/{change}/CONTEXT.md`
|
|
48
|
+
- 当前 change 设计日志:`specdev/changes/{change}/LOG.md`
|
|
49
|
+
- 当前 change 诊断:`specdev/changes/{change}/diagnosis.md`
|
|
50
|
+
- 永久架构决策:`specdev/adr/`
|
|
51
|
+
- 永久领域上下文:`specdev/context/`
|
|
52
|
+
- 用户提供的合同、标准、参考实现、环境限制、发布窗口和批准策略。
|
|
52
53
|
|
|
53
|
-
Spec 或 Tickets Map
|
|
54
|
+
永久目录可以为空,静默继续。缺少 Spec 或 Tickets Map 时返回 “编写 Spec 阶段” 或 “拆分 Tickets 阶段”;当前 ADR/CONTEXT 缺失且规划依赖对应决定时返回 “设计访谈能力”,不在 Goal Plan 中补造上游权威。
|
|
54
55
|
|
|
55
56
|
## 流程
|
|
56
57
|
|
|
57
|
-
### 1.
|
|
58
|
+
### 1. 验证上游与执行边界
|
|
58
59
|
|
|
59
60
|
加载 下方 `<planning-modes>` 标签:
|
|
60
61
|
|
|
61
|
-
1. 验证 Spec
|
|
62
|
-
2.
|
|
63
|
-
3. 识别
|
|
64
|
-
4.
|
|
65
|
-
5.
|
|
66
|
-
6.
|
|
67
|
-
7. 只对无法发现且会改变 Gate、Wave、owner、迁移、批准点或隔离策略的问题继续提问;
|
|
68
|
-
8. 不熟悉的外部标准或依赖使用 下方 `<research>` 标签。
|
|
62
|
+
1. 验证 Spec、Tickets、合同覆盖、DAG、路径所有权和 Deep Ticket 完整性;
|
|
63
|
+
2. 只读探索影响调度的代码与项目事实;
|
|
64
|
+
3. 识别 migration、high-assurance、reference-conformance、release-coordination 等适用模式;
|
|
65
|
+
4. 从 config 读取 `max_implementation_agents`,将实际上限写入 `implementation_agent_limit`;本计划可以降低但不得超过 `3`,Lead 不计入;
|
|
66
|
+
5. 确认实现 commit 与本地候选集成已获授权;缺一项则计划保持 blocked;
|
|
67
|
+
6. 只询问无法发现且会改变 Gate、Wave、owner、迁移、批准或验收的问题。
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
**完成标准**:所有计划内 Ticket Ready;Lead、授权、实现并发上限和父分支可判定;没有用 Goal Plan 掩盖上游缺口。
|
|
71
70
|
|
|
72
|
-
### 2.
|
|
71
|
+
### 2. 构建 Outcome、DAG、Wave 与 Gate
|
|
73
72
|
|
|
74
73
|
加载 下方 `<orchestration-protocol>` 标签:
|
|
75
74
|
|
|
76
|
-
1.
|
|
77
|
-
2.
|
|
78
|
-
3. 为 shared path
|
|
79
|
-
4.
|
|
80
|
-
5.
|
|
81
|
-
6.
|
|
82
|
-
7. 只有存在允许的隔离触发条件时才规划 worktree,并固定 workspace owner、integration owner、父分支和结束动作。
|
|
75
|
+
1. 压缩 Outcome、成功/伪完成、非目标和权威来源;
|
|
76
|
+
2. 从 Ticket frontmatter 构建 DAG、关键路径、扇出与汇合点;
|
|
77
|
+
3. 为 shared path、共享合同和集中修改指定唯一 owner;
|
|
78
|
+
4. 将依赖满足且项目写路径不相交的 Ticket 分入 Wave;
|
|
79
|
+
5. 为合同稳定、垂直路径、迁移完成、发布就绪等状态定义 Gate;
|
|
80
|
+
6. 为每个 Ticket 记录开始条件、worktree、验证层级、Evidence 目标、集成顺序和失败恢复。
|
|
83
81
|
|
|
84
|
-
**完成标准**:DAG、Wave、Gate 与 Tickets Map
|
|
82
|
+
**完成标准**:DAG、Wave、Gate 与 Tickets Map 一致;每个 Ticket 有唯一项目写 owner、worktree 合同和可验证集成出口。
|
|
85
83
|
|
|
86
|
-
### 3.
|
|
84
|
+
### 3. 固定 Lead 编排与动态派单合同
|
|
87
85
|
|
|
88
|
-
|
|
86
|
+
加载 下方 `<lead-orchestration>` 标签,并以 `operation=plan` 调用 下方 `<subagent-delivery>` 标签:
|
|
89
87
|
|
|
90
|
-
1.
|
|
91
|
-
2.
|
|
92
|
-
3.
|
|
88
|
+
1. 固定 Lead 的可恢复 owner/session locator;
|
|
89
|
+
2. 声明 implementation subagent 最多同时三个,Lead 不计入;
|
|
90
|
+
3. 不为只读 review/research/test-observation agent 写 SpecDev 数字上限;
|
|
91
|
+
4. 固定只有 Lead 写 SpecDev 工件与状态;
|
|
92
|
+
5. 定义执行期动态 Dispatch Packet、候选返回和 Lead 验收;
|
|
93
|
+
6. provider、模型和具体派单在 Ticket 开始时按事实选择,不在 Goal Plan 中预分配。
|
|
93
94
|
|
|
94
|
-
|
|
95
|
+
**完成标准**:Lead 可以在恢复后重建派单边界;任何 subagent 都不能成为第二个 SpecDev 状态写入者或父分支 integration owner。
|
|
95
96
|
|
|
96
|
-
|
|
97
|
-
2. 以 `operation=plan` 调用 下方 `<subagent-delivery>` 标签;
|
|
98
|
-
3. 固定唯一 Lead、native/external provider、不可变 checkpoint、可恢复 locator、逐动作授权和修正上限;
|
|
99
|
-
4. 生成里程碑 Delivery Contract 与每个 Ticket 的独立 Dispatch Packet;
|
|
100
|
-
5. 为每个派单标记 `lead-write | worker-write | read-only`;`worker-write` 必须引用隔离 workspace 分配。
|
|
101
|
-
|
|
102
|
-
`single-session` 跳过委派能力,但仍可加载独立 workspace 附录;`lead-team` 在没有隔离触发条件时也不得制造 worktree。
|
|
103
|
-
|
|
104
|
-
### 4. 定义整体完成、证据与恢复
|
|
97
|
+
### 4. 定义完成、证据与恢复
|
|
105
98
|
|
|
106
99
|
加载 下方 `<completion-control>` 标签:
|
|
107
100
|
|
|
108
|
-
1.
|
|
109
|
-
2.
|
|
110
|
-
3.
|
|
111
|
-
4.
|
|
112
|
-
5.
|
|
113
|
-
6.
|
|
114
|
-
|
|
115
|
-
**完成标准**:所有完成声明能映射到实际命令、代码状态、Evidence 或人工批准;没有自报即通过的门禁。
|
|
116
|
-
|
|
117
|
-
### 5. 写入自适应 Goal Plan
|
|
101
|
+
1. 定义整体 Definition of Done 和每个 Gate 的关闭证据;
|
|
102
|
+
2. 固化不可协商约束与允许的局部实现自由;
|
|
103
|
+
3. 为每个 Ticket 明确 source-worktree 检查与 parent-candidate 检查;
|
|
104
|
+
4. E2E 按 Ticket 实际跨边界风险标记 required 或 not-required;
|
|
105
|
+
5. 定义候选失败、父 HEAD 漂移、偏差、暂停、批准和恢复动作;
|
|
106
|
+
6. 定义 change 完成、远程 reconcile、残余风险和回滚要求。
|
|
118
107
|
|
|
119
|
-
|
|
108
|
+
**完成标准**:每个完成声明映射到不可变 commit、候选/父分支 SHA、命令、Evidence 或人工批准。
|
|
120
109
|
|
|
121
|
-
|
|
110
|
+
### 5. 写入、同步与验证
|
|
122
111
|
|
|
123
|
-
|
|
124
|
-
2. Execution Graph;
|
|
125
|
-
3. Gates and Completion Evidence;
|
|
126
|
-
4. Execution and Integration Protocol;
|
|
127
|
-
5. Constraints, Risk and Recovery;
|
|
128
|
-
6. Progress and Decisions。
|
|
112
|
+
使用 下方 `<goal-plan-template>` 标签 写入 Goal Plan:
|
|
129
113
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
1. 将 Wave、Gate 和 owner 投影同步到 `specdev/changes/{change}/tickets-map.md`;
|
|
135
|
-
2. 对照 下方 `<goal-plan-schema>` 标签,确认 coordination 与 workspace 两个字段成对存在且组合有效;
|
|
136
|
-
3. 运行:
|
|
114
|
+
1. 只保留适用 planning modes,不创建条件性 topology addendum;
|
|
115
|
+
2. 将 Wave、Gate 和 owner 投影同步到 Tickets Map;
|
|
116
|
+
3. 对照 下方 `<goal-plan-schema>` 标签;
|
|
117
|
+
4. 运行:
|
|
137
118
|
|
|
138
119
|
```bash
|
|
139
120
|
node Speculo Node 校验器 \
|
|
@@ -141,47 +122,40 @@ node Speculo Node 校验器 \
|
|
|
141
122
|
specdev/changes/{change}
|
|
142
123
|
```
|
|
143
124
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
6. 向用户汇报规划模式、协作方式、workspace 分配、关键路径、Wave、Gate、shared owner、迁移策略、主要风险和 Ready 状态;Lead Team 再汇报交付通道与 Lead;
|
|
125
|
+
5. 原子更新 Goal Plan、Tickets Map、全局/current change 状态并重新读取;
|
|
126
|
+
6. 向用户报告 Outcome、关键路径、Wave/Gate、Lead、实现 agent 上限、shared owner、E2E disposition、迁移与主要风险;
|
|
147
127
|
7. 未经用户要求,不自动进入实现。
|
|
148
128
|
|
|
149
129
|
## 决策完备标准
|
|
150
130
|
|
|
151
|
-
每份 Goal Plan
|
|
152
|
-
|
|
153
|
-
- 跨 Ticket 先后、并发 Wave 和关键汇合点;
|
|
154
|
-
- shared path 与共享合同的 owner;
|
|
155
|
-
- Gate 开启、关闭和证据;
|
|
156
|
-
- 迁移、兼容、收缩、发布和回滚顺序;
|
|
157
|
-
- Evidence 返回、集成、偏差、暂停和批准路径。
|
|
131
|
+
每份 Goal Plan 必须让 Lead 无需重新决定:
|
|
158
132
|
|
|
159
|
-
|
|
133
|
+
- Outcome、权威来源和整体完成;
|
|
134
|
+
- 跨 Ticket 先后、Wave、Gate 和关键汇合点;
|
|
135
|
+
- shared path 与共享合同 owner;
|
|
136
|
+
- implementation subagent 上限及动态派单边界;
|
|
137
|
+
- 每 Ticket worktree、source commit、候选验证和父分支推进规则;
|
|
138
|
+
- E2E disposition、偏差、暂停、批准和恢复路径。
|
|
160
139
|
|
|
161
|
-
Goal Plan
|
|
140
|
+
Goal Plan 不复制 Ticket 的局部施工路线、全部文件预测或逐项验收清单。
|
|
162
141
|
|
|
163
142
|
## 完成标准
|
|
164
143
|
|
|
165
|
-
- `
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
- Tickets Map
|
|
171
|
-
- 无未批准高影响假设或硬停止问题;
|
|
172
|
-
- 结构校验无 error;纯网页环境的人工核对结果已记录;
|
|
173
|
-
- 用户收到摘要和下一步选择。
|
|
144
|
+
- Goal Plan schema v4 且 `ready_for_execution` 与状态一致;
|
|
145
|
+
- Lead 唯一,最多三个 implementation subagent,review/research agent 不受 SpecDev 数字限制;
|
|
146
|
+
- 每个实现 Ticket 都有 worktree、commit、candidate-merge 和 Evidence 出口;
|
|
147
|
+
- source worktree 不承担 E2E,适用 E2E 只由 Lead 在 parent-candidate 状态运行;
|
|
148
|
+
- 计划只保留当前固定 Lead 与 candidate-merge 合同,不携带条件性编排附录;
|
|
149
|
+
- validator 无 error,Tickets Map 投影同步,用户收到下一步选择。
|
|
174
150
|
|
|
175
151
|
## 子文件引用
|
|
176
152
|
|
|
177
153
|
- 规划模式与输入门禁:下方 `<planning-modes>` 标签
|
|
178
|
-
- DAG、Wave、Gate
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
- Goal Plan
|
|
182
|
-
-
|
|
183
|
-
- 委派附录模板:下方 `<delegated-execution-template>` 标签,仅用户选择委派时加载
|
|
184
|
-
- Agent 交付合同:下方 `<subagent-delivery>` 标签,仅用户选择委派时调用
|
|
154
|
+
- DAG、Wave、Gate 与集成队列:下方 `<orchestration-protocol>` 标签
|
|
155
|
+
- Lead 与动态派单:下方 `<lead-orchestration>` 标签
|
|
156
|
+
- 完成、证据与恢复:下方 `<completion-control>` 标签
|
|
157
|
+
- Goal Plan 模板:下方 `<goal-plan-template>` 标签
|
|
158
|
+
- Agent 交付合同:下方 `<subagent-delivery>` 标签
|
|
185
159
|
|
|
186
160
|
---
|
|
187
161
|
|
|
@@ -193,95 +167,61 @@ Goal Plan 不应重复 Ticket 的局部执行路线、全部文件预测、局
|
|
|
193
167
|
|
|
194
168
|
# Goal Plan 规划模式与输入门禁
|
|
195
169
|
|
|
196
|
-
|
|
170
|
+
规划模式描述 Goal Plan 需要额外解决的工程问题,不再表示 Agent 或 workspace topology。Lead-directed、每 Ticket worktree 和 candidate-merge 是所有新 Goal Plan 的固定合同。
|
|
197
171
|
|
|
198
|
-
## 1.
|
|
172
|
+
## 1. 输入门禁
|
|
199
173
|
|
|
200
|
-
|
|
201
|
-
- [ ] `specdev/changes/{change}/tickets-map.md` 与全部 Ticket 一致。
|
|
202
|
-
- [ ] 所有计划执行的 Ticket 设置 `ready: true`。
|
|
203
|
-
- [ ] Ticket ID、具体 `specdev/changes/{change}/ticket/NN-<ticket-name>.md` 和 Map 行一致。
|
|
204
|
-
- [ ] `blocked_by` 引用存在,DAG 无环。
|
|
205
|
-
- [ ] Spec 验收合同全部 covered,或 deferred 项有批准、原因和后续归属。
|
|
206
|
-
- [ ] 可能并行的 Ticket 项目写路径不相交,或已有 shared owner 与排序方案。
|
|
207
|
-
- [ ] Deep Ticket 具备迁移、兼容、监控、回滚、收缩条件和批准点。
|
|
208
|
-
- [ ] Ticket 与 Spec、ADR、代码事实不存在未处理冲突。
|
|
209
|
-
- [ ] 项目声明的验证命令真实存在且能观察目标行为;不可运行项有替代证据或明确 blocker。
|
|
210
|
-
- [ ] 当前源码基线、工作区状态和外部合同版本已实测,而非使用浮动的“最新”描述。
|
|
174
|
+
开始规划前穷尽检查:
|
|
211
175
|
|
|
212
|
-
|
|
176
|
+
- Spec `ready_for_tickets: true`,或上游工件已等价覆盖范围、合同与验收;
|
|
177
|
+
- Tickets Map 与全部 Ticket 存在、Ready、DAG 无环;
|
|
178
|
+
- 每个验收合同被 Ticket 覆盖;
|
|
179
|
+
- writable/shared path 有唯一 owner,Wave 候选无写冲突;
|
|
180
|
+
- config schema v4,`max_implementation_agents` 为 `1..3`;
|
|
181
|
+
- 父分支可定位,implementation commit 与本地 integration 已获授权;
|
|
182
|
+
- Deep Ticket 的迁移、兼容、监控、恢复和不可逆批准点完整。
|
|
183
|
+
- Ticket 与 `specdev/changes/{change}/spec.md`、`specdev/changes/{change}/ADR.md`、`specdev/adr/`、`specdev/context/` 和当前代码事实不存在未处理冲突;
|
|
184
|
+
- 项目声明的验证命令真实存在,并能观察目标行为;不可运行项有替代证据或明确 blocker;
|
|
185
|
+
- 当前源码基线、父分支、工作区状态和现有用户改动已经实测;
|
|
186
|
+
- 外部合同、标准、参考实现或依赖版本已经固定,不使用浮动的“最新”描述。
|
|
213
187
|
|
|
214
|
-
|
|
188
|
+
缺失上游事实返回其 owner;非 v4 Goal Plan 必须按当前合同重新规划,不能只修改版本号。
|
|
215
189
|
|
|
216
|
-
|
|
217
|
-
- DAG 有环、缺失引用或依赖仅代表偏好;
|
|
218
|
-
- 合同 uncovered 且未批准 deferred;
|
|
219
|
-
- 并行候选写路径相交且无 owner 或顺序;
|
|
220
|
-
- Ticket 改写了 Spec 的外部行为、范围或验收;
|
|
221
|
-
- Ticket 与 `specdev/changes/{change}/ADR.md` 的已接受决定冲突;
|
|
222
|
-
- Deep Ticket 缺少关键迁移或恢复信息;
|
|
223
|
-
- 当前代码事实使 Ticket 的核心行为、接口或验证不可执行;
|
|
224
|
-
- 必需外部合同或参考权威不可获得;
|
|
225
|
-
- 已选择委派,但 Lead、checkpoint、可恢复 locator 或交付通道无法建立;
|
|
226
|
-
- workspace strategy 为 worktree/mixed,但任一隔离 Ticket 缺少允许的 trigger、父分支、integration owner、可恢复 locator 或结束动作;
|
|
227
|
-
- `lead-team + current` 中存在 `worker-write`,或 current workspace 出现多个项目/状态写入 owner;
|
|
228
|
-
- 用户要求的远程或生产动作没有逐动作授权。
|
|
190
|
+
## 2. 可组合模式
|
|
229
191
|
|
|
230
|
-
|
|
192
|
+
- `migration`:存在 expand-contract、数据/协议迁移、兼容窗口或收缩条件;
|
|
193
|
+
- `high-assurance`:涉及安全、隐私、资金、数据完整性、法规、关键基础设施、不可逆操作或高事故半径;
|
|
194
|
+
- `reference-conformance`:必须逐项符合外部标准、协议、设计或参考实现;
|
|
195
|
+
- `release-coordination`:存在发布窗口、跨团队依赖、外部批准、阶段部署、观察期、运营交接或远程 reconcile。
|
|
231
196
|
|
|
232
|
-
|
|
197
|
+
没有适用模式时 `modes: []`。模式只增加对应 Gate、证据和恢复,不改变 Lead、worktree 或集成基本合同。
|
|
233
198
|
|
|
234
|
-
|
|
235
|
-
- **migration**:expand-contract、数据或协议迁移;重点是扩展、分批迁移、收缩条件、数据核对、监控和回滚。
|
|
236
|
-
- **high-assurance**:安全、隐私、资金、数据完整性、法规或不可逆操作;重点是独立审查、人工批准、Evidence 完整性和失败恢复。
|
|
237
|
-
- **reference-conformance**:外部合同、标准、官方实现或指定兼容行为;重点是来源版本、符合性矩阵和冲突裁决。
|
|
238
|
-
- **release-coordination**:发布窗口、跨团队依赖、部署顺序或运营交接;重点是环境前置条件、Gate、观察期和回退。
|
|
199
|
+
## 3. 固定执行拓扑
|
|
239
200
|
|
|
240
|
-
|
|
201
|
+
- `orchestration: lead-directed`;
|
|
202
|
+
- `ticket_workspace_policy: required`;
|
|
203
|
+
- `integration_gate: candidate-merge`;
|
|
204
|
+
- `implementation_agent_limit` 不大于 config,也不大于 `3`;
|
|
205
|
+
- Lead 不计入 implementation subagent 数量;
|
|
206
|
+
- review/research/test-observation agent 无 SpecDev 固定数字上限,但必须保持只读且不竞争同一可变环境;
|
|
207
|
+
- provider 与派单在执行期决定,不成为 Goal Plan 的静态枚举。
|
|
241
208
|
|
|
242
|
-
## 4.
|
|
243
|
-
|
|
244
|
-
规划模式描述为什么需要跨 Ticket 治理,不决定协作或工作区方式。每份新 Goal Plan 都必须分别记录:
|
|
245
|
-
|
|
246
|
-
- `coordination_mode: single-session | lead-team`;
|
|
247
|
-
- `workspace_strategy: current | worktree | mixed`。
|
|
248
|
-
|
|
249
|
-
`single-session` 是默认协作方式:主会话拥有全部项目和 SpecDev 状态写入,只读探索、日志分析、测试观察和审查 Agent 可以返回结论,但不得成为第二写入者。只有用户明确要求或确认严格角色分派时才能使用 `lead-team`;不得根据 Ticket 数量、并行机会或平台能力静默启用。
|
|
250
|
-
|
|
251
|
-
Workspace 按 Ticket 判断,允许触发只有:`parallel-write`、`protect-local-state`、`disposable-experiment`、`background-resume`、`provider-requirement`、`user-requested`。每个触发必须引用实测事实;Agent Team、Ticket 数量、只读并行、顺序写入或泛化的“更安全”都不是触发条件。全部 Ticket 使用当前工作区时为 `current`;全部项目写入位于隔离 workspace 时为 `worktree`;两者并存时为 `mixed`。
|
|
252
|
-
|
|
253
|
-
四种组合均合法,但约束不同:
|
|
254
|
-
|
|
255
|
-
| Coordination | Workspace | 写入约束 |
|
|
256
|
-
|---|---|---|
|
|
257
|
-
| single-session | current | 主会话唯一写入 |
|
|
258
|
-
| single-session | worktree/mixed | 主会话管理并集成隔离写入 |
|
|
259
|
-
| lead-team | current | Lead 唯一写入,Worker 只读 |
|
|
260
|
-
| lead-team | worktree/mixed | `worker-write` 每项绑定独立 workspace,Lead 默认承担 integration owner |
|
|
209
|
+
## 4. Ready 停止条件
|
|
261
210
|
|
|
262
|
-
|
|
211
|
+
存在以下任一情况时 `ready_for_execution: false`:
|
|
263
212
|
|
|
264
|
-
|
|
213
|
+
- Lead locator 无法恢复;
|
|
214
|
+
- 本地 commit 或 candidate integration 未授权;
|
|
215
|
+
- Ticket 无法建立独立 worktree 或父分支不明确;
|
|
216
|
+
- shared path 没有唯一 owner;
|
|
217
|
+
- E2E 是否需要会改变验收结论但尚未确定;
|
|
218
|
+
- 项目验证命令不能执行或无法观察目标行为,且没有批准的替代证据;
|
|
219
|
+
- 当前源码/工作区基线未实测,或外部合同版本仍然浮动;
|
|
220
|
+
- Ticket 与 Spec、ADR、`specdev/adr/`、`specdev/context/` 或代码事实存在未处理冲突;
|
|
221
|
+
- 迁移、发布、不可逆动作或恢复存在高影响未知项;
|
|
222
|
+
- 实现 agent 上限超过 `3`。
|
|
265
223
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
```text
|
|
269
|
-
modes=<mode-list>
|
|
270
|
-
coordination_mode=single-session|lead-team
|
|
271
|
-
workspace_strategy=current|worktree|mixed
|
|
272
|
-
tickets=<count>
|
|
273
|
-
critical_path=<ticket-list>
|
|
274
|
-
parallel_capacity=<n>
|
|
275
|
-
shared_owners=<owner-map>
|
|
276
|
-
gates=<gate-list>
|
|
277
|
-
authorization=<action-summary>
|
|
278
|
-
hard_stops=<none-or-list>
|
|
279
|
-
adopted_assumptions=<low-impact-only>
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
Lead Team 额外形成 `execution_model`、`lead`、`provider`、`checkpoint`、`source_delivery`、`max_correction_rounds` 和 locator;worktree/mixed 额外形成逐 Ticket workspace allocation。两类字段分别只进入各自附录。
|
|
283
|
-
|
|
284
|
-
**完成标准**:规划 modes、coordination mode 与 workspace strategy 互不代替;single-session 没有委派痕迹;current 没有隔离安排;所有条件分支的源码、交付、权限和恢复字段都有可验证值。
|
|
224
|
+
**完成标准**:所有固定字段、适用模式、授权、Lead、父分支和阻塞均可验证;没有替代编排模型或空占位。
|
|
285
225
|
|
|
286
226
|
</planning-modes>
|
|
287
227
|
|
|
@@ -289,202 +229,144 @@ Lead Team 额外形成 `execution_model`、`lead`、`provider`、`checkpoint`、
|
|
|
289
229
|
|
|
290
230
|
# Goal Plan 核心编排协议
|
|
291
231
|
|
|
292
|
-
|
|
232
|
+
本文件定义 DAG、Wave、Gate、路径所有权、Ticket worktree、Evidence 返回和父分支集成队列。
|
|
293
233
|
|
|
294
234
|
## 1. DAG 与关键路径
|
|
295
235
|
|
|
296
|
-
- 依赖权威来自
|
|
297
|
-
- `specdev/changes/{change}/tickets-map.md` 是投影,不是第二套依赖真相;
|
|
236
|
+
- 依赖权威来自 Ticket frontmatter 的 `blocked_by`;Tickets Map 是投影;
|
|
298
237
|
- 计算根节点、扇出、汇合点、关键路径、共享合同 owner 和最终收缩点;
|
|
299
|
-
-
|
|
300
|
-
-
|
|
301
|
-
|
|
302
|
-
## 2. Wave
|
|
303
|
-
|
|
304
|
-
Wave 内 Ticket 必须同时满足:
|
|
238
|
+
- 依赖只表示真实开始条件,不表达偏好、Agent 交接或“最好先做”;
|
|
239
|
+
- 无法独立保持可验证状态的迁移批次必须有明确 Gate 和恢复策略。
|
|
305
240
|
|
|
306
|
-
|
|
307
|
-
- 所有依赖已完成并有 Evidence;
|
|
308
|
-
- 项目写路径不相交;
|
|
309
|
-
- shared path 已由 owner 稳定;
|
|
310
|
-
- 适用 Gate 已打开;
|
|
311
|
-
- 源码基线和外部合同版本一致。
|
|
241
|
+
## 2. Wave 与实现并发
|
|
312
242
|
|
|
313
|
-
|
|
243
|
+
Wave 内 Ticket 必须 Ready、依赖 Evidence 完整、项目写路径不相交、shared owner 已稳定、适用 Gate 已打开且基线一致。
|
|
314
244
|
|
|
315
|
-
|
|
245
|
+
Lead 根据当前事实决定自行实现或派单。同时活跃的 implementation subagent 不得超过 Goal Plan 与 config 中较小的上限,且绝不超过三个;Lead 不计入。Wave 是可并发性,不是必须填满的目标。只读 review/research/test-observation agent 不写固定数字上限,但不得写项目或 SpecDev 状态,也不得争用同一可变测试环境。
|
|
316
246
|
|
|
317
247
|
## 3. Gate
|
|
318
248
|
|
|
319
|
-
Gate
|
|
249
|
+
Gate 用可验证状态定义,必须写明:工程/业务状态、开启条件、关闭证据、阻塞范围、Lead/批准人和失败恢复。常见 Gate 包括共享合同稳定、首条垂直路径、迁移完成、旧调用点归零、候选合并通过、发布就绪和观察期结束。
|
|
320
250
|
|
|
321
|
-
|
|
251
|
+
## 4. Shared path 与合同
|
|
322
252
|
|
|
323
|
-
|
|
253
|
+
遵循 下方 `<path-ownership>` 标签:
|
|
324
254
|
|
|
325
|
-
|
|
255
|
+
1. 专用 owner Ticket 修改共享路径;
|
|
256
|
+
2. 在其 worktree 形成 commit 与非 E2E 证据;
|
|
257
|
+
3. 通过 Lead candidate-merge 进入父分支;
|
|
258
|
+
4. 下游 Ticket 基于新的父分支 checkpoint 创建或刷新 worktree;
|
|
259
|
+
5. 共享合同变化时暂停消费者并修订上游,不让多个执行者竞争写入。
|
|
326
260
|
|
|
327
|
-
|
|
328
|
-
2. 形成可验证稳定基线;
|
|
329
|
-
3. 下游消费者在新基线上重新运行 preflight;
|
|
330
|
-
4. 才允许扇出或继续后续 Ticket;
|
|
331
|
-
5. 共享契约需要变化时暂停消费者并修订上游,不通过多个执行者同时修改解决。
|
|
261
|
+
## 5. 每 Ticket worktree
|
|
332
262
|
|
|
333
|
-
|
|
263
|
+
每个进入 I-implement 的 Ticket 建立唯一 `specdev-worktree/<ticket-id>`。记录 workspace/implementation/integration owner、`base_sha`、父分支、branch、portable locator、source checkpoint、candidate/result SHA 与验证状态。Lead 自行实现时仍进入该 worktree;subagent 身份不决定是否隔离。
|
|
334
264
|
|
|
335
|
-
|
|
265
|
+
同一 Ticket 在 candidate 验证失败后保留来源 worktree并继续修正。新的 source commit 替换当前 `source_checkpoint`,旧 commit 继续由 Git/Evidence 可追溯。成功集成不自动清理 branch/worktree。
|
|
336
266
|
|
|
337
|
-
|
|
338
|
-
2. **migrate**:按可独立验证的影响范围分批迁移;
|
|
339
|
-
3. **observe**:扫描旧调用点、旧数据或旧协议使用量;
|
|
340
|
-
4. **contract**:收缩条件有证据后删除旧形式;
|
|
341
|
-
5. **verify**:运行兼容、数据、回归、监控和回滚检查。
|
|
267
|
+
## 6. 父分支集成队列
|
|
342
268
|
|
|
343
|
-
|
|
269
|
+
Lead 串行集成 Ready 候选:
|
|
344
270
|
|
|
345
|
-
|
|
271
|
+
1. 冻结最新 `parent_before_sha`;
|
|
272
|
+
2. 在 Lead-owned parent integration checkout 组合父分支与 `source_checkpoint`;
|
|
273
|
+
3. 生成可定位的 `candidate_sha`;
|
|
274
|
+
4. 在 candidate 状态运行集成检查和适用 E2E;
|
|
275
|
+
5. 重读父 HEAD;若变化,将候选标记 `stale` 并重建;
|
|
276
|
+
6. 检查通过且父 HEAD 未变时,父分支 fast-forward 到 candidate;
|
|
277
|
+
7. 重读父 HEAD/tree,写入 `result_sha` 后才允许 Ticket Done。
|
|
346
278
|
|
|
347
|
-
|
|
279
|
+
父分支是 source checkpoint 的祖先时 candidate/result 可等于 source SHA,方法为 `fast-forward`;否则 candidate 必须是独立 merge commit。候选失败时父分支保持不变,Ticket 回到 `in_progress` 或 `blocked`。
|
|
348
280
|
|
|
349
|
-
|
|
281
|
+
## 7. Expand-contract
|
|
350
282
|
|
|
351
|
-
|
|
283
|
+
标准顺序为 expand → migrate → observe → contract → verify。每批迁移独立 commit、candidate 验证和父分支集成;收缩依据旧调用/数据/协议归零证据,不依据 Ticket 数量推断。
|
|
352
284
|
|
|
353
|
-
|
|
354
|
-
2. 同步 Ticket、Tickets Map、Goal Plan 和 change 状态;
|
|
355
|
-
3. 检查依赖、路径所有权、合同覆盖和适用 Gate;
|
|
356
|
-
4. 返回 Ticket 状态、Evidence 路径、代码引用、未验证项和恢复条件。
|
|
357
|
-
|
|
358
|
-
最后一个计划内 Implement 按 下方 `<completion-control>` 标签 汇总核心计划的 Gate 和 Evidence。Lead Team 的候选交付验收由独立委派协议拥有;worktree 的 Git 集成由角色中立的 workspace 协议拥有。
|
|
359
|
-
|
|
360
|
-
**完成标准**:每个执行结果可追溯到代码状态和 Evidence;single-session Goal Plan 可以在不建立角色交付合同的情况下完整恢复和完成。
|
|
285
|
+
**完成标准**:每个 Ticket 从父基线、source commit、candidate 到 result 都可恢复;父分支只包含已通过候选门禁的 Ticket。
|
|
361
286
|
|
|
362
287
|
</orchestration-protocol>
|
|
363
288
|
|
|
364
|
-
<
|
|
365
|
-
|
|
366
|
-
# Goal Plan 委派执行协议
|
|
367
|
-
|
|
368
|
-
只有用户在本次 P-goal-plan 运行中明确选择 `coordination_mode: lead-team` 时加载。该分支启用唯一 Lead 与 native/external Worker,但不决定 workspace strategy;Agent Team 可以只做只读分工,也可以与独立 worktree 组合。
|
|
369
|
-
|
|
370
|
-
## 1. Lead 与 Delivery Contract
|
|
371
|
-
|
|
372
|
-
Lead 负责源码基线、DAG、Wave、shared owner、Gate、权限、Evidence 汇总和最终验收;已派发写入 Ticket 的实现由对应执行者负责,Lead 不制造双重 owner。只有 workspace addendum 将 Lead 指定为 integration owner 时,Lead 才拥有对应 Git 集成。
|
|
289
|
+
<lead-orchestration>
|
|
373
290
|
|
|
374
|
-
|
|
291
|
+
# Lead 编排与动态派单协议
|
|
375
292
|
|
|
376
|
-
|
|
293
|
+
## 1. 唯一 Lead
|
|
377
294
|
|
|
378
|
-
|
|
379
|
-
- repository、branch、不可变 checkpoint 与源码交付方式;
|
|
380
|
-
- 最大并发和默认 3 轮的 `max_correction_rounds`;
|
|
381
|
-
- 标准轴、规范轴、Lead 独立验证和条件性 E2E;
|
|
382
|
-
- local changes、commit、push、PR、merge、deploy、migration 和生产动作的逐项授权;
|
|
383
|
-
- 完成、阻塞、偏差、恢复和返回协议。
|
|
295
|
+
Lead 是主会话中的唯一编排 owner,保留需求解释、DAG/Wave/Gate、路径分配、权限、SpecDev 状态、Evidence、候选验收、父分支集成和最终回复责任。恢复时以 Goal Plan 的 `lead` locator 和权威工件继续;更换会话只转移 Lead 身份,不产生第二写入者。
|
|
384
296
|
|
|
385
|
-
|
|
297
|
+
## 2. 派单类型
|
|
386
298
|
|
|
387
|
-
-
|
|
388
|
-
-
|
|
389
|
-
-
|
|
299
|
+
- **implementation**:写入单个 Ticket worktree 的授权项目路径,运行非 E2E 检查并返回 source commit;
|
|
300
|
+
- **review**:只读审查固定 checkpoint,返回 findings;
|
|
301
|
+
- **research**:只读收集代码或外部事实,返回来源与结论;
|
|
302
|
+
- **test-observation**:只读运行或观察已授权检查,返回命令与结果,不拥有 E2E Gate。
|
|
390
303
|
|
|
391
|
-
|
|
304
|
+
Lead 在 Ticket 可以独立执行、写路径不冲突、上下文足够且平台支持时派单。派单是执行期决定,不写回 Goal Plan 作为固定拓扑。
|
|
392
305
|
|
|
393
|
-
##
|
|
306
|
+
## 3. 并发
|
|
394
307
|
|
|
395
|
-
|
|
308
|
+
implementation subagent 同时最多三个,实际值取 Goal Plan、config 与平台能力的最小值;Lead 不计入。review/research/test-observation agent 不设置 SpecDev 数字上限,但 Lead 必须避免测试资源冲突、重复工作和上下文失控。
|
|
396
309
|
|
|
397
|
-
|
|
398
|
-
2. “实现阶段” 与具体 Ticket;
|
|
399
|
-
3. 相关 Spec 合同、ADR/CONTEXT 条目、Wave、Gate 和不可协商约束;
|
|
400
|
-
4. 已完成依赖及其 Evidence;
|
|
401
|
-
5. 项目 writable/read-only/shared 路径与唯一 shared owner;
|
|
402
|
-
6. mutation role、workspace allocation、`base_sha`、workspace/session locator 和 source package hash;
|
|
403
|
-
7. 必跑验证、基线、反向验证和明确不适用项;
|
|
404
|
-
8. 当前授权、偏差升级、修正上限、Evidence 路径和返回字段。
|
|
310
|
+
## 4. 写入边界
|
|
405
311
|
|
|
406
|
-
|
|
312
|
+
implementation subagent 只写分配 worktree 中的项目路径和其 Git commit,不写 Ticket、Map、Goal Plan、Evidence、change status 或父分支。其他 subagent 全部只读。Lead 接收返回后独立核对,再写所有 SpecDev 状态。
|
|
407
313
|
|
|
408
|
-
##
|
|
314
|
+
## 5. 动态 Dispatch Packet
|
|
409
315
|
|
|
410
|
-
|
|
316
|
+
每次派单必须绑定 Ticket、Goal Plan、依赖 Evidence、不可变 `base_sha`、branch/workspace locator、writable/read-only/shared paths、provider、允许动作、非 E2E 验证、停止条件和返回格式。provider 或模型按当次能力与授权选择;外部 provider 需要独立的数据发送授权。
|
|
411
317
|
|
|
412
|
-
|
|
318
|
+
implementation 返回至少包含:Ticket ID、workspace locator、最终 commit、dirty 状态、修改路径、检查命令/结果、未验证项、冲突与阻塞。review/research 返回固定输入、findings、来源和未验证声明。
|
|
413
319
|
|
|
414
|
-
|
|
415
|
-
2. 检查 checkpoint、附件 hash、路径授权、依赖和敏感信息边界;
|
|
416
|
-
3. 按 mutation role 和 workspace allocation 核对交付,在声明基线上复跑定向验证和受影响回归;
|
|
417
|
-
4. 仅当 UI 交互受影响时运行最小 E2E;
|
|
418
|
-
5. provider 声明、模拟结果和静态推断在独立证据前保持 `unverified`;
|
|
419
|
-
6. 验证通过后接受候选交付;存在 `terminal_action=integrate` 的 workspace 时交给其 integration owner 自动本地集成,否则按 current workspace 或 retain 合同继续;
|
|
420
|
-
7. 同步 Ticket、Map、Evidence 和 Goal Plan,检查 Gate 是否可关闭。
|
|
320
|
+
## 6. Lead 验收
|
|
421
321
|
|
|
422
|
-
|
|
322
|
+
Lead 核对基线、路径、commit、dirty 状态、项目事实与非 E2E 结果;不接受 subagent 自报的 Evidence 或 E2E pass。implementation 候选进入 dev-worktree candidate-merge;read-only 结果由 Lead 复核后写入对应权威工件。失败返回同一 Ticket worktree 修正或标记 blocked。
|
|
423
323
|
|
|
424
|
-
|
|
324
|
+
**完成标准**:每次写入只有一个 Ticket/owner/worktree;所有 SpecDev 状态由 Lead 落盘;派单和返回可从 Evidence 恢复。
|
|
425
325
|
|
|
426
|
-
</
|
|
326
|
+
</lead-orchestration>
|
|
427
327
|
|
|
428
328
|
<completion-control>
|
|
429
329
|
|
|
430
|
-
# Goal Plan
|
|
330
|
+
# Goal Plan 完成、证据与恢复
|
|
431
331
|
|
|
432
|
-
## 1.
|
|
433
|
-
|
|
434
|
-
Goal Plan 用紧凑摘要表达业务目标、受众、所有 Ticket 完成后的可观察终态、关键约束、非目标、权威来源、冲突规则和伪完成判据,不复制 Spec 的完整用户故事。
|
|
435
|
-
|
|
436
|
-
## 2. 整体 Definition of Done
|
|
437
|
-
|
|
438
|
-
整体完成至少覆盖:
|
|
439
|
-
|
|
440
|
-
- 所有计划内 Ticket 完成,cancelled 或 deferred 项有批准;
|
|
441
|
-
- 所有 Spec 验收合同和外部符合性要求有 Evidence;
|
|
442
|
-
- 项目类型检查、静态检查、测试、lint、构建、适用 CI 和受影响 E2E 完成,基线没有未经批准的退化;
|
|
443
|
-
- 可静默失效的关键门禁完成受控反向验证并恢复绿色;
|
|
444
|
-
- 迁移、兼容、调用点清零、监控、回滚和不可逆批准完成;
|
|
445
|
-
- 无未批准偏差、未处置高风险残余问题或伪装成通过的 `unverified` 声明;
|
|
446
|
-
- Ticket、Map、Goal Plan、Evidence、代码事实和状态一致。
|
|
447
|
-
|
|
448
|
-
## 3. Gate 关闭与 change 完成
|
|
449
|
-
|
|
450
|
-
每个 Gate 关闭时汇总覆盖 Evidence,检查合同、共享接口、数据、兼容、迁移和调用点,运行里程碑验证和适用 E2E,执行必要反向验证,审查偏差/风险/恢复能力,获取适用人工批准,并同步 Goal Plan、Map 和状态。
|
|
332
|
+
## 1. 整体 Definition of Done
|
|
451
333
|
|
|
452
|
-
|
|
334
|
+
至少要求:
|
|
453
335
|
|
|
454
|
-
-
|
|
455
|
-
-
|
|
336
|
+
- Spec 验收合同全部有通过 Evidence 或明确批准的 deferred;
|
|
337
|
+
- 所有非 cancelled Ticket 都有 source commit、通过的 candidate 和父分支 result SHA;
|
|
338
|
+
- shared path、接口、数据、兼容、迁移、调用点与回滚合同闭合;
|
|
339
|
+
- 项目定向检查、受影响回归、类型检查、lint/build 和适用 E2E 无未经批准退化;
|
|
340
|
+
- change 状态、Ticket、Map、Goal Plan、Evidence 与实际 Git 状态一致;
|
|
341
|
+
- 没有未集成 source checkpoint、活动 integration candidate 或未决高影响偏差。
|
|
456
342
|
|
|
457
|
-
|
|
343
|
+
无需改动的 Ticket 必须转为 `cancelled` 并记录来源事实;不得用 Evidence-only Done 或 empty commit 关闭。
|
|
458
344
|
|
|
459
|
-
##
|
|
345
|
+
## 2. 两层验证
|
|
460
346
|
|
|
461
|
-
|
|
347
|
+
- `source-worktree`:implementation owner 运行 Ticket 要求的单元、组件、静态、类型、lint/build 等非 E2E 检查;
|
|
348
|
+
- `parent-candidate`:Lead 运行受影响集成/回归和 Ticket 标记 required 的 E2E。
|
|
462
349
|
|
|
463
|
-
|
|
350
|
+
Evidence 必须记录命令运行环境。任何在 source worktree 声称的 E2E pass 都无效;subagent 返回的测试结果在 Lead 核对前保持候选状态。
|
|
464
351
|
|
|
465
|
-
|
|
352
|
+
## 3. Gate 关闭
|
|
466
353
|
|
|
467
|
-
|
|
354
|
+
Lead 在每个 Gate 汇总覆盖 Evidence、接口/数据/兼容状态、candidate/result SHA、适用 E2E、反向验证、偏差、风险和批准。Gate 不以“完成若干 Ticket”作为唯一关闭条件。
|
|
468
355
|
|
|
469
|
-
|
|
356
|
+
## 4. 失败与恢复
|
|
470
357
|
|
|
471
|
-
|
|
358
|
+
- source 检查失败:保留 worktree,继续当前 Ticket;
|
|
359
|
+
- candidate 冲突或检查失败:父分支不动,integration 记 `failed`,Ticket 回到 `in_progress`/`blocked`;
|
|
360
|
+
- 父 HEAD 漂移:integration 记 `stale`,从最新父分支重建并重跑;
|
|
361
|
+
- E2E required 失败:父分支不动,保留失败命令、candidate SHA 和恢复条件;
|
|
362
|
+
- 命中当次 Dispatch Packet/候选协议的停止条件、继续修正已无合理收益或需要新产品决定:停止受影响 Wave,按 deviation control 返回契约 owner;
|
|
363
|
+
- Lead 会话变化:读取 Goal Plan、Ticket、change worktree 状态与最新 Evidence,从最后不可变 checkpoint 恢复。
|
|
472
364
|
|
|
473
|
-
##
|
|
365
|
+
## 5. Change 完成 owner
|
|
474
366
|
|
|
475
|
-
|
|
367
|
+
Lead 是 Goal Plan change 的唯一完成 owner。没有 Goal Plan 的单 Ticket/Direct Spec 由当前 I-implement owner 按 change completion 规则完成。Archive 不补造完成证据。
|
|
476
368
|
|
|
477
|
-
|
|
478
|
-
WAVE_STATUS wave=<n> ready=<ids> active=<ids> done=<ids> blocked=<ids>
|
|
479
|
-
GATE_STATUS gate=<name> state=open|closed evidence=<paths> risks=<summary>
|
|
480
|
-
TICKET_STATUS id=<id> state=<state> evidence=<path> deviation=<none|id>
|
|
481
|
-
BLOCKER id=<id> owner=<owner> needed=<decision-or-input> impact=<scope>
|
|
482
|
-
DECISION id=<id> owner=<owner> status=pending|approved|rejected impact=<scope>
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
Lead Team 的交付状态格式由委派协议提供,不加入 single-session Goal Plan。
|
|
486
|
-
|
|
487
|
-
**完成标准**:进度可由权威工件恢复;普通计划由最后一个 Implement 完成,委派计划由 Lead 完成;所有通过、阻塞和未验证声明均能定位到具体 Evidence 与代码事实。
|
|
369
|
+
**完成标准**:所有通过、阻塞、取消和未验证声明均定位到权威工件、命令与 Git checkpoint;失败不会推进父分支或 Done。
|
|
488
370
|
|
|
489
371
|
</completion-control>
|
|
490
372
|
|
|
@@ -495,13 +377,16 @@ Lead Team 的交付状态格式由委派协议提供,不加入 single-session
|
|
|
495
377
|
生成该工件时,将以下字段写在文档开头的 YAML frontmatter 中:
|
|
496
378
|
|
|
497
379
|
```yaml
|
|
498
|
-
schema_version:
|
|
380
|
+
schema_version: 5
|
|
499
381
|
artifact: goal-plan
|
|
500
382
|
change: <YYYY-MM-DD-topic>
|
|
501
383
|
status: draft
|
|
502
|
-
modes: [
|
|
503
|
-
|
|
504
|
-
|
|
384
|
+
modes: []
|
|
385
|
+
orchestration: lead-directed
|
|
386
|
+
lead: <owner-or-session-locator>
|
|
387
|
+
implementation_agent_limit: 3
|
|
388
|
+
ticket_workspace_policy: required
|
|
389
|
+
integration_gate: candidate-merge
|
|
505
390
|
ready_for_execution: false
|
|
506
391
|
```
|
|
507
392
|
|
|
@@ -526,10 +411,11 @@ ready_for_execution: false
|
|
|
526
411
|
| 优先级 | 来源 | 负责内容 | 冲突处理 |
|
|
527
412
|
|---|---|---|---|
|
|
528
413
|
| 1 | 用户最新明确决定 | 产品取舍与批准 | 更新真正拥有该决策的工件 |
|
|
529
|
-
| 2 | `specdev/changes/{change}/ADR.md` | 当前 change
|
|
530
|
-
| 3 | `specdev/changes/{change}/
|
|
531
|
-
| 4 | `specdev/changes/{change}/
|
|
532
|
-
| 5 |
|
|
414
|
+
| 2 | `specdev/changes/{change}/ADR.md` 与 `specdev/changes/{change}/CONTEXT.md` | 当前 change 架构决定与领域语义 | 返回 “设计访谈能力” 更新真正 owner |
|
|
415
|
+
| 3 | `specdev/adr/` 与 `specdev/context/` | 已毕业的永久决定与领域知识 | 当前 change 替代时在 `specdev/changes/{change}/ADR.md` 与 `specdev/changes/{change}/LOG.md` 明示 |
|
|
416
|
+
| 4 | `specdev/changes/{change}/spec.md` | 外部行为、范围与验收 | 下游不得改写 |
|
|
417
|
+
| 5 | `specdev/changes/{change}/ticket/` | 单 Ticket 契约 | Goal Plan 只编排 |
|
|
418
|
+
| 6 | `specdev/changes/{change}/diagnosis.md` 与当前代码/运行事实 | 已验证根因、现状与可行性 | 冲突时触发偏差并返回真正 owner |
|
|
533
419
|
|
|
534
420
|
## 2. Execution Graph
|
|
535
421
|
|
|
@@ -541,14 +427,14 @@ ready_for_execution: false
|
|
|
541
427
|
|
|
542
428
|
### Waves and Ownership
|
|
543
429
|
|
|
544
|
-
| Wave | Ticket | 前置条件 | 项目写路径 | Shared owner |
|
|
430
|
+
| Wave | Ticket | 前置条件 | 项目写路径 | Shared owner | Gate/集成序号 |
|
|
545
431
|
|---|---|---|---|---|---|
|
|
546
432
|
|
|
547
433
|
### Ticket Quick Reference
|
|
548
434
|
|
|
549
|
-
| ID |
|
|
550
|
-
|
|
551
|
-
| T-01 | `specdev/
|
|
435
|
+
| ID | 可观察产出 | Dependencies | Worktree | Implementation owner | E2E disposition | Evidence |
|
|
436
|
+
|---|---|---|---|---|---|---|
|
|
437
|
+
| T-01 | ... | — | `specdev-worktree/T-01` | Lead / dynamic dispatch | required / not-required: reason | `specdev/changes/{change}/evidence/T-01.md` |
|
|
552
438
|
|
|
553
439
|
## 3. Gates and Completion Evidence
|
|
554
440
|
|
|
@@ -556,7 +442,7 @@ ready_for_execution: false
|
|
|
556
442
|
|
|
557
443
|
### Gates
|
|
558
444
|
|
|
559
|
-
| Gate | 开启条件 | 关闭证据 | 阻塞范围 |
|
|
445
|
+
| Gate | 开启条件 | 关闭证据 | 阻塞范围 | Lead/批准人 | 失败恢复 |
|
|
560
446
|
|---|---|---|---|---|---|
|
|
561
447
|
|
|
562
448
|
### Contract and Reference Coverage
|
|
@@ -566,41 +452,44 @@ ready_for_execution: false
|
|
|
566
452
|
|
|
567
453
|
## 4. Execution and Integration Protocol
|
|
568
454
|
|
|
569
|
-
###
|
|
455
|
+
### Lead Orchestration
|
|
570
456
|
|
|
571
|
-
|
|
|
457
|
+
| 项目 | 决定 | 事实依据 |
|
|
572
458
|
|---|---|---|
|
|
573
|
-
|
|
|
574
|
-
|
|
|
459
|
+
| Lead | `<owner-or-session-locator>` | 唯一 SpecDev 状态、Evidence 与父分支 owner |
|
|
460
|
+
| Implementation subagents | `<= 3`,Lead 不计入 | config、依赖和平台能力的最小值 |
|
|
461
|
+
| Read-only agents | 无 SpecDev 数字上限 | review/research/test-observation,不写状态 |
|
|
462
|
+
| Dispatch | execution-time dynamic | provider/模型/派单按 Ticket 事实选择 |
|
|
575
463
|
|
|
576
|
-
### Ticket
|
|
464
|
+
### Ticket Workspace and Candidate Integration
|
|
577
465
|
|
|
578
|
-
| Ticket |
|
|
579
|
-
|
|
466
|
+
| Ticket | Parent/base | Worktree/branch | Source checks | Source commit | Candidate checks/E2E | Parent result |
|
|
467
|
+
|---|---|---|---|---|---|---|
|
|
468
|
+
|
|
469
|
+
集成按表中顺序串行进行。source worktree 不运行 E2E;Lead 在最新父分支的 candidate 状态运行集成检查和适用 E2E,通过且父 HEAD 未漂移后才推进父分支。
|
|
580
470
|
|
|
581
471
|
### Authorization Matrix
|
|
582
472
|
|
|
583
473
|
| 动作 | 状态 | 目标与条件 |
|
|
584
474
|
|---|---|---|
|
|
585
|
-
|
|
|
586
|
-
| Implementation commit | allowed / not-authorized |
|
|
587
|
-
|
|
|
588
|
-
|
|
|
589
|
-
|
|
|
475
|
+
| Ticket worktree local changes | allowed / not-authorized | 限 writable/shared owner 合同 |
|
|
476
|
+
| Implementation commit | allowed / not-authorized | 每 Ticket 必需;缺失则 Plan blocked |
|
|
477
|
+
| Local candidate integration and parent update | allowed / not-authorized | Lead-only;缺失则 Plan blocked |
|
|
478
|
+
| Push / PR / remote merge | allowed / not-authorized | 不从本计划本地授权继承 |
|
|
479
|
+
| Branch/worktree cleanup | allowed / not-authorized | 成功集成不自动继承 |
|
|
480
|
+
| Deploy / migration / production actions | allowed / not-authorized | 逐动作、目标和条件 |
|
|
590
481
|
|
|
591
|
-
### Evidence Return
|
|
482
|
+
### Evidence Return
|
|
592
483
|
|
|
593
|
-
|
|
484
|
+
subagent 只返回候选事实与 commit;Lead 独立核对并写 Evidence、状态和最终验收。
|
|
594
485
|
|
|
595
486
|
## 5. Constraints, Risk and Recovery
|
|
596
487
|
|
|
597
488
|
### Non-negotiable Constraints
|
|
598
489
|
|
|
599
|
-
每条包含来源和违反后果;局部实现自由进入 Guidance。
|
|
600
|
-
|
|
601
490
|
### Verification Integrity
|
|
602
491
|
|
|
603
|
-
|
|
492
|
+
记录判卷接缝、基线、禁止的伪绿色方式,以及 source/candidate 两层验证边界。
|
|
604
493
|
|
|
605
494
|
### Migration or Release Sequence
|
|
606
495
|
|
|
@@ -614,93 +503,20 @@ ready_for_execution: false
|
|
|
614
503
|
|
|
615
504
|
### Current Status
|
|
616
505
|
|
|
617
|
-
记录 Wave/Gate、Ticket
|
|
506
|
+
记录 Wave/Gate、Ticket、source/candidate/result SHA、最近验证和未验证项;不使用主观百分比。
|
|
618
507
|
|
|
619
508
|
### Pending Decisions and Blockers
|
|
620
509
|
|
|
621
|
-
记录失败命令、已通过行为、owner 和恢复条件。
|
|
622
|
-
|
|
623
510
|
### Resume Protocol
|
|
624
511
|
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
### Reporting Format
|
|
512
|
+
恢复时读取 Goal Plan、当前 Ticket、change worktree 状态和最新 Evidence;从最后通过的父分支 result 或待修正 source checkpoint 继续。
|
|
628
513
|
|
|
629
514
|
## Assumptions
|
|
630
515
|
|
|
631
|
-
|
|
516
|
+
只记录低影响且可验证的假设。存在高影响假设时 `ready_for_execution` 必须为 `false`。
|
|
632
517
|
|
|
633
518
|
</goal-plan-template>
|
|
634
519
|
|
|
635
|
-
<workspace-execution-template>
|
|
636
|
-
|
|
637
|
-
## Isolated Workspace Addendum
|
|
638
|
-
|
|
639
|
-
只在 `workspace_strategy: worktree` 或 `workspace_strategy: mixed` 时加入。它独立于 Agent Team:单会话和 Lead Team 都可加载本附录。
|
|
640
|
-
|
|
641
|
-
### Workspace Decision
|
|
642
|
-
|
|
643
|
-
| 字段 | 值 |
|
|
644
|
-
|---|---|
|
|
645
|
-
| Strategy | worktree / mixed |
|
|
646
|
-
| Trigger | parallel-write / protect-local-state / disposable-experiment / background-resume / provider-requirement / user-requested |
|
|
647
|
-
| Current-workspace writer | `<primary-session-or-lead>` |
|
|
648
|
-
| Integration serialization | 每次只允许一个 integration owner 修改目标父分支 |
|
|
649
|
-
|
|
650
|
-
### Per-Ticket Workspace Allocation
|
|
651
|
-
|
|
652
|
-
| Ticket | Trigger and evidence | Implementation owner | Integration owner | Provider | Base SHA | Parent branch | Branch / workspace ref | Terminal action |
|
|
653
|
-
|---|---|---|---|---|---|---|---|---|
|
|
654
|
-
| T-01 | `<allowed-trigger>: <observed-fact>` | `<owner>` | `<owner>` | git / native / external | `<immutable-sha>` | `<parent-branch>` | `<branch>` / `<portable-locator>` | integrate / retain |
|
|
655
|
-
|
|
656
|
-
### Local Integration Authorization
|
|
657
|
-
|
|
658
|
-
`terminal_action=integrate` 持久授权 integration owner 执行本 Ticket 的本地 fast-forward,或在分叉时完成 `git add`、`git merge --continue` 和一次集成专用 merge commit。普通实现提交、push、PR、远端 merge、部署、迁移以及删除 branch/worktree 不从该授权继承。
|
|
659
|
-
|
|
660
|
-
来源 checkpoint、路径审计和验证通过后才可从 `review` 进入 `integrating`。集成成功写入 result SHA 与 Evidence;失败时中止正在进行的 merge、保留来源 workspace,并记录 blocker 和恢复条件。
|
|
661
|
-
|
|
662
|
-
</workspace-execution-template>
|
|
663
|
-
|
|
664
|
-
<delegated-execution-template>
|
|
665
|
-
|
|
666
|
-
## Delegated Execution Addendum
|
|
667
|
-
|
|
668
|
-
### Delivery Contract
|
|
669
|
-
|
|
670
|
-
| 字段 | 值 |
|
|
671
|
-
|---|---|
|
|
672
|
-
| Execution model | native-subagent / external-web-subagent |
|
|
673
|
-
| Lead / Provider | `<owner>` / `<provider>` |
|
|
674
|
-
| Repository / Source baseline | `<repository-or-local>` / `<immutable-checkpoint>` |
|
|
675
|
-
| Checkpoint policy | immutable SHA / equivalent fixed baseline |
|
|
676
|
-
| Source delivery | repository-url / source-package / combination |
|
|
677
|
-
| Max concurrency / corrections | `<n>` / `3` |
|
|
678
|
-
| Review | standards + spec + Lead verification + conditional E2E |
|
|
679
|
-
| Mutation policy | read-only / lead-write / worker-write;worker-write 必须引用隔离 workspace |
|
|
680
|
-
|
|
681
|
-
### Per-Ticket Dispatch Packets
|
|
682
|
-
|
|
683
|
-
#### Dispatch: T-01
|
|
684
|
-
|
|
685
|
-
- **Goal / observable result:**
|
|
686
|
-
- **Priority on conflict:** correctness > contract completeness > speed,或当前项目裁决
|
|
687
|
-
- **Implement / Ticket:** “实现阶段”;`specdev/changes/{change}/ticket/01-<name>.md`
|
|
688
|
-
- **Authority / dependencies:** 相关合同、ADR/CONTEXT、已完成依赖 Evidence
|
|
689
|
-
- **Wave / Gate / hard constraints:**
|
|
690
|
-
- **Writable / read-only / shared owner:**
|
|
691
|
-
- **Mutation role / workspace allocation:** read-only / lead-write / worker-write;current 或对应 isolated allocation
|
|
692
|
-
- **Baseline / workspace or session locator / package hash:**
|
|
693
|
-
- **Preflight receipt:** 在 `specdev/changes/{change}/evidence/T-01.md` 记录目标、顺序、最大风险和基线差异,不超过 10 行
|
|
694
|
-
- **Verification / baseline / reverse check:**
|
|
695
|
-
- **Authorization / deviation / correction limit:**
|
|
696
|
-
- **Return:** 状态、Evidence、locator、最终 checkpoint、commit/PR、未验证项、待 Lead E2E
|
|
697
|
-
|
|
698
|
-
### Candidate Delivery Return and Lead Acceptance
|
|
699
|
-
|
|
700
|
-
Worker 将 Ticket 推进到 `review` 并返回候选交付;Lead 负责独立验证、适用 E2E、候选验收和 Gate 判断。Git 集成只在独立 workspace 合同指定 Lead 为 integration owner 时发生;达到修正上限时保留最后可信 checkpoint、失败命令、已通过行为和恢复条件。
|
|
701
|
-
|
|
702
|
-
</delegated-execution-template>
|
|
703
|
-
|
|
704
520
|
<artifact-contract>
|
|
705
521
|
|
|
706
522
|
# 工件职责与权威裁决
|
|
@@ -783,39 +599,37 @@ Change CONTEXT/ADR 是 active change 内的执行权威,不是 workflow 级永
|
|
|
783
599
|
|
|
784
600
|
# 路径所有权与并发规则
|
|
785
601
|
|
|
786
|
-
|
|
602
|
+
路径所有权是逻辑写入边界;worktree 是物理隔离边界,两者不能互相替代。
|
|
787
603
|
|
|
788
604
|
## 1. 四类路径
|
|
789
605
|
|
|
790
|
-
- `expected_changes
|
|
791
|
-
- `writable_paths
|
|
792
|
-
- `read_only_paths
|
|
793
|
-
- `shared_paths`:多个 Ticket
|
|
606
|
+
- `expected_changes`:导航预测;
|
|
607
|
+
- `writable_paths`:当前 Ticket implementation owner 可写的硬边界;
|
|
608
|
+
- `read_only_paths`:只读上下文;
|
|
609
|
+
- `shared_paths`:多个 Ticket 可能触达且必须有唯一 owner 的项目路径。
|
|
794
610
|
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
```yaml
|
|
798
|
-
expected_changes: ["src/auth/session.ts"]
|
|
799
|
-
writable_paths: ["src/auth/**"]
|
|
800
|
-
read_only_paths: ["src/users/**"]
|
|
801
|
-
shared_paths: ["package.json"]
|
|
802
|
-
```
|
|
611
|
+
所有项目路径使用项目根相对路径。根依赖清单、锁文件、根导出、共享 schema、迁移索引、全局路由和跨 Ticket 合同默认视为 shared。
|
|
803
612
|
|
|
804
613
|
## 2. 所有权规则
|
|
805
614
|
|
|
806
|
-
1. 可能并行的 Ticket,其
|
|
807
|
-
2.
|
|
808
|
-
3.
|
|
809
|
-
4.
|
|
810
|
-
5.
|
|
811
|
-
6.
|
|
812
|
-
|
|
615
|
+
1. 可能并行的 Ticket,其 writable paths 不得相交;glob 按覆盖关系判断。
|
|
616
|
+
2. shared path 只由专用 owner Ticket 修改;消费者 Ticket 只读。Lead 负责集成,不以冲突解决替代 shared owner。
|
|
617
|
+
3. implementation subagent 只写其 Packet 与 Ticket 授权路径;Lead 自行实现也受同一边界约束。
|
|
618
|
+
4. review/research/test-observation agent 只读项目与 SpecDev 工件。
|
|
619
|
+
5. 越界前停止并按 deviation control 提出 ownership change;不得先改后报。
|
|
620
|
+
6. 上游 Ticket 改变目录/合同后,下游基于已集成父分支重新解析路径和 preflight。
|
|
621
|
+
|
|
622
|
+
## 3. Ticket worktree
|
|
813
623
|
|
|
814
|
-
|
|
624
|
+
每个进入 I-implement 的 Ticket 都使用唯一来源 worktree `specdev-worktree/<ticket-id>`,无论是否并行、是否派遣 subagent。Ticket 切片是隔离依据;Agent Team 不是 worktree 触发器。没有 Ticket 的获批 Direct Spec 可由 current workspace 唯一 owner 执行;只读调查不创建实现 worktree。
|
|
815
625
|
|
|
816
|
-
|
|
626
|
+
workspace/implementation owner 可以是 Lead 或动态 implementation subagent;integration owner 固定为 Lead。只有 Lead 写 SpecDev 状态、建立 parent-candidate、运行适用 E2E 并推进父分支。生命周期由 下方 `<dev-worktree>` 标签 管理。
|
|
817
627
|
|
|
818
|
-
|
|
628
|
+
## 4. 并发
|
|
629
|
+
|
|
630
|
+
implementation subagent 同时最多三个,Lead 不计入;实际上限取 Goal Plan、config 和平台能力最小值。review/research/test-observation agent 不设置 SpecDev 数字上限,但 Lead 必须避免重复工作与可变环境争用。
|
|
631
|
+
|
|
632
|
+
**完成标准**:每个项目写入映射到唯一 Ticket、owner 和来源 worktree;shared 与父分支写入 owner 唯一。
|
|
819
633
|
|
|
820
634
|
</path-ownership>
|
|
821
635
|
|
|
@@ -823,61 +637,51 @@ Worktree 只在存在可观察隔离需求时使用:并行写入、保护当
|
|
|
823
637
|
|
|
824
638
|
# 证据与验证规范
|
|
825
639
|
|
|
826
|
-
|
|
640
|
+
验证回答“怎样证明”,Evidence 记录“实际运行了什么、在哪个状态运行、结果和残余风险是什么”。
|
|
827
641
|
|
|
828
642
|
## 1. 验证矩阵
|
|
829
643
|
|
|
830
|
-
|
|
644
|
+
每行绑定行为、合同或风险,并标记环境:
|
|
831
645
|
|
|
832
|
-
| 行为或风险 |
|
|
833
|
-
|
|
834
|
-
|
|
|
835
|
-
|
|
|
836
|
-
|
|
|
646
|
+
| 行为或风险 | 接缝 | 命令/方法 | 环境 | 预期 | Evidence |
|
|
647
|
+
|---|---|---|---|---|---|
|
|
648
|
+
| 正常/失败路径 | 公共接口或稳定接缝 | 定向测试 | source-worktree | 合同成立 | Ticket Evidence |
|
|
649
|
+
| 跨模块回归 | 集成接缝 | 回归命令 | parent-candidate | 组合状态成立 | Ticket Evidence |
|
|
650
|
+
| E2E required | 真实端到端边界 | 场景步骤 | parent-candidate | 外部行为成立 | Ticket Evidence |
|
|
651
|
+
|
|
652
|
+
## 2. 两层验证
|
|
653
|
+
|
|
654
|
+
### Source-worktree
|
|
655
|
+
|
|
656
|
+
implementation owner 运行最接近目标行为的单元/组件测试、静态分析、类型、lint/build 等适用非 E2E 检查。来源实现必须在 clean worktree 形成 commit。任何 source-worktree E2E pass 声明无效。
|
|
837
657
|
|
|
838
|
-
|
|
658
|
+
### Parent-candidate
|
|
839
659
|
|
|
840
|
-
|
|
660
|
+
Lead 在最新父分支与 source commit 的 candidate 状态运行受影响集成/回归、项目父状态检查和适用 E2E。E2E 由实际跨边界风险决定,不限于 UI;not-required 必须写理由。required E2E 未运行或失败时不得推进父分支。
|
|
841
661
|
|
|
842
|
-
|
|
662
|
+
### Direct Spec
|
|
843
663
|
|
|
844
|
-
|
|
845
|
-
2. 稳定接缝上的单元测试;
|
|
846
|
-
3. 类型检查、静态分析、lint 和构建;
|
|
847
|
-
4. 可重复手动步骤、截图或查询结果;
|
|
848
|
-
5. 代码阅读推断。
|
|
664
|
+
获批 Direct Spec 不创建 Ticket worktree 或 candidate。Lead 在 current workspace 记录实施前基线,运行轻量合同要求的定向检查、适用回归与 E2E,并记录最终 checkpoint、dirty 状态、运行环境、命令、退出状态和未运行原因。E2E 仍只由 Lead 执行;不得为套用两层验证而伪造 Ticket、source/candidate/result 或父分支推进证据。
|
|
849
665
|
|
|
850
|
-
|
|
666
|
+
低层证据不能替代明确要求的外部行为证据。高风险迁移还需要 dry-run、调用点扫描、数据核对、监控或恢复演练。
|
|
851
667
|
|
|
852
|
-
|
|
668
|
+
## 3. Agent 声明
|
|
853
669
|
|
|
854
|
-
|
|
670
|
+
subagent 只返回候选命令与结果,不写 Evidence。Lead 重读 workspace/Git、必要时复跑或核对输出后落盘;外部 provider 自报、截图、模拟和推断在此之前标记 `unverified`。review/research/test-observation agent 不拥有 E2E Gate。
|
|
855
671
|
|
|
856
|
-
|
|
672
|
+
## 4. 失败分类与完整性
|
|
857
673
|
|
|
858
|
-
|
|
859
|
-
- 基线已存在的失败;
|
|
860
|
-
- 环境、权限或基础设施失败;
|
|
861
|
-
- 验证本身无效或无法观察目标行为。
|
|
674
|
+
失败分类为本 Ticket 新失败、基线既有失败、环境/权限/基础设施失败、无效验证或 candidate stale。不得通过跳过、放宽断言、吞错、删除用例或迁移验证位置制造绿色。
|
|
862
675
|
|
|
863
|
-
|
|
676
|
+
受控反向验证只用于可能静默通过的关键门禁:证明检查能在目标风险出现时失败,再恢复并重跑。普通测试不为形式执行破坏性操作。
|
|
864
677
|
|
|
865
|
-
##
|
|
678
|
+
## 5. Evidence 最低内容
|
|
866
679
|
|
|
867
|
-
|
|
680
|
+
每个 Ticket Evidence 至少包含:Lead、Dispatch/返回(若有)、base/source/candidate/result SHA、来源 worktree、实际路径、每条命令/环境/退出状态、合同映射、双轴审查、E2E disposition、未运行项、失败分类、偏差、残余风险和父分支重读结果。
|
|
868
681
|
|
|
869
|
-
|
|
870
|
-
- 实际修改的项目路径;
|
|
871
|
-
- 每条命令、退出状态和结果摘要;
|
|
872
|
-
- 每条验收合同的证据映射;
|
|
873
|
-
- 未运行项与原因;
|
|
874
|
-
- 新失败、既有失败和环境失败;
|
|
875
|
-
- 偏差及批准;
|
|
876
|
-
- 残余风险;
|
|
877
|
-
- worktree、提交或 PR 引用;
|
|
878
|
-
- 最终结论。
|
|
682
|
+
Ticket Done 必须有 source commit、通过 candidate、父分支 result 与 Lead Evidence。无法运行 required 验证、存在未批准偏差、父分支未包含 source commit 或 Evidence 不完整时不得 Done。
|
|
879
683
|
|
|
880
|
-
|
|
684
|
+
Direct Spec Evidence 至少包含:用户批准与轻量合同、Lead、实施前/最终 checkpoint、实际路径、定向/回归/E2E 命令及环境、验收映射、未运行项、偏差、残余风险和提交授权状态。
|
|
881
685
|
|
|
882
686
|
</evidence-and-verification>
|
|
883
687
|
|
|
@@ -925,7 +729,7 @@ E2E 仅在变更影响用户界面交互时加入验证矩阵。普通执行由
|
|
|
925
729
|
|
|
926
730
|
- 未批准的 ticket、spec、architecture 或 release 偏差不得继续实现。
|
|
927
731
|
- 不得通过扩大 `writable_paths`、删除测试、降低断言或把风险改写成“已知限制”来绕过停止。
|
|
928
|
-
-
|
|
732
|
+
- 偏差影响并行执行、source checkpoint 或 candidate 集成时,Lead 必须暂停受影响 Wave,重新计算路径所有权、依赖、Gate 与父分支顺序;任何 subagent 都不能自行改写上层合同。
|
|
929
733
|
|
|
930
734
|
</deviation-control>
|
|
931
735
|
|
|
@@ -933,38 +737,35 @@ E2E 仅在变更影响用户界面交互时加入验证矩阵。普通执行由
|
|
|
933
737
|
|
|
934
738
|
# Change Completion
|
|
935
739
|
|
|
936
|
-
本规则是 change 从 active/blocked 转为 completed
|
|
740
|
+
本规则是 change 从 active/blocked 转为 completed 的唯一合同。
|
|
937
741
|
|
|
938
742
|
## 完成门
|
|
939
743
|
|
|
940
|
-
一个 change
|
|
744
|
+
一个 change 只有同时满足以下条件才能 completed:
|
|
941
745
|
|
|
942
|
-
1. 所有计划内 Ticket 为
|
|
943
|
-
2.
|
|
944
|
-
3.
|
|
945
|
-
4.
|
|
946
|
-
5.
|
|
947
|
-
6.
|
|
746
|
+
1. 所有计划内 Ticket 为 done,或因权威事实无需改动而记录为 cancelled;Direct Spec/非实现流程有等价验收。
|
|
747
|
+
2. 每个 done Ticket 有 source commit、passed candidate、父分支 result SHA,且父分支包含 source commit;worktree 生命周期为 `integrated` 或完成来源清理后的 `removed`。
|
|
748
|
+
3. 每个行为有 Lead Evidence,全部 Spec 合同与 Goal Gate 可定位。
|
|
749
|
+
4. source-worktree 非 E2E 检查、parent-candidate 集成/回归和 required E2E 已通过;not-required 有理由。
|
|
750
|
+
5. 迁移、发布、监控、恢复和不可逆批准已完成或明确不适用。
|
|
751
|
+
6. 没有未批准 deviation、blocker、unverified、活动 candidate 或未集成 source checkpoint。
|
|
752
|
+
7. Ticket、Map、Goal Plan、Evidence、change status 与实际 Git 一致。
|
|
753
|
+
|
|
754
|
+
Evidence-only Done 和 empty commit 不满足完成门。
|
|
948
755
|
|
|
949
756
|
## 转换 Owner
|
|
950
757
|
|
|
951
|
-
- Goal Plan
|
|
952
|
-
-
|
|
953
|
-
-
|
|
954
|
-
- 非实现型终点:最后一个拥有最终验收工件的 Work 使用本规则完成转换。
|
|
758
|
+
- 有 Goal Plan:其唯一 Lead 在关闭最后 Gate 后拥有转换;
|
|
759
|
+
- 无 Goal Plan 的 Ticket/Direct Spec:当前 I-implement 主会话 owner 拥有转换;
|
|
760
|
+
- 非实现型终点:最终验收工件 owner 使用本规则。
|
|
955
761
|
|
|
956
|
-
Owner 原子更新 `specdev/changes/{change}/.status.json` 的 `change_status`、`completed_at`、`updated_at` 和 `current_work
|
|
762
|
+
Owner 原子更新 `specdev/changes/{change}/.status.json` 的 `change_status`、`completed_at`、`updated_at` 和 `current_work`,然后重读。全局 status 只维护 active/archived 索引。
|
|
957
763
|
|
|
958
764
|
## 远程来源与归档
|
|
959
765
|
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
## 完成标准
|
|
766
|
+
远程动作不参与本地完成判定。Triage 为 `pending-close`/`close-failed` 时先 reconcile;`closed`、`waived` 或 `not-applicable` 才允许 Archive。归档后工件只读。
|
|
963
767
|
|
|
964
|
-
|
|
965
|
-
- 当前 change 只有一个条件命中的转换 owner;
|
|
966
|
-
- 远程失败不会把 completed 改回 active;
|
|
967
|
-
- Archive 不接收尚未 reconcile 或 waive 的远程来源。
|
|
768
|
+
**完成标准**:完成声明可由本地工件、Git 与验证重建;只有一个 owner 命中;失败 candidate 不污染父分支。
|
|
968
769
|
|
|
969
770
|
</change-completion>
|
|
970
771
|
|
|
@@ -1025,77 +826,107 @@ Owner 原子更新 `specdev/changes/{change}/.status.json` 的 `change_status`
|
|
|
1025
826
|
|
|
1026
827
|
<dev-worktree>
|
|
1027
828
|
|
|
1028
|
-
#
|
|
829
|
+
# Dev Worktree
|
|
830
|
+
|
|
831
|
+
本 Skill 由 T-tickets/P-goal-plan/I-implement 和 P-prototype 复用。`purpose=ticket` 使用完整 source → candidate → parent 状态机;`purpose=prototype` 只使用调用方批准的临时生命周期。
|
|
832
|
+
|
|
833
|
+
## 输入
|
|
1029
834
|
|
|
1030
|
-
|
|
835
|
+
- `operation=create | restore | finalize | remove`;
|
|
836
|
+
- `purpose=ticket | prototype`;
|
|
837
|
+
- repository、父分支、`base_sha`、branch、portable workspace locator;
|
|
838
|
+
- workspace、implementation 和 integration owner;
|
|
839
|
+
- 允许动作、路径合同、验证合同、调用方状态记录位置。
|
|
1031
840
|
|
|
1032
|
-
|
|
1033
|
-
- 只读调查、Agent Team 本身和没有其他隔离事实的顺序执行默认共用当前工作区。
|
|
1034
|
-
- 调用方必须明确 trigger、workspace owner、implementation owner、integration owner、固定基线、父分支、工作项 ID、持久化 owner 和允许的结束动作。
|
|
1035
|
-
- Coordination 与 workspace 正交:`single-session` 可以使用本 Skill;`lead-team` 不自动使用。Current workspace 下 Worker 只读;Worker 写入必须绑定本 Skill 创建的独立 workspace。
|
|
1036
|
-
- 平台原生 worktree 优先;不可用时使用 Git worktree。
|
|
841
|
+
Ticket 还必须提供 Ready Ticket、Goal Plan(若存在)、Evidence 路径、implementation commit 与本地 candidate integration/父分支更新授权。缺失时返回 blocked,不使用 current workspace 代替。
|
|
1037
842
|
|
|
1038
|
-
##
|
|
843
|
+
## 1. 创建或恢复
|
|
1039
844
|
|
|
1040
|
-
|
|
1041
|
-
2. implementation owner 完成后返回工作项状态、Evidence/record 路径、`workspace_ref`、不可变 source checkpoint、commit 或 PR 引用和未验证项;Ticket worktree 从 `active` 更新为 `review`。
|
|
1042
|
-
3. `terminal_action=integrate` 时 integration owner 自动加载 下方 `<dev-worktree-finalize>` 标签;`retain` 保持 review。一次性原型只评估和清理,不合入生产分支。
|
|
845
|
+
`operation=create` 时加载 下方 `<dev-worktree-create>` 标签。Ticket 使用 `specdev-worktree/<ticket-id>`;同一 Ticket 只存在一个来源 worktree。`operation=restore` 时重读实际 Git worktree/branch/tip/dirty 状态并与调用方记录核对,漂移时停止。
|
|
1043
846
|
|
|
1044
|
-
|
|
847
|
+
**完成标准**:来源基线、branch、locator、owners 和实际 Git 状态一致;现有用户改动未被覆盖。
|
|
1045
848
|
|
|
1046
|
-
##
|
|
849
|
+
## 2. 来源实现门
|
|
1047
850
|
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
851
|
+
implementation owner 只在来源 worktree 修改授权项目路径,运行 Ticket 要求的单元、组件、静态、类型、lint/build 等非 E2E 检查。进入 `review` 前,worktree 必须 clean,branch tip 必须是已授权的 `source_checkpoint` commit,实际 diff 必须符合路径合同。
|
|
852
|
+
|
|
853
|
+
**完成标准**:source checkpoint 不可变且可达;来源 worktree 没有 E2E pass 声明。
|
|
854
|
+
|
|
855
|
+
## 3. 候选合并与父分支推进
|
|
856
|
+
|
|
857
|
+
`operation=finalize` 仅由 Lead/integration owner 调用,并加载 下方 `<dev-worktree-finalize>` 标签。Lead 在独立 parent-candidate checkout 组合最新父分支与 source checkpoint,运行集成检查和适用 E2E,通过后才推进父分支。
|
|
858
|
+
|
|
859
|
+
本地 candidate checkout/branch 的创建、重建和回收属于已授权 local candidate integration;来源 branch/worktree 的删除仍需要独立 cleanup 授权。push、PR、remote merge、deploy、migration 和生产动作不从本 Skill 继承。
|
|
860
|
+
|
|
861
|
+
**完成标准**:Ticket `integrated` 时父 HEAD 精确等于记录的 result SHA,并包含 source checkpoint;失败或 stale 时父分支未变化。后续 `removed` 只表示来源 branch/worktree 已清理,不撤销该集成事实。
|
|
862
|
+
|
|
863
|
+
## 4. 移除
|
|
864
|
+
|
|
865
|
+
`operation=remove` 先验证 Ticket 已 `integrated` 或 prototype 已结束、目标 worktree clean、checkpoint 可恢复且删除目标精确。只有明确 cleanup 授权时删除来源 branch/worktree;强制删除需要单独确认。删除后重读 `git worktree list` 与 refs,并只把调用方生命周期状态更新为 `removed`;`base_sha`、source checkpoint、candidate/result、验证、E2E 与 Evidence 字段必须原样保留。
|
|
866
|
+
|
|
867
|
+
**完成标准**:只删除精确授权目标;失败保留现场与恢复命令。
|
|
868
|
+
|
|
869
|
+
## 固定规则
|
|
870
|
+
|
|
871
|
+
- Agent Team 不决定 worktree;Ticket 切片本身决定来源 worktree;
|
|
872
|
+
- Ticket E2E 只在 Lead-owned parent-candidate checkout 运行;
|
|
873
|
+
- 每个 Done Ticket 必须有 source commit 与父分支 result,worktree 状态为 `integrated` 或其清理后终态 `removed`;
|
|
874
|
+
- candidate 失败保留来源 worktree 修正,父分支不动;
|
|
875
|
+
- 成功集成不自动清理来源 branch/worktree。
|
|
1054
876
|
|
|
1055
877
|
</dev-worktree>
|
|
1056
878
|
|
|
1057
879
|
<dev-worktree-create>
|
|
1058
880
|
|
|
1059
|
-
#
|
|
881
|
+
# Create Or Restore Worktree
|
|
1060
882
|
|
|
1061
|
-
##
|
|
883
|
+
## Ticket 前置条件
|
|
1062
884
|
|
|
1063
|
-
- Ticket
|
|
1064
|
-
-
|
|
1065
|
-
-
|
|
885
|
+
- Ticket Ready,项目根是有效 Git repository,父分支和 `base_sha` 可解析;
|
|
886
|
+
- implementation commit 与 local candidate integration/父分支更新已授权;
|
|
887
|
+
- workspace、implementation、integration owner 唯一;integration owner 必须为 Lead;
|
|
888
|
+
- `specdev-worktree/` 已由 Speculo init 加入项目 `.gitignore`;
|
|
889
|
+
- 目标 branch/worktree 不覆盖现有用户 workspace,路径合同无冲突。
|
|
1066
890
|
|
|
1067
|
-
|
|
891
|
+
Prototype 只要求调用方已记录本次临时 branch/worktree 授权、问题、owner、locator 和清理策略;它不写 Ticket worktree 状态。
|
|
1068
892
|
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
893
|
+
## 创建 Ticket 来源 worktree
|
|
894
|
+
|
|
895
|
+
1. 重读父分支 HEAD、工作树、现有 worktrees 与 refs;父 HEAD 与计划基线不一致时由 Lead决定更新 `base_sha` 或阻塞;
|
|
896
|
+
2. 固定 branch `speculo/<change>/<ticket-id>` 与 locator `specdev-worktree/<ticket-id>`;
|
|
897
|
+
3. 确认目标 branch/path 不存在,或其实际记录精确匹配当前 Ticket;
|
|
898
|
+
4. 从 `base_sha` 创建 Git worktree,不复用其他 Ticket/原型目录;
|
|
899
|
+
5. 在来源 worktree 读取项目 Agent 指令、依赖、构建与路径合同;
|
|
900
|
+
6. 安装实际需要的依赖,运行最小非 E2E 基线;
|
|
901
|
+
7. Lead 写入 `specdev/changes/{change}/.status.json`,状态为 `active`。
|
|
902
|
+
|
|
903
|
+
初始记录:
|
|
1077
904
|
|
|
1078
905
|
```json
|
|
1079
906
|
{
|
|
1080
907
|
"ticket_id": "T-01",
|
|
1081
|
-
"owner": "
|
|
1082
|
-
"
|
|
908
|
+
"owner": "lead",
|
|
909
|
+
"implementation_owner": "lead-or-dynamic-agent",
|
|
910
|
+
"integration_owner": "lead",
|
|
1083
911
|
"provider": "git",
|
|
1084
|
-
"base_sha": "<sha>",
|
|
912
|
+
"base_sha": "<immutable-sha>",
|
|
1085
913
|
"parent_branch": "<parent-branch>",
|
|
1086
914
|
"branch": "speculo/<change>/T-01",
|
|
1087
915
|
"workspace_ref": "specdev-worktree/T-01",
|
|
1088
|
-
"terminal_action": "integrate",
|
|
1089
916
|
"source_checkpoint": null,
|
|
1090
917
|
"integration": {
|
|
1091
918
|
"status": "pending",
|
|
1092
919
|
"parent_before_sha": null,
|
|
1093
920
|
"source_sha": null,
|
|
921
|
+
"candidate_sha": null,
|
|
922
|
+
"candidate_branch": null,
|
|
923
|
+
"candidate_workspace_ref": null,
|
|
1094
924
|
"result_sha": null,
|
|
1095
925
|
"method": null,
|
|
1096
926
|
"conflict_paths": [],
|
|
1097
927
|
"verification": "pending",
|
|
1098
|
-
"
|
|
928
|
+
"e2e": {"required": false, "status": "not-required", "evidence": null},
|
|
929
|
+
"evidence": "specdev/changes/<change>/evidence/T-01.md",
|
|
1099
930
|
"attempts": 0
|
|
1100
931
|
},
|
|
1101
932
|
"status": "active",
|
|
@@ -1103,39 +934,73 @@ Ticket worktree 状态依次为 `planned → active → review → integrating
|
|
|
1103
934
|
}
|
|
1104
935
|
```
|
|
1105
936
|
|
|
1106
|
-
|
|
937
|
+
`e2e.required` 与 Ticket/Goal Plan disposition 一致;required 时初始 status 为 `pending`。
|
|
938
|
+
|
|
939
|
+
## 恢复
|
|
1107
940
|
|
|
1108
|
-
|
|
941
|
+
恢复时核对 repository、branch、locator、`base_sha`、实际 HEAD、dirty 状态和 owner。状态记录与 Git 不一致、branch 被其他 worktree 占用或出现越界修改时停止;Lead 写 blocker,不重建覆盖。
|
|
942
|
+
|
|
943
|
+
进入 `review` 前必须由 implementation owner 创建最终 commit;Lead 重读 branch tip、diff 与 `git status`,把精确 SHA 写入 `source_checkpoint`。
|
|
944
|
+
|
|
945
|
+
**完成标准**:来源 worktree 可定位且唯一;基线、记录与 Git 一致;source 检查不含 E2E;失败时保留现场。
|
|
1109
946
|
|
|
1110
947
|
</dev-worktree-create>
|
|
1111
948
|
|
|
1112
949
|
<dev-worktree-finalize>
|
|
1113
950
|
|
|
1114
|
-
#
|
|
951
|
+
# Candidate Merge And Parent Integration
|
|
952
|
+
|
|
953
|
+
仅由 Lead/integration owner 对状态为 `review` 的 Ticket 调用。
|
|
954
|
+
|
|
955
|
+
## 1. 接收 source checkpoint
|
|
956
|
+
|
|
957
|
+
1. 核对 Ticket、Goal Plan、Evidence 目标、owner 与本地 integration 授权;
|
|
958
|
+
2. 验证来源 worktree clean,branch tip 精确等于 `source_checkpoint`,commit 从 `base_sha` 可达;
|
|
959
|
+
3. 审计实际 diff 未越过 writable/shared owner 合同;
|
|
960
|
+
4. 确认 source-worktree 必跑非 E2E 检查已执行,且没有把 E2E 自报为通过;
|
|
961
|
+
5. 重读父分支 checkout clean、HEAD 与 remote/本地约定,记录 `parent_before_sha`。
|
|
962
|
+
|
|
963
|
+
失败时保持 `review`/`blocked`,不开始候选合并。
|
|
964
|
+
|
|
965
|
+
## 2. 建立 parent-candidate checkout
|
|
1115
966
|
|
|
1116
|
-
|
|
967
|
+
1. 使用 branch `speculo/integration/<change>/<ticket-id>` 和 locator `specdev-worktree/.integration/<ticket-id>`,从最新 `parent_before_sha` 建立 Lead-owned integration worktree;
|
|
968
|
+
2. 如果父 SHA 是 source checkpoint 的祖先,在 candidate checkout 执行 `git merge --ff-only <source_checkpoint>`,`method=fast-forward`;
|
|
969
|
+
3. 否则执行 `git merge --no-ff --no-commit <source_checkpoint>`;
|
|
970
|
+
4. 冲突按 下方 `<merge-conflict-protocol>` 标签 处理。需要新产品决定时执行 `git merge --abort`,记录 blocker 并返回来源 worktree;
|
|
971
|
+
5. 对分叉结果创建一次 Lead-owned candidate merge commit,`method=merge-commit`;
|
|
972
|
+
6. 记录 candidate branch/locator、`candidate_sha`、`source_sha`、冲突路径与 attempts,worktree 状态改为 `integrating`、integration 状态改为 `candidate`。
|
|
1117
973
|
|
|
1118
|
-
|
|
974
|
+
重试前从最新父分支重建 candidate branch/worktree;旧 candidate SHA 保存在 Evidence。候选生命周期的重建/回收包含在 local candidate integration 授权中。
|
|
1119
975
|
|
|
1120
|
-
|
|
1121
|
-
2. 确认目标 checkout 正位于 `parent_branch`、index 与项目 working tree 干净,并把当前 HEAD 固定为 `parent_before_sha`。目标不干净、父分支不匹配、其他记录已在同一父分支 `integrating` 或 HEAD 在集成期间变化时停止,不覆盖用户工作。
|
|
1122
|
-
3. 将记录原子更新为 `integrating`,设置 `integration.status=running`、`parent_before_sha`、`source_sha` 并递增 `attempts`。中断恢复时先核对记录、Git `MERGE_HEAD` 和当前 HEAD,不重复开始第二次集成。
|
|
1123
|
-
4. 恢复已有 `integrating` 记录时只进入一个分支:HEAD 仍等于 `parent_before_sha` 且没有 `MERGE_HEAD` 时恢复同一次尝试;HEAD 已等于 `source_checkpoint`、没有 `MERGE_HEAD` 且 `parent_before_sha` 可达来源时,将其视为已完成但尚未落状态的 fast-forward;`MERGE_HEAD` 等于 `source_checkpoint` 时恢复未完成 merge。其他 HEAD、来源或 merge 状态漂移一律设为 `blocked`,不修改 Git 现场。
|
|
1124
|
-
5. 若 `parent_before_sha` 是 `source_checkpoint` 的祖先,先在来源 workspace 运行 Ticket 定向验证、受影响回归、项目 typecheck/lint/build 和适用最小 E2E,再从目标 checkout 执行 `git merge --ff-only <source_checkpoint>`。重读目标 HEAD、tree 和 Evidence,确认 HEAD 精确等于 `source_checkpoint` 后,记录 `method=fast-forward`、`result_sha=source_checkpoint`、空 `conflict_paths`、验证命令与结果、`verification=passed`、Evidence 和 `integration.status=passed`,再把 worktree 状态更新为 `integrated`。这是 fast-forward 的终态,不继续执行 merge-commit 步骤。
|
|
1125
|
-
6. 若双方已分叉,从干净目标 checkout 执行 `git merge --no-ff --no-commit <source_checkpoint>`。出现冲突时加载 下方 `<merge-conflict-protocol>` 标签,并将本记录作为持久授权来源;不为 `git add`、继续 merge 或集成提交重复请求确认。
|
|
1126
|
-
7. 在未提交的合并结果上运行 Ticket 定向验证、受影响回归、项目 typecheck/lint/build 和适用最小 E2E。可由既有意图机械修正的失败最多处理 3 轮;不得放宽断言、删除检查或引入未批准行为。
|
|
1127
|
-
8. 验证通过后完成一次集成专用 merge commit,重读 HEAD、parents、tree、diff 和 Evidence,确认父分支为第一 parent、`source_checkpoint` 为第二 parent,记录 `method=merge-commit`、`result_sha`、conflict paths、`verification=passed`、Evidence 与 `integration.status=passed`,再把 worktree 状态更新为 `integrated`。
|
|
1128
|
-
9. 冲突需要新产品/架构/安全/迁移决定、修改越过授权路径、验证无法通过、目标状态漂移或提交 hook 无法安全完成时,执行 `git merge --abort`(仅限本流程从干净目标开始的 merge),设置 worktree 与 integration 为 `blocked`,记录最小失败、已通过行为和恢复条件,并保留来源 worktree。
|
|
976
|
+
## 3. 在候选父状态验证
|
|
1129
977
|
|
|
1130
|
-
|
|
978
|
+
在 candidate checkout 运行:
|
|
1131
979
|
|
|
1132
|
-
|
|
980
|
+
- Ticket 受影响集成与回归;
|
|
981
|
+
- 项目要求的 typecheck/lint/build 或其他父状态检查;
|
|
982
|
+
- 仅当 Ticket/Goal Plan `e2e.required=true` 时运行对应 E2E。
|
|
1133
983
|
|
|
1134
|
-
|
|
1135
|
-
2. Git provider 从 project root 解析 `specdev-worktree/<work-item-id>`,重验无路径逃逸且与 `git worktree list --porcelain` 的记录一致,再从主工作树移除;native/external 通过对应 provider 管理入口移除。
|
|
1136
|
-
3. 确认 worktree 不再注册且工作项目录不存在后删除对应分支。Ticket 将状态更新为 `removed`;原型把 `cleanup_status` 更新为 `clean`。保留项目根 `specdev-worktree/` 统一目录及 `.gitignore` 条目。
|
|
984
|
+
每条命令记录运行环境 `parent-candidate`、退出码与摘要。E2E required 未运行或失败时 integration `verification=failed`、`status=failed`;父分支保持 `parent_before_sha`。可由既有合同机械修正的失败最多处理三轮;不得放宽断言、删除检查或发明行为。
|
|
1137
985
|
|
|
1138
|
-
|
|
986
|
+
## 4. 推进父分支
|
|
987
|
+
|
|
988
|
+
全部 required 检查通过后:
|
|
989
|
+
|
|
990
|
+
1. 重读父分支 HEAD;不等于 `parent_before_sha` 时将 candidate 标记 `stale`,不推进父分支并从步骤 2 重建;
|
|
991
|
+
2. 在父分支 checkout 执行 `git merge --ff-only <candidate_sha>`;候选 merge commit 本身已以父 SHA 为第一祖先,因此不再创建第二个 merge commit;
|
|
992
|
+
3. 重读父 HEAD、tree 与 ancestor 关系,确认 HEAD 精确等于 candidate SHA 且包含 source checkpoint;
|
|
993
|
+
4. 写入 `result_sha=candidate_sha`、`verification=passed`、E2E 最终状态和 Evidence;
|
|
994
|
+
5. integration/status 改为 `passed`/`integrated`,再由 Lead 标记 Ticket Done。
|
|
995
|
+
|
|
996
|
+
## 5. 失败、清理与恢复
|
|
997
|
+
|
|
998
|
+
- candidate 检查失败:父分支不动,Ticket 回 `in_progress` 或 `blocked`,来源 worktree 保留;
|
|
999
|
+
- 父 HEAD 漂移:旧 candidate 记 `stale`,完整重建并重跑;
|
|
1000
|
+
- 成功后可按 candidate integration 授权回收 transient integration worktree/branch;来源 branch/worktree 不自动清理。获得独立 cleanup 授权并清理后,只将生命周期状态改为 `removed`,完整保留已经通过的集成与 E2E 证据;
|
|
1001
|
+
- push、PR、remote merge、deploy、migration 和生产动作仍需各自授权。
|
|
1002
|
+
|
|
1003
|
+
**完成标准**:passed 时父 HEAD=result/candidate SHA 且包含 source commit;failed/stale 时父 HEAD 仍为开始该轮记录的父状态或更新后的外部事实,没有本轮候选污染。
|
|
1139
1004
|
|
|
1140
1005
|
</dev-worktree-finalize>
|
|
1141
1006
|
|
|
@@ -1143,161 +1008,141 @@ PR、`terminal_action=retain` 或暂缓集成时保留 worktree。成功集成
|
|
|
1143
1008
|
|
|
1144
1009
|
# Merge / Rebase Conflict Protocol
|
|
1145
1010
|
|
|
1146
|
-
只在 `git status` 证明仓库正处于 merge
|
|
1011
|
+
只在 `git status` 证明仓库正处于 merge/rebase 冲突时加载。
|
|
1147
1012
|
|
|
1148
1013
|
## 流程
|
|
1149
1014
|
|
|
1150
|
-
1. 读取 Git
|
|
1151
|
-
2.
|
|
1152
|
-
3.
|
|
1153
|
-
4.
|
|
1154
|
-
5.
|
|
1155
|
-
6.
|
|
1156
|
-
7. 重读 Git 状态、parents
|
|
1015
|
+
1. 读取 Git 状态、操作类型、冲突路径、base/ours/theirs SHA、Ticket/Evidence 与匹配的 candidate integration 记录。
|
|
1016
|
+
2. 从 commit、source、Spec、Ticket、ADR、测试和调用者追溯双方意图;信息不足时不猜产品行为。
|
|
1017
|
+
3. 对每个 hunk 写出双方意图、共同约束和唯一可推导结果;需要新行为或上层决定时停止并登记 deviation。
|
|
1018
|
+
4. 在授权路径内解决文本,运行受影响的非 E2E 检查;candidate checkout 中按 finalize 合同运行父状态检查/E2E。
|
|
1019
|
+
5. 匹配的 local candidate integration 授权包含 `git add`、candidate merge commit、必要的 `git merge --abort` 和 transient candidate checkout/branch 生命周期;不扩展到来源 branch/worktree cleanup 或远端动作。
|
|
1020
|
+
6. 需要改变 Spec/ADR、安全/迁移决定、越过 owner 或无法同时保持既有意图时,在 Lead-created candidate 中执行 `git merge --abort`,记录 blocker 并保留来源 worktree;未知普通冲突现场不擅自 abort。
|
|
1021
|
+
7. 重读 Git 状态、parents 与 diff,确认无 marker、无未声明路径、双方合同及验证仍成立。
|
|
1157
1022
|
|
|
1158
1023
|
## 完成标准
|
|
1159
1024
|
|
|
1160
|
-
- 每个 hunk
|
|
1025
|
+
- 每个 hunk 可追溯到既有意图;
|
|
1161
1026
|
- 新产品决定没有藏在冲突解决中;
|
|
1162
|
-
-
|
|
1163
|
-
- Git
|
|
1164
|
-
-
|
|
1027
|
+
- 验证记录命令、运行环境、退出码和摘要;
|
|
1028
|
+
- Git 副作用来自明确的 candidate integration 或其他逐动作授权;
|
|
1029
|
+
- 完成/暂停可以从 Git、change status 和 Evidence 恢复。
|
|
1165
1030
|
|
|
1166
1031
|
</merge-conflict-protocol>
|
|
1167
1032
|
|
|
1168
1033
|
<subagent-delivery>
|
|
1169
1034
|
|
|
1170
|
-
#
|
|
1035
|
+
# Subagent Delivery
|
|
1171
1036
|
|
|
1172
|
-
本 Skill
|
|
1037
|
+
本 Skill 被 P-goal-plan 与 I-implement 调用。它不选择是否使用 Lead 模式:Lead 是固定外层 owner;本 Skill 只保证每次动态派单可恢复、可验收且不产生第二个 SpecDev 状态写入者。
|
|
1173
1038
|
|
|
1174
1039
|
## 输入
|
|
1175
1040
|
|
|
1176
|
-
|
|
1177
|
-
- `execution_model`:`native-subagent` 或 `external-web-subagent`;
|
|
1178
|
-
- mutation role:`read-only`、`lead-write` 或 `worker-write`,以及独立确定的 workspace allocation;
|
|
1179
|
-
- Lead、Ticket、Goal Plan、Spec、适用 ADR/CONTEXT、Wave/Gate 和依赖 Evidence;
|
|
1180
|
-
- 项目写、只读和 shared 路径,验证矩阵与当前源码基线;
|
|
1181
|
-
- provider、会话或 workspace locator、源码交付方式,以及用户当前明确授权。
|
|
1182
|
-
|
|
1183
|
-
`single-session` Goal Plan 和缺失 Goal Plan 的 Ticket 直接由 “实现阶段” 执行,不调用本 Skill;只读辅助 Agent 由对应 research/review 能力管理。Lead Team 输入缺失时返回调用方补齐,不猜测 checkpoint、权限或验收结果。
|
|
1041
|
+
所有调用都必须提供 `operation=plan | dispatch | accept` 与 Lead owner/session locator。其余输入按 operation 判定,不得把后续阶段事实反向要求给 `plan`:
|
|
1184
1042
|
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1043
|
+
- `operation=plan`:提供允许的 `task_kind` 集合、implementation subagent 上限、Lead/SpecDev/父分支/E2E 所有权和通用授权边界;Goal Plan 此时可以尚未写入,不要求 Ticket、provider、checkpoint 或 workspace;
|
|
1044
|
+
- `operation=dispatch`:提供 `task_kind=implementation | review | research | test-observation`、已存在 Goal Plan(若有)、Ticket/固定审查目标、依赖 Evidence、适用合同、repository、不可变 checkpoint、项目 Agent 指令、workspace/session locator、provider、允许动作、路径边界、检查、停止条件与返回格式;
|
|
1045
|
+
- `operation=accept`:提供原 Dispatch Packet、subagent 返回、当前 repository/workspace、预期与实际 checkpoint,以及 Lead 可用于独立核对的 Git/命令事实。
|
|
1188
1046
|
|
|
1189
|
-
|
|
1047
|
+
`operation=dispatch` 且 `task_kind=implementation` 时,还必须提供独立 Ticket worktree、branch、`base_sha`、writable/shared owner、implementation commit 授权与 source-worktree 非 E2E 检查。缺失时返回 blocked,不推断权限或创建 current-workspace 写入者。
|
|
1190
1048
|
|
|
1191
|
-
|
|
1049
|
+
## 1. 固定 Lead 与任务类型
|
|
1192
1050
|
|
|
1193
|
-
|
|
1051
|
+
Lead 保留需求解释、DAG/Wave/Gate、shared owner、权限、SpecDev 工件、Evidence、candidate-merge、父分支和最终回复。subagent 不写 Ticket、Map、Goal Plan、Evidence、change status 或父分支。
|
|
1194
1052
|
|
|
1195
|
-
|
|
1053
|
+
- implementation 可以写唯一 Ticket worktree,并在授权时创建实现 commit;
|
|
1054
|
+
- review/research/test-observation 只读,返回 findings、来源或命令观察;
|
|
1055
|
+
- E2E Gate 永远由 Lead 拥有,不能派给 implementation 或只读 agent;Ticket E2E 在 parent-candidate 状态执行,Direct Spec E2E 在 Lead-owned current workspace 执行。
|
|
1196
1056
|
|
|
1197
|
-
|
|
1057
|
+
**完成标准**:Lead、task kind、写入边界和 E2E owner 唯一。
|
|
1198
1058
|
|
|
1199
|
-
|
|
1059
|
+
## 2. 锁定基线、provider 与授权
|
|
1200
1060
|
|
|
1201
|
-
|
|
1061
|
+
记录 repository、branch、`base_sha`/固定审查 SHA、workspace/session locator 和 provider。GitHub 是源码事实来源时加载 下方 `<subagent-delivery-github-checkpoints>` 标签;需要向外部 provider 发送附件或私有上下文时,取得发送授权后加载 下方 `<subagent-delivery-source-package>` 标签。
|
|
1202
1062
|
|
|
1203
|
-
|
|
1063
|
+
授权逐动作记录:worktree local changes、implementation commit、外部内容发送、push、PR、remote merge、deploy、migration 和 production actions。Goal Plan 的本地 commit/integration 授权不扩展到远端、清理或生产动作。
|
|
1204
1064
|
|
|
1205
|
-
|
|
1206
|
-
- `external-web-subagent`:加载 下方 `<subagent-delivery-external-web>` 标签,完成能力探测、会话恢复、候选交付与修正。
|
|
1065
|
+
**完成标准**:每个可变输入绑定 checkpoint;provider 只接收已授权范围;未授权动作不可执行。
|
|
1207
1066
|
|
|
1208
|
-
|
|
1067
|
+
## 3. 生成动态 Dispatch Packet
|
|
1209
1068
|
|
|
1210
|
-
|
|
1069
|
+
`operation=plan` 时只返回通用 Lead delivery contract,不读取尚未生成的 Goal Plan,也不为 Ticket 预分配 agent/provider。
|
|
1211
1070
|
|
|
1212
|
-
`operation=
|
|
1071
|
+
`operation=dispatch` 时为单次任务生成 Packet:目标、IN/OUT、已锁定决定、固定输入、workspace、writable/read-only/shared paths、允许动作、必跑检查、禁止在 source worktree 运行 E2E、停止条件和返回字段。
|
|
1213
1072
|
|
|
1214
|
-
|
|
1073
|
+
- 原生 Agent:加载 下方 `<subagent-delivery-native>` 标签;
|
|
1074
|
+
- 外部网页 Agent:加载 下方 `<subagent-delivery-external-web>` 标签。
|
|
1215
1075
|
|
|
1216
|
-
|
|
1076
|
+
implementation Packet 必须适合一个上下文独立完成;多个 implementation subagent 由 Lead 控制在 Goal Plan/config 上限内且最多三个。只读 agent 不设置 SpecDev 数字上限,但不得争用可变环境。
|
|
1217
1077
|
|
|
1218
|
-
|
|
1078
|
+
**完成标准**:Packet 可独立投递;目标、checkpoint、路径、权限、检查和返回均可判定。
|
|
1219
1079
|
|
|
1220
|
-
|
|
1080
|
+
## 4. 接收与验收候选
|
|
1221
1081
|
|
|
1222
|
-
|
|
1082
|
+
`operation=accept` 时,Lead 核对 Packet、当前父/来源基线、实际路径、dirty 状态、commit 可达性、命令输出和未验证项。外部声明、截图、provider 自报测试和推断保持 `unverified`,直到 Lead 在本地复核。
|
|
1223
1083
|
|
|
1224
|
-
|
|
1084
|
+
implementation 返回必须包含 Ticket ID、workspace locator、最终 commit、dirty 状态、修改路径、非 E2E 检查、失败/未运行项和恢复条件。review/research/test-observation 返回固定输入、findings、来源、命令与未验证声明。Lead 把验收结果写入调用方拥有的 Evidence/状态。
|
|
1225
1085
|
|
|
1226
|
-
|
|
1086
|
+
**完成标准**:每个 pass 有 Lead 可复查事实;candidate 未被误写为 Done 或父分支结果。
|
|
1227
1087
|
|
|
1228
|
-
|
|
1088
|
+
## 5. 修正与恢复
|
|
1229
1089
|
|
|
1230
|
-
|
|
1090
|
+
修正继续使用同一 Ticket 与 worktree,基于最后 source checkpoint 生成新 commit。基线或父分支漂移时由 Lead 暂停派单、重算影响并更新 Packet;契约冲突返回拥有该决定的工件。Lead 可以按当次风险在 Dispatch Packet 中定义停止条件,但 SpecDev 不推断全局修正次数;继续修正已无合理收益或需要上游决定时,返回 blocked、最后可信 checkpoint、失败命令和恢复条件。
|
|
1231
1091
|
|
|
1232
|
-
|
|
1092
|
+
**完成标准**:恢复不重新决定已锁定事项;每次候选都有唯一 checkpoint 和明确 owner。
|
|
1233
1093
|
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
每个 Ticket 使用唯一 Agent 标识,并接收一个独立 Dispatch Packet:
|
|
1094
|
+
</subagent-delivery>
|
|
1237
1095
|
|
|
1238
|
-
|
|
1239
|
-
DISPATCH ticket=<id> wave=<wave> gate=<gate>
|
|
1240
|
-
baseline=<sha> branch=<branch> workspace=<workspace-ref>
|
|
1241
|
-
ticket_path=<full-ticket-path> evidence_path=<full-evidence-path>
|
|
1242
|
-
```
|
|
1096
|
+
<subagent-delivery-native>
|
|
1243
1097
|
|
|
1244
|
-
|
|
1098
|
+
# Native Subagent
|
|
1245
1099
|
|
|
1246
|
-
|
|
1100
|
+
Lead 可以直接创建和管理隔离 Agent 时加载。
|
|
1247
1101
|
|
|
1248
|
-
##
|
|
1102
|
+
## 派单
|
|
1249
1103
|
|
|
1250
|
-
|
|
1104
|
+
Lead 为每个 Agent 发送一个完整 Dispatch Packet。implementation Agent 只进入指定 Ticket worktree;review/research/test-observation Agent 只读取固定输入。并行前核对 Ticket 依赖与 writable/shared path,不以“不同 Agent”代替路径隔离。
|
|
1251
1105
|
|
|
1252
|
-
|
|
1253
|
-
- 规范轴:Spec、ADR、Ticket、Goal Plan、路径合同和验收映射;
|
|
1254
|
-
- Lead 复跑的定向验证与适用回归;
|
|
1255
|
-
- 对可能静默失效的门禁执行一次受控反向验证,并恢复绿色基线。
|
|
1106
|
+
Packet 对 implementation 明确:
|
|
1256
1107
|
|
|
1257
|
-
|
|
1108
|
+
- Ticket、Goal Plan、依赖 Evidence 与 `base_sha`;
|
|
1109
|
+
- branch、portable `workspace_ref`、writable/read-only/shared paths;
|
|
1110
|
+
- 允许 worktree local changes 与 implementation commit;
|
|
1111
|
+
- 单元、组件、静态、类型、lint/build 等适用非 E2E 检查;
|
|
1112
|
+
- E2E 由 Lead 在 parent-candidate 状态执行;
|
|
1113
|
+
- 越界、合同冲突、基线漂移和无法提交时立即停止。
|
|
1258
1114
|
|
|
1259
1115
|
## 返回
|
|
1260
1116
|
|
|
1261
|
-
Agent 返回 Ticket
|
|
1117
|
+
implementation Agent 返回 Ticket ID、workspace locator、最终 commit、`git status`、修改路径、命令/结果、未运行项、冲突和恢复条件,不写 SpecDev Evidence。只读 Agent 返回固定 checkpoint、findings、来源、命令观察和未验证项。
|
|
1262
1118
|
|
|
1263
|
-
|
|
1119
|
+
Lead 重读 worktree、验证 commit 可达且 tip 一致、检查实际 diff 与路径合同,再决定接受、修正或 blocked。接受的 implementation 候选进入 dev-worktree candidate-merge;只读结论由 Lead 写入对应权威工件。
|
|
1120
|
+
|
|
1121
|
+
**完成标准**:原生 Agent 的写入与返回均绑定一个 Packet;Lead 可以独立复现其事实声明。
|
|
1264
1122
|
|
|
1265
1123
|
</subagent-delivery-native>
|
|
1266
1124
|
|
|
1267
1125
|
<subagent-delivery-external-web>
|
|
1268
1126
|
|
|
1269
|
-
#
|
|
1270
|
-
|
|
1271
|
-
用户或已批准 Goal Plan 明确选择网页模型时加载;原生能力不足本身不授权向外部 provider 发送上下文。外部输出是候选交付,Lead 的本地核对决定验收状态。
|
|
1272
|
-
|
|
1273
|
-
## 能力探测与会话
|
|
1274
|
-
|
|
1275
|
-
首次使用或界面变化时实测并记录:provider、稳定 session locator、仓库访问、附件上传与返回、长任务状态和认证交接。Provider 名称只是标识;只有能力差异改变交付路径时才产生分支。
|
|
1276
|
-
|
|
1277
|
-
登录、账号选择、密码、验证码、Passkey、两步验证、恢复码和 CAPTCHA 由用户在界面内完成。认证秘密不进入派单、源码包、Goal Plan 或 Evidence;发送仓库链接、源码或附件前还必须确认 provider 和内容范围已获授权。
|
|
1127
|
+
# External Web Subagent
|
|
1278
1128
|
|
|
1279
|
-
|
|
1129
|
+
用户已授权目标 provider 与发送内容范围,且外部网页模型能为当前任务提供实际价值时加载。外部会话永远返回候选,不拥有本地 worktree、commit、SpecDev 状态或 E2E Gate。
|
|
1280
1130
|
|
|
1281
|
-
##
|
|
1131
|
+
## 能力与数据门
|
|
1282
1132
|
|
|
1283
|
-
|
|
1133
|
+
先确认 provider 能接收的文件、大小、会话恢复、输出格式和数据保留边界。需要源码包时加载 source-package reference,排除凭据、真实用户数据、运行时状态和无关代码;记录 locator、hash 与 checkpoint。能力或授权不足时改用原生/Lead 执行,不降低合同。
|
|
1284
1134
|
|
|
1285
|
-
|
|
1286
|
-
2. 用户结果、里程碑位置、相关模块、公共契约和领域不变量;
|
|
1287
|
-
3. allowed/read-only/shared 路径、保留行为和依赖策略;
|
|
1288
|
-
4. 需要返回的方案、修改清单、patch/源码、测试、实际命令和风险;
|
|
1289
|
-
5. mutation role、workspace allocation、当前授权矩阵与逐项验收标准;
|
|
1290
|
-
6. 未实际运行的检查必须标记 `unverified`。
|
|
1135
|
+
## 投递与返回
|
|
1291
1136
|
|
|
1292
|
-
|
|
1137
|
+
Packet 固定目标、范围、合同、checkpoint、路径边界、非 E2E 验证要求和停止条件。外部 provider 返回 patch/文件、修改清单、推理摘要、模拟或自报测试、未验证项和会话 locator。
|
|
1293
1138
|
|
|
1294
|
-
|
|
1139
|
+
Lead 在 Ticket worktree 中核对附件 hash、应用候选、检查 diff、依赖与锁文件、运行本地非 E2E 检查并创建 implementation commit。外部自报结果、截图或模拟保持 `unverified`;适用 E2E 仍只在 parent-candidate 状态运行。
|
|
1295
1140
|
|
|
1296
|
-
|
|
1141
|
+
## 修正与恢复
|
|
1297
1142
|
|
|
1298
|
-
|
|
1143
|
+
修正轮绑定新的源码 checkpoint 或 candidate hash,不覆盖旧附件。会话无法恢复、输出越界或 contract 冲突时停止并保留最后可信包、失败证据和恢复条件。
|
|
1299
1144
|
|
|
1300
|
-
|
|
1145
|
+
**完成标准**:发送范围有授权且可审计;本地 commit 与验收完全由 Lead 拥有;外部声明不被当作通过证据。
|
|
1301
1146
|
|
|
1302
1147
|
</subagent-delivery-external-web>
|
|
1303
1148
|
|
|
@@ -1355,16 +1200,14 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1355
1200
|
|
|
1356
1201
|
```json
|
|
1357
1202
|
{
|
|
1358
|
-
"schema_version":
|
|
1203
|
+
"schema_version": 4,
|
|
1359
1204
|
"interaction_language": "zh-CN",
|
|
1360
1205
|
"artifact_language": "zh-CN",
|
|
1361
1206
|
"git": {
|
|
1362
|
-
"
|
|
1363
|
-
"default_branch": null,
|
|
1364
|
-
"worktree_for_parallel": true
|
|
1207
|
+
"default_branch": null
|
|
1365
1208
|
},
|
|
1366
1209
|
"execution": {
|
|
1367
|
-
"
|
|
1210
|
+
"max_implementation_agents": 3,
|
|
1368
1211
|
"deep_ticket_human_approval": true,
|
|
1369
1212
|
"shared_path_owner": "explicit"
|
|
1370
1213
|
},
|
|
@@ -1389,33 +1232,31 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1389
1232
|
```json
|
|
1390
1233
|
{
|
|
1391
1234
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1392
|
-
"$id": "urn:speculo:specdev:config:
|
|
1235
|
+
"$id": "urn:speculo:specdev:config:v4",
|
|
1393
1236
|
"title": "SpecDev Configuration",
|
|
1394
1237
|
"type": "object",
|
|
1395
1238
|
"required": ["schema_version", "interaction_language", "artifact_language", "git", "execution", "verification", "planning"],
|
|
1396
1239
|
"properties": {
|
|
1397
|
-
"schema_version": {"const":
|
|
1240
|
+
"schema_version": {"const": 4},
|
|
1398
1241
|
"interaction_language": {"type": "string", "minLength": 1},
|
|
1399
1242
|
"artifact_language": {"type": "string", "minLength": 1},
|
|
1400
1243
|
"git": {
|
|
1401
1244
|
"type": "object",
|
|
1402
|
-
"required": ["
|
|
1245
|
+
"required": ["default_branch"],
|
|
1403
1246
|
"properties": {
|
|
1404
|
-
"
|
|
1405
|
-
"default_branch": {"type": ["string", "null"]},
|
|
1406
|
-
"worktree_for_parallel": {"type": "boolean"}
|
|
1247
|
+
"default_branch": {"type": ["string", "null"]}
|
|
1407
1248
|
},
|
|
1408
|
-
"additionalProperties":
|
|
1249
|
+
"additionalProperties": false
|
|
1409
1250
|
},
|
|
1410
1251
|
"execution": {
|
|
1411
1252
|
"type": "object",
|
|
1412
|
-
"required": ["
|
|
1253
|
+
"required": ["max_implementation_agents", "deep_ticket_human_approval", "shared_path_owner"],
|
|
1413
1254
|
"properties": {
|
|
1414
|
-
"
|
|
1255
|
+
"max_implementation_agents": {"type": "integer", "minimum": 1, "maximum": 3},
|
|
1415
1256
|
"deep_ticket_human_approval": {"type": "boolean"},
|
|
1416
1257
|
"shared_path_owner": {"type": "string", "minLength": 1}
|
|
1417
1258
|
},
|
|
1418
|
-
"additionalProperties":
|
|
1259
|
+
"additionalProperties": false
|
|
1419
1260
|
},
|
|
1420
1261
|
"verification": {
|
|
1421
1262
|
"type": "object",
|
|
@@ -1439,7 +1280,7 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1439
1280
|
"additionalProperties": true
|
|
1440
1281
|
}
|
|
1441
1282
|
},
|
|
1442
|
-
"additionalProperties":
|
|
1283
|
+
"additionalProperties": false
|
|
1443
1284
|
}
|
|
1444
1285
|
```
|
|
1445
1286
|
|
|
@@ -1449,7 +1290,7 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1449
1290
|
|
|
1450
1291
|
```json
|
|
1451
1292
|
{
|
|
1452
|
-
"schema_version":
|
|
1293
|
+
"schema_version": 5,
|
|
1453
1294
|
"workflow": "specdev",
|
|
1454
1295
|
"active": [],
|
|
1455
1296
|
"archived": []
|
|
@@ -1463,83 +1304,27 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1463
1304
|
```json
|
|
1464
1305
|
{
|
|
1465
1306
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1466
|
-
"$id": "urn:speculo:specdev:status:
|
|
1307
|
+
"$id": "urn:speculo:specdev:status:v5",
|
|
1467
1308
|
"title": "SpecDev Global Status",
|
|
1468
1309
|
"type": "object",
|
|
1469
|
-
"required": [
|
|
1470
|
-
"schema_version",
|
|
1471
|
-
"workflow",
|
|
1472
|
-
"active",
|
|
1473
|
-
"archived"
|
|
1474
|
-
],
|
|
1310
|
+
"required": ["schema_version", "workflow", "active", "archived"],
|
|
1475
1311
|
"properties": {
|
|
1476
|
-
"schema_version": {
|
|
1477
|
-
|
|
1478
|
-
},
|
|
1479
|
-
"workflow": {
|
|
1480
|
-
"const": "specdev"
|
|
1481
|
-
},
|
|
1312
|
+
"schema_version": {"const": 5},
|
|
1313
|
+
"workflow": {"const": "specdev"},
|
|
1482
1314
|
"active": {
|
|
1483
1315
|
"type": "array",
|
|
1484
1316
|
"items": {
|
|
1485
1317
|
"type": "object",
|
|
1486
|
-
"required": [
|
|
1487
|
-
"change",
|
|
1488
|
-
"current_work",
|
|
1489
|
-
"works_run"
|
|
1490
|
-
],
|
|
1318
|
+
"required": ["change"],
|
|
1491
1319
|
"properties": {
|
|
1492
1320
|
"change": {
|
|
1493
1321
|
"type": "string",
|
|
1494
1322
|
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"
|
|
1495
|
-
},
|
|
1496
|
-
"current_work": {
|
|
1497
|
-
"type": [
|
|
1498
|
-
"string",
|
|
1499
|
-
"null"
|
|
1500
|
-
],
|
|
1501
|
-
"pattern": "^specdev/"
|
|
1502
|
-
},
|
|
1503
|
-
"works_run": {
|
|
1504
|
-
"type": "array",
|
|
1505
|
-
"items": {
|
|
1506
|
-
"type": "string",
|
|
1507
|
-
"pattern": "^specdev/"
|
|
1508
|
-
},
|
|
1509
|
-
"uniqueItems": true
|
|
1510
|
-
},
|
|
1511
|
-
"claimed_investigations": {
|
|
1512
|
-
"type": "array",
|
|
1513
|
-
"items": {
|
|
1514
|
-
"type": "object",
|
|
1515
|
-
"required": [
|
|
1516
|
-
"id",
|
|
1517
|
-
"owner",
|
|
1518
|
-
"claimed_at"
|
|
1519
|
-
],
|
|
1520
|
-
"properties": {
|
|
1521
|
-
"id": {
|
|
1522
|
-
"type": "string"
|
|
1523
|
-
},
|
|
1524
|
-
"owner": {
|
|
1525
|
-
"type": "string"
|
|
1526
|
-
},
|
|
1527
|
-
"session": {
|
|
1528
|
-
"type": [
|
|
1529
|
-
"string",
|
|
1530
|
-
"null"
|
|
1531
|
-
]
|
|
1532
|
-
},
|
|
1533
|
-
"claimed_at": {
|
|
1534
|
-
"type": "string"
|
|
1535
|
-
}
|
|
1536
|
-
},
|
|
1537
|
-
"additionalProperties": false
|
|
1538
|
-
}
|
|
1539
1323
|
}
|
|
1540
1324
|
},
|
|
1541
1325
|
"additionalProperties": false
|
|
1542
|
-
}
|
|
1326
|
+
},
|
|
1327
|
+
"uniqueItems": true
|
|
1543
1328
|
},
|
|
1544
1329
|
"archived": {
|
|
1545
1330
|
"type": "array",
|
|
@@ -1560,11 +1345,24 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1560
1345
|
|
|
1561
1346
|
```json
|
|
1562
1347
|
{
|
|
1563
|
-
"schema_version":
|
|
1348
|
+
"schema_version": 5,
|
|
1564
1349
|
"artifact": "change-status",
|
|
1565
1350
|
"change": "<YYYY-MM-DD-topic>",
|
|
1566
1351
|
"change_status": "active",
|
|
1567
1352
|
"current_work": null,
|
|
1353
|
+
"works_run": [],
|
|
1354
|
+
"claimed_investigations": [],
|
|
1355
|
+
"execution_authorization": {
|
|
1356
|
+
"implementation_commit": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Ticket source commits"},
|
|
1357
|
+
"local_candidate_integration": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Lead-owned local parent candidate integration and parent update"},
|
|
1358
|
+
"source_cleanup": {"status": "not-authorized", "source": null, "granted_at": null, "scope": "Source worktree and branch cleanup"}
|
|
1359
|
+
},
|
|
1360
|
+
"leadership": {
|
|
1361
|
+
"current": "<owner-or-session-locator>",
|
|
1362
|
+
"epoch": 1,
|
|
1363
|
+
"assigned_at": "<ISO-8601>",
|
|
1364
|
+
"history": []
|
|
1365
|
+
},
|
|
1568
1366
|
"created_at": "<ISO-8601>",
|
|
1569
1367
|
"updated_at": "<ISO-8601>",
|
|
1570
1368
|
"completed_at": null,
|
|
@@ -1583,394 +1381,157 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1583
1381
|
```json
|
|
1584
1382
|
{
|
|
1585
1383
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1586
|
-
"$id": "urn:speculo:specdev:change-status:
|
|
1384
|
+
"$id": "urn:speculo:specdev:change-status:v5",
|
|
1587
1385
|
"title": "SpecDev Change Status",
|
|
1588
1386
|
"type": "object",
|
|
1589
1387
|
"required": [
|
|
1590
|
-
"schema_version",
|
|
1591
|
-
"
|
|
1592
|
-
"
|
|
1593
|
-
"change_status",
|
|
1594
|
-
"current_work",
|
|
1595
|
-
"created_at",
|
|
1596
|
-
"updated_at",
|
|
1597
|
-
"completed_at",
|
|
1598
|
-
"archived",
|
|
1599
|
-
"archive_path",
|
|
1600
|
-
"blockers",
|
|
1601
|
-
"deviations"
|
|
1388
|
+
"schema_version", "artifact", "change", "change_status", "current_work", "works_run",
|
|
1389
|
+
"claimed_investigations", "execution_authorization", "leadership", "created_at", "updated_at",
|
|
1390
|
+
"completed_at", "archived", "archive_path", "blockers", "deviations", "worktrees"
|
|
1602
1391
|
],
|
|
1603
1392
|
"properties": {
|
|
1604
|
-
"schema_version": {
|
|
1605
|
-
|
|
1606
|
-
},
|
|
1607
|
-
"
|
|
1608
|
-
|
|
1609
|
-
},
|
|
1610
|
-
"
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
},
|
|
1614
|
-
"
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
"type": "string",
|
|
1634
|
-
"minLength": 1
|
|
1393
|
+
"schema_version": {"const": 5},
|
|
1394
|
+
"artifact": {"const": "change-status"},
|
|
1395
|
+
"change": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*$"},
|
|
1396
|
+
"change_status": {"enum": ["active", "blocked", "completed", "archived"]},
|
|
1397
|
+
"current_work": {"type": ["string", "null"], "pattern": "^specdev/"},
|
|
1398
|
+
"works_run": {"type": "array", "items": {"type": "string", "pattern": "^specdev/"}, "uniqueItems": true},
|
|
1399
|
+
"claimed_investigations": {"type": "array", "items": {"$ref": "#/$defs/claim"}},
|
|
1400
|
+
"execution_authorization": {"$ref": "#/$defs/authorization"},
|
|
1401
|
+
"leadership": {"$ref": "#/$defs/leadership"},
|
|
1402
|
+
"created_at": {"type": "string", "minLength": 1},
|
|
1403
|
+
"updated_at": {"type": "string", "minLength": 1},
|
|
1404
|
+
"completed_at": {"type": ["string", "null"]},
|
|
1405
|
+
"archived": {"type": "boolean"},
|
|
1406
|
+
"archive_path": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}]},
|
|
1407
|
+
"blockers": {"type": "array", "items": {"type": "string"}},
|
|
1408
|
+
"deviations": {"type": "array", "items": {"type": "string"}},
|
|
1409
|
+
"worktrees": {"type": "array", "items": {"$ref": "#/$defs/worktree"}}
|
|
1410
|
+
},
|
|
1411
|
+
"$defs": {
|
|
1412
|
+
"claim": {
|
|
1413
|
+
"type": "object",
|
|
1414
|
+
"required": ["id", "owner", "session", "claimed_at"],
|
|
1415
|
+
"properties": {
|
|
1416
|
+
"id": {"type": "string", "minLength": 1},
|
|
1417
|
+
"owner": {"type": "string", "minLength": 1},
|
|
1418
|
+
"session": {"type": ["string", "null"]},
|
|
1419
|
+
"claimed_at": {"type": "string", "minLength": 1}
|
|
1420
|
+
},
|
|
1421
|
+
"additionalProperties": false
|
|
1635
1422
|
},
|
|
1636
|
-
"
|
|
1637
|
-
"type":
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1423
|
+
"authorization-entry": {
|
|
1424
|
+
"type": "object",
|
|
1425
|
+
"required": ["status", "source", "granted_at", "scope"],
|
|
1426
|
+
"properties": {
|
|
1427
|
+
"status": {"enum": ["authorized", "not-authorized", "revoked"]},
|
|
1428
|
+
"source": {"type": ["string", "null"]},
|
|
1429
|
+
"granted_at": {"type": ["string", "null"]},
|
|
1430
|
+
"scope": {"type": "string", "minLength": 1}
|
|
1431
|
+
},
|
|
1432
|
+
"allOf": [{
|
|
1433
|
+
"if": {"properties": {"status": {"const": "authorized"}}, "required": ["status"]},
|
|
1434
|
+
"then": {"properties": {"source": {"type": "string", "minLength": 1}, "granted_at": {"type": "string", "minLength": 1}}}
|
|
1435
|
+
}],
|
|
1436
|
+
"additionalProperties": false
|
|
1641
1437
|
},
|
|
1642
|
-
"
|
|
1643
|
-
"type": "
|
|
1438
|
+
"authorization": {
|
|
1439
|
+
"type": "object",
|
|
1440
|
+
"required": ["implementation_commit", "local_candidate_integration", "source_cleanup"],
|
|
1441
|
+
"properties": {
|
|
1442
|
+
"implementation_commit": {"$ref": "#/$defs/authorization-entry"},
|
|
1443
|
+
"local_candidate_integration": {"$ref": "#/$defs/authorization-entry"},
|
|
1444
|
+
"source_cleanup": {"$ref": "#/$defs/authorization-entry"}
|
|
1445
|
+
},
|
|
1446
|
+
"additionalProperties": false
|
|
1644
1447
|
},
|
|
1645
|
-
"
|
|
1646
|
-
"
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
},
|
|
1650
|
-
{
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1448
|
+
"leadership-history": {
|
|
1449
|
+
"type": "object",
|
|
1450
|
+
"required": ["owner", "epoch", "assigned_at", "ended_at"],
|
|
1451
|
+
"properties": {
|
|
1452
|
+
"owner": {"type": "string", "minLength": 1},
|
|
1453
|
+
"epoch": {"type": "integer", "minimum": 1},
|
|
1454
|
+
"assigned_at": {"type": "string", "minLength": 1},
|
|
1455
|
+
"ended_at": {"type": "string", "minLength": 1}
|
|
1456
|
+
},
|
|
1457
|
+
"additionalProperties": false
|
|
1655
1458
|
},
|
|
1656
|
-
"
|
|
1657
|
-
"type": "
|
|
1658
|
-
"
|
|
1659
|
-
|
|
1660
|
-
|
|
1459
|
+
"leadership": {
|
|
1460
|
+
"type": "object",
|
|
1461
|
+
"required": ["current", "epoch", "assigned_at", "history"],
|
|
1462
|
+
"properties": {
|
|
1463
|
+
"current": {"type": "string", "minLength": 1},
|
|
1464
|
+
"epoch": {"type": "integer", "minimum": 1},
|
|
1465
|
+
"assigned_at": {"type": "string", "minLength": 1},
|
|
1466
|
+
"history": {"type": "array", "items": {"$ref": "#/$defs/leadership-history"}}
|
|
1467
|
+
},
|
|
1468
|
+
"additionalProperties": false
|
|
1661
1469
|
},
|
|
1662
|
-
"
|
|
1663
|
-
"type": "
|
|
1664
|
-
"
|
|
1665
|
-
|
|
1666
|
-
|
|
1470
|
+
"full-suite": {
|
|
1471
|
+
"type": "object",
|
|
1472
|
+
"required": ["required", "status", "reason", "evidence"],
|
|
1473
|
+
"properties": {
|
|
1474
|
+
"required": {"type": "boolean"},
|
|
1475
|
+
"status": {"enum": ["not-required", "pending", "passed", "failed"]},
|
|
1476
|
+
"reason": {"type": ["string", "null"]},
|
|
1477
|
+
"evidence": {"type": ["string", "null"]}
|
|
1478
|
+
},
|
|
1479
|
+
"allOf": [{
|
|
1480
|
+
"if": {"properties": {"required": {"const": false}}, "required": ["required"]},
|
|
1481
|
+
"then": {"properties": {"status": {"const": "not-required"}, "reason": {"type": "string", "minLength": 1}}}
|
|
1482
|
+
}],
|
|
1483
|
+
"additionalProperties": false
|
|
1667
1484
|
},
|
|
1668
|
-
"
|
|
1669
|
-
"type": "
|
|
1670
|
-
"
|
|
1671
|
-
|
|
1672
|
-
"
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
],
|
|
1682
|
-
"
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
"pattern": "^T-[0-9]{2,}$"
|
|
1686
|
-
},
|
|
1687
|
-
"owner": {
|
|
1688
|
-
"type": "string",
|
|
1689
|
-
"minLength": 1
|
|
1690
|
-
},
|
|
1691
|
-
"integration_owner": {
|
|
1692
|
-
"type": "string",
|
|
1693
|
-
"minLength": 1
|
|
1694
|
-
},
|
|
1695
|
-
"provider": {
|
|
1696
|
-
"enum": [
|
|
1697
|
-
"native",
|
|
1698
|
-
"git",
|
|
1699
|
-
"external"
|
|
1700
|
-
]
|
|
1701
|
-
},
|
|
1702
|
-
"base_sha": {
|
|
1703
|
-
"type": "string",
|
|
1704
|
-
"minLength": 1
|
|
1705
|
-
},
|
|
1706
|
-
"parent_branch": {
|
|
1707
|
-
"type": "string",
|
|
1708
|
-
"minLength": 1
|
|
1709
|
-
},
|
|
1710
|
-
"branch": {
|
|
1711
|
-
"type": "string",
|
|
1712
|
-
"minLength": 1
|
|
1713
|
-
},
|
|
1714
|
-
"workspace_ref": {
|
|
1715
|
-
"type": "string",
|
|
1716
|
-
"minLength": 1,
|
|
1717
|
-
"pattern": "^(?!/)(?![A-Za-z]:[\\\\/]).+"
|
|
1718
|
-
},
|
|
1719
|
-
"terminal_action": {
|
|
1720
|
-
"enum": [
|
|
1721
|
-
"integrate",
|
|
1722
|
-
"retain"
|
|
1723
|
-
]
|
|
1724
|
-
},
|
|
1725
|
-
"source_checkpoint": {
|
|
1726
|
-
"type": [
|
|
1727
|
-
"string",
|
|
1728
|
-
"null"
|
|
1729
|
-
]
|
|
1730
|
-
},
|
|
1731
|
-
"integration": {
|
|
1732
|
-
"type": "object",
|
|
1733
|
-
"required": [
|
|
1734
|
-
"status",
|
|
1735
|
-
"parent_before_sha",
|
|
1736
|
-
"source_sha",
|
|
1737
|
-
"result_sha",
|
|
1738
|
-
"method",
|
|
1739
|
-
"conflict_paths",
|
|
1740
|
-
"verification",
|
|
1741
|
-
"evidence",
|
|
1742
|
-
"attempts"
|
|
1743
|
-
],
|
|
1744
|
-
"properties": {
|
|
1745
|
-
"status": {
|
|
1746
|
-
"enum": [
|
|
1747
|
-
"pending",
|
|
1748
|
-
"running",
|
|
1749
|
-
"passed",
|
|
1750
|
-
"blocked"
|
|
1751
|
-
]
|
|
1752
|
-
},
|
|
1753
|
-
"parent_before_sha": {
|
|
1754
|
-
"type": ["string", "null"]
|
|
1755
|
-
},
|
|
1756
|
-
"source_sha": {
|
|
1757
|
-
"type": ["string", "null"]
|
|
1758
|
-
},
|
|
1759
|
-
"result_sha": {
|
|
1760
|
-
"type": ["string", "null"]
|
|
1761
|
-
},
|
|
1762
|
-
"method": {
|
|
1763
|
-
"enum": [null, "fast-forward", "merge-commit"]
|
|
1764
|
-
},
|
|
1765
|
-
"conflict_paths": {
|
|
1766
|
-
"type": "array",
|
|
1767
|
-
"items": {"type": "string"}
|
|
1768
|
-
},
|
|
1769
|
-
"verification": {
|
|
1770
|
-
"enum": ["pending", "passed", "failed"]
|
|
1771
|
-
},
|
|
1772
|
-
"evidence": {
|
|
1773
|
-
"type": "string",
|
|
1774
|
-
"pattern": "^\\{roots\\.state\\}/specdev/changes/[^<]+/evidence/T-[0-9]{2,}\\.md$"
|
|
1775
|
-
},
|
|
1776
|
-
"attempts": {
|
|
1777
|
-
"type": "integer",
|
|
1778
|
-
"minimum": 0
|
|
1779
|
-
}
|
|
1780
|
-
},
|
|
1781
|
-
"additionalProperties": true
|
|
1782
|
-
},
|
|
1783
|
-
"status": {
|
|
1784
|
-
"enum": [
|
|
1785
|
-
"planned",
|
|
1786
|
-
"active",
|
|
1787
|
-
"review",
|
|
1788
|
-
"integrating",
|
|
1789
|
-
"integrated",
|
|
1790
|
-
"removed",
|
|
1791
|
-
"blocked"
|
|
1792
|
-
]
|
|
1793
|
-
},
|
|
1794
|
-
"updated_at": {
|
|
1795
|
-
"type": "string",
|
|
1796
|
-
"minLength": 1
|
|
1797
|
-
}
|
|
1798
|
-
},
|
|
1799
|
-
"dependentRequired": {
|
|
1800
|
-
"terminal_action": [
|
|
1801
|
-
"integration_owner",
|
|
1802
|
-
"parent_branch",
|
|
1803
|
-
"source_checkpoint",
|
|
1804
|
-
"integration"
|
|
1805
|
-
]
|
|
1806
|
-
},
|
|
1807
|
-
"allOf": [
|
|
1808
|
-
{
|
|
1809
|
-
"if": {
|
|
1810
|
-
"properties": {
|
|
1811
|
-
"status": {"const": "integrating"}
|
|
1812
|
-
},
|
|
1813
|
-
"required": ["status"]
|
|
1814
|
-
},
|
|
1815
|
-
"then": {
|
|
1816
|
-
"required": [
|
|
1817
|
-
"terminal_action",
|
|
1818
|
-
"integration_owner",
|
|
1819
|
-
"parent_branch",
|
|
1820
|
-
"source_checkpoint",
|
|
1821
|
-
"integration"
|
|
1822
|
-
],
|
|
1823
|
-
"properties": {
|
|
1824
|
-
"terminal_action": {"const": "integrate"}
|
|
1825
|
-
}
|
|
1826
|
-
}
|
|
1827
|
-
},
|
|
1828
|
-
{
|
|
1829
|
-
"if": {
|
|
1830
|
-
"properties": {
|
|
1831
|
-
"status": {"enum": ["integrating", "integrated"]},
|
|
1832
|
-
"terminal_action": {"const": "integrate"}
|
|
1833
|
-
},
|
|
1834
|
-
"required": ["status", "terminal_action"]
|
|
1835
|
-
},
|
|
1836
|
-
"then": {
|
|
1837
|
-
"properties": {
|
|
1838
|
-
"source_checkpoint": {"type": "string", "minLength": 1},
|
|
1839
|
-
"integration": {
|
|
1840
|
-
"properties": {
|
|
1841
|
-
"parent_before_sha": {"type": "string", "minLength": 1},
|
|
1842
|
-
"source_sha": {"type": "string", "minLength": 1},
|
|
1843
|
-
"attempts": {"type": "integer", "minimum": 1}
|
|
1844
|
-
}
|
|
1845
|
-
}
|
|
1846
|
-
}
|
|
1847
|
-
}
|
|
1848
|
-
},
|
|
1849
|
-
{
|
|
1850
|
-
"if": {
|
|
1851
|
-
"properties": {
|
|
1852
|
-
"status": {"const": "integrating"},
|
|
1853
|
-
"terminal_action": {"const": "integrate"}
|
|
1854
|
-
},
|
|
1855
|
-
"required": ["status", "terminal_action"]
|
|
1856
|
-
},
|
|
1857
|
-
"then": {
|
|
1858
|
-
"properties": {
|
|
1859
|
-
"integration": {
|
|
1860
|
-
"properties": {
|
|
1861
|
-
"status": {"const": "running"}
|
|
1862
|
-
}
|
|
1863
|
-
}
|
|
1864
|
-
}
|
|
1865
|
-
}
|
|
1866
|
-
},
|
|
1867
|
-
{
|
|
1868
|
-
"if": {
|
|
1869
|
-
"properties": {
|
|
1870
|
-
"status": {"const": "integrated"},
|
|
1871
|
-
"terminal_action": {"const": "integrate"}
|
|
1872
|
-
},
|
|
1873
|
-
"required": ["status", "terminal_action"]
|
|
1874
|
-
},
|
|
1875
|
-
"then": {
|
|
1876
|
-
"properties": {
|
|
1877
|
-
"integration": {
|
|
1878
|
-
"properties": {
|
|
1879
|
-
"status": {"const": "passed"},
|
|
1880
|
-
"result_sha": {"type": "string", "minLength": 1},
|
|
1881
|
-
"method": {"enum": ["fast-forward", "merge-commit"]},
|
|
1882
|
-
"verification": {"const": "passed"}
|
|
1883
|
-
}
|
|
1884
|
-
}
|
|
1885
|
-
}
|
|
1886
|
-
}
|
|
1887
|
-
},
|
|
1888
|
-
{
|
|
1889
|
-
"if": {
|
|
1890
|
-
"properties": {
|
|
1891
|
-
"terminal_action": {"const": "retain"}
|
|
1892
|
-
},
|
|
1893
|
-
"required": ["terminal_action"]
|
|
1894
|
-
},
|
|
1895
|
-
"then": {
|
|
1896
|
-
"properties": {
|
|
1897
|
-
"status": {
|
|
1898
|
-
"not": {"enum": ["integrating", "integrated"]}
|
|
1899
|
-
}
|
|
1900
|
-
}
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
],
|
|
1904
|
-
"additionalProperties": true
|
|
1905
|
-
}
|
|
1906
|
-
}
|
|
1907
|
-
},
|
|
1908
|
-
"allOf": [
|
|
1909
|
-
{
|
|
1910
|
-
"if": {
|
|
1911
|
-
"properties": {
|
|
1912
|
-
"worktrees": {
|
|
1913
|
-
"contains": {
|
|
1914
|
-
"properties": {
|
|
1915
|
-
"provider": {
|
|
1916
|
-
"const": "git"
|
|
1917
|
-
}
|
|
1918
|
-
},
|
|
1919
|
-
"required": [
|
|
1920
|
-
"provider"
|
|
1921
|
-
]
|
|
1922
|
-
}
|
|
1923
|
-
}
|
|
1924
|
-
}
|
|
1485
|
+
"worktree": {
|
|
1486
|
+
"type": "object",
|
|
1487
|
+
"required": ["ticket_id", "owner", "implementation_owner", "integration_owner", "provider", "base_sha", "parent_branch", "branch", "workspace_ref", "source_checkpoint", "integration", "status", "updated_at"],
|
|
1488
|
+
"properties": {
|
|
1489
|
+
"ticket_id": {"type": "string", "pattern": "^T-[0-9]{2,}$"},
|
|
1490
|
+
"owner": {"type": "string", "minLength": 1},
|
|
1491
|
+
"implementation_owner": {"type": "string", "minLength": 1},
|
|
1492
|
+
"integration_owner": {"type": "string", "minLength": 1},
|
|
1493
|
+
"provider": {"const": "git"},
|
|
1494
|
+
"base_sha": {"type": "string", "minLength": 1},
|
|
1495
|
+
"parent_branch": {"type": "string", "minLength": 1},
|
|
1496
|
+
"branch": {"type": "string", "minLength": 1},
|
|
1497
|
+
"workspace_ref": {"type": "string", "pattern": "^specdev-worktree/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"},
|
|
1498
|
+
"source_checkpoint": {"type": ["string", "null"]},
|
|
1499
|
+
"integration": {"$ref": "#/$defs/integration"},
|
|
1500
|
+
"status": {"enum": ["planned", "active", "review", "integrating", "integrated", "removed", "blocked"]},
|
|
1501
|
+
"updated_at": {"type": "string", "minLength": 1}
|
|
1925
1502
|
},
|
|
1926
|
-
"
|
|
1927
|
-
"properties": {
|
|
1928
|
-
"worktrees": {
|
|
1929
|
-
"items": {
|
|
1930
|
-
"if": {
|
|
1931
|
-
"properties": {
|
|
1932
|
-
"provider": {
|
|
1933
|
-
"const": "git"
|
|
1934
|
-
}
|
|
1935
|
-
},
|
|
1936
|
-
"required": [
|
|
1937
|
-
"provider"
|
|
1938
|
-
]
|
|
1939
|
-
},
|
|
1940
|
-
"then": {
|
|
1941
|
-
"properties": {
|
|
1942
|
-
"workspace_ref": {
|
|
1943
|
-
"pattern": "^specdev-worktree/T-[0-9]{2,}$"
|
|
1944
|
-
}
|
|
1945
|
-
}
|
|
1946
|
-
}
|
|
1947
|
-
}
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1503
|
+
"additionalProperties": false
|
|
1951
1504
|
},
|
|
1952
|
-
{
|
|
1953
|
-
"
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
}
|
|
1505
|
+
"integration": {
|
|
1506
|
+
"type": "object",
|
|
1507
|
+
"required": ["status", "parent_ref", "parent_before_sha", "source_sha", "candidate_sha", "candidate_tree_sha", "candidate_branch", "candidate_workspace_ref", "result_sha", "method", "conflict_paths", "verification", "full_suite", "e2e", "evidence", "attempts", "promotion_status"],
|
|
1508
|
+
"properties": {
|
|
1509
|
+
"status": {"enum": ["pending", "candidate", "passed", "failed", "stale"]},
|
|
1510
|
+
"parent_ref": {"type": ["string", "null"]},
|
|
1511
|
+
"parent_before_sha": {"type": ["string", "null"]},
|
|
1512
|
+
"source_sha": {"type": ["string", "null"]},
|
|
1513
|
+
"candidate_sha": {"type": ["string", "null"]},
|
|
1514
|
+
"candidate_tree_sha": {"type": ["string", "null"]},
|
|
1515
|
+
"candidate_branch": {"type": ["string", "null"]},
|
|
1516
|
+
"candidate_workspace_ref": {"anyOf": [{"type": "null"}, {"type": "string", "pattern": "^specdev-worktree/\\.integration/[0-9]{4}-[0-9]{2}-[0-9]{2}-[a-z0-9]+(?:-[a-z0-9]+)*/T-[0-9]{2,}$"}]},
|
|
1517
|
+
"result_sha": {"type": ["string", "null"]},
|
|
1518
|
+
"method": {"enum": [null, "fast-forward", "merge-commit"]},
|
|
1519
|
+
"conflict_paths": {"type": "array", "items": {"type": "string"}},
|
|
1520
|
+
"verification": {"enum": ["pending", "passed", "failed"]},
|
|
1521
|
+
"full_suite": {"$ref": "#/$defs/full-suite"},
|
|
1522
|
+
"e2e": {"$ref": "#/$defs/full-suite"},
|
|
1523
|
+
"evidence": {"type": "string", "pattern": "^\\{roots\\.state\\}/specdev/changes/[^<]+/evidence/T-[0-9]{2,}\\.md$"},
|
|
1524
|
+
"attempts": {"type": "integer", "minimum": 0},
|
|
1525
|
+
"promotion_status": {"enum": ["pending", "applying", "applied", "failed", "stale"]}
|
|
1959
1526
|
},
|
|
1960
|
-
"
|
|
1961
|
-
"properties": {
|
|
1962
|
-
"archived": {
|
|
1963
|
-
"const": true
|
|
1964
|
-
},
|
|
1965
|
-
"archive_path": {
|
|
1966
|
-
"type": "string",
|
|
1967
|
-
"pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"
|
|
1968
|
-
}
|
|
1969
|
-
}
|
|
1970
|
-
}
|
|
1527
|
+
"additionalProperties": false
|
|
1971
1528
|
}
|
|
1972
|
-
|
|
1973
|
-
"
|
|
1529
|
+
},
|
|
1530
|
+
"allOf": [{
|
|
1531
|
+
"if": {"properties": {"change_status": {"const": "archived"}}, "required": ["change_status"]},
|
|
1532
|
+
"then": {"properties": {"archived": {"const": true}, "archive_path": {"type": "string", "pattern": "^specdev/archive/[0-9]{4}-[0-9]{2}/.+/$"}}}
|
|
1533
|
+
}],
|
|
1534
|
+
"additionalProperties": false
|
|
1974
1535
|
}
|
|
1975
1536
|
```
|
|
1976
1537
|
|
|
@@ -1981,34 +1542,42 @@ Manifest 至少记录 repository、branch、checkpoint、工作区状态、包 l
|
|
|
1981
1542
|
```json
|
|
1982
1543
|
{
|
|
1983
1544
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
1984
|
-
"$id": "urn:speculo:specdev:goal-plan:
|
|
1545
|
+
"$id": "urn:speculo:specdev:goal-plan:v5",
|
|
1985
1546
|
"title": "SpecDev Goal Plan Frontmatter",
|
|
1986
1547
|
"type": "object",
|
|
1987
|
-
"required": [
|
|
1548
|
+
"required": [
|
|
1549
|
+
"schema_version", "artifact", "change", "status", "modes", "orchestration",
|
|
1550
|
+
"lead", "implementation_agent_limit", "ticket_workspace_policy", "integration_gate",
|
|
1551
|
+
"ready_for_execution"
|
|
1552
|
+
],
|
|
1988
1553
|
"properties": {
|
|
1989
|
-
"schema_version": {"const":
|
|
1554
|
+
"schema_version": {"const": 5},
|
|
1990
1555
|
"artifact": {"const": "goal-plan"},
|
|
1991
1556
|
"change": {"type": "string", "minLength": 1},
|
|
1992
1557
|
"status": {"enum": ["draft", "ready", "in_progress", "completed", "blocked"]},
|
|
1993
1558
|
"modes": {
|
|
1994
1559
|
"type": "array",
|
|
1995
|
-
"items": {"enum": ["
|
|
1996
|
-
"minItems": 1,
|
|
1560
|
+
"items": {"enum": ["migration", "high-assurance", "reference-conformance", "release-coordination"]},
|
|
1997
1561
|
"uniqueItems": true
|
|
1998
1562
|
},
|
|
1999
|
-
"
|
|
2000
|
-
|
|
2001
|
-
},
|
|
2002
|
-
"
|
|
2003
|
-
|
|
2004
|
-
},
|
|
1563
|
+
"orchestration": {"const": "lead-directed"},
|
|
1564
|
+
"lead": {"type": "string", "minLength": 1},
|
|
1565
|
+
"implementation_agent_limit": {"type": "integer", "minimum": 1, "maximum": 3},
|
|
1566
|
+
"ticket_workspace_policy": {"const": "required"},
|
|
1567
|
+
"integration_gate": {"const": "candidate-merge"},
|
|
2005
1568
|
"ready_for_execution": {"type": "boolean"}
|
|
2006
1569
|
},
|
|
2007
|
-
"
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
1570
|
+
"allOf": [
|
|
1571
|
+
{
|
|
1572
|
+
"if": {"properties": {"status": {"enum": ["draft", "blocked", "completed"]}}, "required": ["status"]},
|
|
1573
|
+
"then": {"properties": {"ready_for_execution": {"const": false}}}
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
"if": {"properties": {"status": {"enum": ["ready", "in_progress"]}}, "required": ["status"]},
|
|
1577
|
+
"then": {"properties": {"ready_for_execution": {"const": true}}}
|
|
1578
|
+
}
|
|
1579
|
+
],
|
|
1580
|
+
"additionalProperties": false
|
|
2012
1581
|
}
|
|
2013
1582
|
```
|
|
2014
1583
|
|