Skip to content

Commit 14fa41f

Browse files
author
developerworks
committed
Record runtime semantics drift alignment
- Refresh approved sync proposals and apply reports - Add the runtime semantics supersession index - Align shutdown pipeline spec details with implementation naming
1 parent a5473ae commit 14fa41f

15 files changed

Lines changed: 983 additions & 512 deletions

File tree

‎.specify/sync/align-tasks.md‎

Lines changed: 199 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,207 @@
11
# Sync Align Tasks(同步对齐任务)
22

3+
Generated(生成时间): 2026-05-15T01:30:16+08:00
4+
Based on(基于): `.specify/sync/proposals.json` (interactive approve, `P001`..`P007`)
5+
Approved Proposals(已批准提案): `P001`, `P002`, `P003`, `P004`, `P005`, `P006`, `P007` (Option C 见 `M007`)
6+
7+
---
8+
9+
## Task P001: Align 004-3-child-slot-control/FR-001, FR-003, SC-001..SC-004
10+
11+
**Spec Requirement(规格需求)**: `004-3-child-slot-control` — `FR-001`, `FR-003`, `SC-001`..`SC-004`
12+
13+
**Direction(方向)**: ALIGN(规格到代码)
14+
15+
**Current Code(当前代码)**: `ActiveChildAttempt` 仅服务关闭流水线, `current_state` 仅返回子任务数量与是否已关闭.
16+
17+
**Required Change(需要变更)**: 引入运行时私有 `ChildSlot` 模型, 收敛 `active_attempts`, 关闭流水线从槽位读取活动尝试, 扩展 `current_state` 返回每子任务槽位摘要, 为暂停, 恢复, 隔离, 移除与关闭结果增加槽位终态字段.
18+
19+
**Files to Modify(需要修改的文件)**:
20+
21+
- `src/runtime/control_loop.rs`
22+
- `src/runtime/shutdown_pipeline.rs`
23+
- `src/runtime/mod.rs`
24+
- `src/control/command.rs`
25+
- `src/shutdown/report.rs` (若公开状态形状变化)
26+
- `src/tests/supervisor_control_test.rs` 或新增 `src/tests/` 下对齐测试
27+
28+
**Estimated Effort(预估工作量)**: LARGE(大)
29+
30+
### Acceptance Criteria(验收标准)
31+
32+
- [ ] 每个声明子任务在运行时有唯一槽位视图, 含 `generation`, `attempt`, 活动句柄与预算字段中与规格一致子集.
33+
- [ ] `ShutdownTree` 关闭路径从槽位读取活动尝试, 不维护第二套并行事实源.
34+
- [ ] `current_state` 或等价查询返回每子任务摘要, 满足 `FR-003` 可测试子集.
35+
- [ ] 新增或更新测试证明槽位摘要在暂停, 运行与关闭后一致.
36+
37+
---
38+
39+
## Task P002: Align 004-3-child-slot-control/FR-002
40+
41+
**Spec Requirement(规格需求)**: `004-3-child-slot-control` — `FR-002`
42+
43+
**Direction(方向)**: ALIGN(规格到代码)
44+
45+
**Current Code(当前代码)**: `pause_child`, `remove_child`, `quarantine_child` 主要 `set_child_state`, 未停止真实任务.
46+
47+
**Required Change(需要变更)**: 暂停发取消并等待结束或超时, 隔离停止尝试并禁止自动重启, 移除停止尝试并移除或标记槽位, 重复命令幂等.
48+
49+
**Files to Modify(需要修改的文件)**:
50+
51+
- `src/runtime/control_loop.rs`
52+
- `src/control/command.rs`
53+
- `src/tests/supervisor_control_test.rs`
54+
55+
**Estimated Effort(预估工作量)**: LARGE(大)
56+
57+
### Acceptance Criteria(验收标准)
58+
59+
- [ ] 三条命令均触发对真实 `CancellationToken` / `AbortHandle` 路径的可观察动作.
60+
- [ ] 测试断言任务在暂停, 隔离或移除后不再无约束运行.
61+
- [ ] 重复同一停止类命令返回幂等结果且无双重停止风暴.
62+
63+
---
64+
65+
## Task P003: Align 004-4-generation-fencing/FR-001..FR-003, SC-001..SC-004
66+
67+
**Spec Requirement(规格需求)**: `004-4-generation-fencing` — `FR-001`..`FR-003`, `SC-001`..`SC-004`
68+
69+
**Direction(方向)**: ALIGN(规格到代码)
70+
71+
**Current Code(当前代码)**: `spawn_child_attempt` 立即 `abort` 旧尝试并启动新尝试, `record_child_exit` 未校验代际.
72+
73+
**Required Change(需要变更)**: 统一重启流水线: 取消, 等待, 超时中止, 再升代际, 退出记录校验 `(child_id, generation, attempt)`, 旧代际迟到标 stale, `current_state` 暴露代际.
74+
75+
**Files to Modify(需要修改的文件)**:
76+
77+
- `src/runtime/control_loop.rs`
78+
- `src/runtime/shutdown_pipeline.rs`
79+
- `src/tests/` 下代际与重启相关集成测试
80+
81+
**Estimated Effort(预估工作量)**: LARGE(大)
82+
83+
### Acceptance Criteria(验收标准)
84+
85+
- [ ] 连续重启仅最后一代可处于运行中语义有测试覆盖.
86+
- [ ] 旧代际迟到退出不覆盖注册表中当前代际槽位.
87+
- [ ] `current_state` 或等价结构暴露 `generation` 与冲突诊断字段.
88+
89+
---
90+
91+
## Task P004: Align 004-1-runtime-lifecycle-guard/FR-002, SC-002
92+
93+
**Spec Requirement(规格需求)**: `004-1-runtime-lifecycle-guard` — `FR-002`, `SC-002`
94+
95+
**Direction(方向)**: ALIGN(规格到代码)
96+
97+
**Current Code(当前代码)**: `watchdog` 主要字符串 `broadcast`, 未将 `RuntimeControlLoopFailed` 写入 `ObservabilityPipeline`.
98+
99+
**Required Change(需要变更)**: 启动路径持有观测入口, 失败路径构造类型化事件并经 `ObservabilityPipeline::emit` 落 journal, metrics, audit, 保留字符串广播为兼容旁路.
100+
101+
**Files to Modify(需要修改的文件)**:
102+
103+
- `src/runtime/watchdog.rs`
104+
- `src/runtime/lifecycle.rs` 或 `Supervisor` 启动绑定
105+
- `src/event/payload.rs`
106+
- `src/observe/pipeline.rs`
107+
- `src/observe/metrics.rs`
108+
- `src/tests/` 下控制循环失败可观测性测试
109+
110+
**Estimated Effort(预估工作量)**: MEDIUM(中)
111+
112+
### Acceptance Criteria(验收标准)
113+
114+
- [ ] 控制循环异常退出时, 测试能断言至少一条类型化监督器事件进入观测测试夹具.
115+
- [ ] metrics 或 audit 中至少一项出现与失败对应的低基数计数或事实记录.
116+
117+
---
118+
119+
## Task P005: Align 004-2-real-shutdown-pipeline/FR-003
120+
121+
**Spec Requirement(规格需求)**: `004-2-real-shutdown-pipeline` — `FR-003`
122+
123+
**Direction(方向)**: ALIGN(规格到代码)
124+
125+
**Current Code(当前代码)**: `ShutdownReconcileReport` 中 journal, metrics 状态来自 `core_runtime_completed()` 默认常量.
126+
127+
**Required Change(需要变更)**: `execute_shutdown` 各阶段发出类型化关闭事件, 对账状态由 emit 结果或流水线可观测状态推导, 套接字保持 `NotOwned`.
128+
129+
**Files to Modify(需要修改的文件)**:
130+
131+
- `src/runtime/control_loop.rs`
132+
- `src/shutdown/report.rs`
133+
- `src/event/payload.rs`
134+
- `src/observe/pipeline.rs`
135+
- `src/tests/supervisor_real_shutdown_pipeline_test.rs`
136+
137+
**Estimated Effort(预估工作量)**: MEDIUM(中)
138+
139+
### Acceptance Criteria(验收标准)
140+
141+
- [ ] 测试或观测夹具证明关闭完成路径上 journal, metrics 状态非无条件 `Recorded` 盲填.
142+
- [ ] 契约测试仍通过, 且不引入 compatibility export.
143+
144+
---
145+
146+
## Task P006: Align 003-supervisor-dashboard/SC-003, SC-012
147+
148+
**Spec Requirement(规格需求)**: `003-supervisor-dashboard` — `SC-003`, `SC-012`
149+
150+
**Direction(方向)**: ALIGN(规格到代码, 跨仓)
151+
152+
**Current Code(当前代码)**: `specs/003-supervisor-dashboard/tasks.md` 中 `T066` 等仍未闭合.
153+
154+
**Required Change(需要变更)**: 在相邻 `rust-supervisor-ui` 仓库实现 Playwright 定位验收与 `package.json` / `src` 下无 React 组件体系证明.
155+
156+
**Files to Modify(需要修改的文件)**:
157+
158+
- `../rust-supervisor-ui/` (仓库根与 `tests/` 或 CI 配置, 本任务不强制修改当前主仓)
159+
- `specs/003-supervisor-dashboard/tasks.md` (闭合勾选与证据链接)
160+
161+
**Estimated Effort(预估工作量)**: LARGE(大)
162+
163+
### Acceptance Criteria(验收标准)
164+
165+
- [ ] `T066` 及相关成功标准在 `tasks.md` 可勾选并附运行命令或 CI 链接.
166+
- [ ] 自动化脚本证明无 React 运行时依赖与无 `.tsx`/`.jsx` 业务源码.
167+
168+
---
169+
170+
## Task M007: Apply P007 Option C — drift supersession index
171+
172+
**Spec Requirement(规格需求)**: 工作流元任务 — `001-create-supervisor-core` 宽口径条款与 `004` 系列关系
173+
174+
**Direction(方向)**: META(元, 不改 `001` 正文)
175+
176+
**Current Code(当前代码)**: 无代码变更.
177+
178+
**Required Change(需要变更)**: 维护 `.specify/sync/drift-supersession.md`, 并在下次 `speckit.sync.analyze` 人工 triage 或脚本增强时引用该表, 将表中左列需求在已选右列规格活跃时的漂移标为 **SUPERSEDED**.
179+
180+
**Files to Modify(需要修改的文件)**:
181+
182+
- `.specify/sync/drift-supersession.md` (已创建, 后续迭代补行)
183+
- 可选: 生成 `drift-report` 的脚本或技能说明
184+
185+
**Estimated Effort(预估工作量)**: SMALL(小)
186+
187+
### Acceptance Criteria(验收标准)
188+
189+
- [ ] 评审承认 `001` 正文未改, 但同步工作流有可查 supersession 表.
190+
- [ ] `apply-report` 与本任务交叉引用一致.
191+
192+
---
193+
194+
以下为历史 apply 产物 (2026-05-08), 其中绝对路径可能指向旧工作区克隆, **保留供审计**, 不作为当前仓库路径规范.
195+
196+
---
197+
198+
## Historical: 2026-05-08 apply(历史应用)
199+
3200
Generated(生成时间): 2026-05-08T01:55:02+08:00
4201
Based on(基于): `.specify/sync/proposals.json`
5202
Approved Proposals(已批准提案): `P001`, `P002`
6203

7-
## Task A001: Align 001-create-supervisor-core/FR-063
204+
### Task A001: Align 001-create-supervisor-core/FR-063
8205

9206
**Spec Requirement(规格需求)**: `FR-063`
10207

@@ -70,7 +267,7 @@ Approved Proposals(已批准提案): `P001`, `P002`
70267
- [X] 003 dashboard(看板) spec(规格), plan(计划), data model(数据模型), task(任务) 和 contract(契约) 文档全部改为 state(状态) 语义.
71268
- [X] 不新增 compatibility export(兼容导出), 历史别名或旧协议别名.
72269

73-
## Task A002: Align 001-create-supervisor-core/SC-031
270+
### Task A002: Align 001-create-supervisor-core/SC-031
74271

75272
**Spec Requirement(规格需求)**: `SC-031`
76273

‎.specify/sync/apply-report.json‎

Lines changed: 27 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,35 @@
11
{
2-
"applied": "2026-05-08T01:55:02+08:00",
2+
"applied": "2026-05-15T01:30:16+08:00",
33
"based_on": {
4-
"proposals_generated": "2026-05-08T01:38:44+08:00",
5-
"path": ".specify/sync/proposals.json"
4+
"proposals_path": ".specify/sync/proposals.json",
5+
"drift_report_path": ".specify/sync/drift-report.json"
66
},
7-
"approved_proposals": [
8-
"P001",
9-
"P002"
10-
],
11-
"changes_made": {
12-
"specs_updated": [],
13-
"new_specs_created": [],
14-
"implementation_tasks_generated": [
15-
{
16-
"file": ".specify/sync/align-tasks.md",
17-
"task": "A001",
18-
"target": "001-create-supervisor-core/FR-063",
19-
"type": "ALIGN"
20-
},
21-
{
22-
"file": ".specify/sync/align-tasks.md",
23-
"task": "A002",
24-
"target": "001-create-supervisor-core/SC-031",
25-
"type": "ALIGN"
26-
}
27-
]
28-
},
29-
"proposal_status_updated": [
7+
"specs_updated": [],
8+
"new_specs_created": [],
9+
"workflow_files_created": [
3010
{
31-
"id": "P001",
32-
"approved": true,
33-
"action": "applied_align_tasks_generated",
34-
"applied": true,
35-
"applied_at": "2026-05-08T01:55:02+08:00"
36-
},
37-
{
38-
"id": "P002",
39-
"approved": true,
40-
"action": "applied_align_tasks_generated",
41-
"applied": true,
42-
"applied_at": "2026-05-08T01:55:02+08:00"
11+
"path": ".specify/sync/drift-supersession.md",
12+
"reason": "P007 Option C superseded-by-004 index"
4313
}
4414
],
45-
"not_applied": [
46-
{
47-
"proposal": "P003",
48-
"reason": "Rejected. Spec Kit sync extension is local workflow tooling, not a product feature spec."
49-
}
15+
"implementation_tasks_file": ".specify/sync/align-tasks.md",
16+
"align_tasks_generated": [
17+
"P001",
18+
"P002",
19+
"P003",
20+
"P004",
21+
"P005",
22+
"P006",
23+
"M007"
24+
],
25+
"proposals_marked_applied": [
26+
"P001",
27+
"P002",
28+
"P003",
29+
"P004",
30+
"P005",
31+
"P006",
32+
"P007"
5033
],
51-
"validation": {
52-
"status": "passed",
53-
"evidence": [
54-
"jq parsed .specify/sync/proposals.json before apply.",
55-
"rg scanned current repo, relay repo and UI repo to collect align task file targets.",
56-
"jq parsed .specify/sync/apply-report.json and .specify/sync/proposals.json after apply.",
57-
"git diff --check passed for sync apply artifacts.",
58-
"rg found no Chinese punctuation in sync apply artifacts."
59-
]
60-
}
34+
"not_applied": []
6135
}

‎.specify/sync/apply-report.md‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
11
# Sync Apply Report(同步应用报告)
22

3-
Applied(应用时间): 2026-05-08T01:55:02+08:00
4-
Based on(基于): `.specify/sync/proposals.json`
3+
Applied(应用时间): 2026-05-15T01:30:16+08:00
4+
Based on(基于): `.specify/sync/proposals.json` (全部 `approved: true` 的 `P001`..`P007`)
55

66
## Changes Made(已做变更)
77

88
### Specs Updated(已更新规格)
99

10-
None(无). 本轮批准项都是 ALIGN(对齐) proposal(提案), skill(技能) 规则要求生成 implementation tasks(实现任务), 不直接改规格正文.
10+
None(无). 本轮无 BACKFILL, 且 **P007** 选择 **Option C** 明确要求**不**修改 `specs/001-create-supervisor-core/spec.md` 正文.
1111

1212
### New Specs Created(已创建新规格)
1313

14-
None(无). `P003` 已拒绝, 因为 Spec Kit sync extension(规格工具同步扩展) 是本地工作流资产, 不属于产品功能.
14+
None(无).
15+
16+
### Drift Workflow Artifacts(偏差工作流产物)
17+
18+
- 新增 `.specify/sync/drift-supersession.md`, 落实 **P007 Option C** 的 superseded 索引, 供后续 `speckit.sync.analyze` 人工分流或脚本引用.
1519

1620
### Implementation Tasks Generated(已生成实现任务)
1721

18-
- `.specify/sync/align-tasks.md` 生成 `A001`, 对应 `001-create-supervisor-core/FR-063`.
19-
- `.specify/sync/align-tasks.md` 生成 `A002`, 对应 `001-create-supervisor-core/SC-031`.
22+
- 重写 `.specify/sync/align-tasks.md` **顶部**为 `2026-05-15` 批次: `P001`..`P006` 六条 ALIGN 对齐任务与 **M007** 元任务.
23+
- 保留 **2026-05-08** 历史 `A001`, `A002` 于 **Historical** 小节, 标题降级为 `###`, 避免双一级标题.
2024

2125
### Proposal Status Updated(已更新提案状态)
2226

23-
- `P001` marked as applied by align task generation(已通过生成对齐任务应用).
24-
- `P002` marked as applied by align task generation(已通过生成对齐任务应用).
25-
- `P003` remains rejected(保持拒绝).
27+
- `P001`..`P007` 均已写入 `applied: true` 与 `applied_at` 于 `.specify/sync/proposals.json`.
2628

2729
### Not Applied(未应用)
2830

29-
| Proposal(提案) | Reason(原因) |
30-
|---|---|
31-
| `P003` | Rejected(已拒绝). 本地 Spec Kit(规格工具) 工作流资产不进入产品功能规格. |
31+
None(无). 所有已批准提案均已落盘为任务或 supersession 索引.
32+
33+
## Next Steps(下一步)
34+
35+
1. 按 `align-tasks.md` 中 **Task P001** 起顺序实现或再拆任务.
36+
2. 评审 `.specify/sync/drift-supersession.md`, 必要时补行以覆盖 `drift-report` 中其余 001 条目.
37+
3. 可选提交: `git add .specify/sync/ && git commit -m "sync: apply drift resolutions (align-tasks, supersession, proposals applied)"`.
3238

3339
## Validation Evidence(验证证据)
3440

35-
- `jq` parsed `.specify/sync/proposals.json` before apply(应用前解析成功).
36-
- `rg` scanned current repo, relay(中继) repo and UI(用户界面) repo to collect concrete align task(对齐任务) file targets.
37-
- Apply(应用) wrote `.specify/sync/align-tasks.md`, `.specify/sync/apply-report.md` and `.specify/sync/apply-report.json`.
38-
- `jq` parsed `.specify/sync/apply-report.json` and `.specify/sync/proposals.json` after apply(应用后解析成功).
39-
- `git diff --check` passed for sync apply artifacts(同步应用产物).
40-
- `rg` found no Chinese punctuation(中文标点) in sync apply artifacts(同步应用产物).
41+
- `python3 -m json.tool` 或等效解析确认 `proposals.json` 与将写入的 `apply-report.json` 结构合法.

0 commit comments

Comments
 (0)