flow-comet 1.6.2 → 1.6.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/.flow-comet/skills/flow-comet/INSTALLED_VERSION +1 -1
- package/.flow-comet/skills/flow-comet/SKILL.md +64 -46
- package/.flow-comet/skills/flow-comet/reference/KNOWN-ISSUES-template.md +1 -1
- package/.flow-comet/skills/flow-comet/reference/commit-discipline.md +32 -0
- package/.flow-comet/skills/flow-comet/reference/dirty-worktree.md +1 -1
- package/.flow-comet/skills/flow-comet/{GUIDANCE.md → reference/entry-detail.md} +18 -28
- package/.flow-comet/skills/flow-comet/reference/fix-loop.md +57 -0
- package/.flow-comet/skills/flow-comet/reference/platform-facts.md +58 -0
- package/.flow-comet/skills/flow-comet/reference/replan.md +23 -0
- package/.flow-comet/skills/flow-comet/scripts/comet-check.mjs +5 -4
- package/.flow-comet/skills/flow-comet/scripts/comet-hook-guard.mjs +260 -17
- package/.flow-comet/skills/flow-comet/scripts/guard-self-test.mjs +2714 -161
- package/.flow-comet/skills/flow-comet/scripts/route-node.mjs +51 -4
- package/.flow-comet/skills/flow-comet/scripts/state-schema.mjs +13 -0
- package/.flow-comet/skills/flow-comet/scripts/system-test.mjs +877 -10
- package/.flow-comet/skills/flow-comet/scripts/workflow-guard.mjs +52 -4
- package/.flow-comet/skills/flow-comet/scripts/workflow-handoff.mjs +111 -4
- package/.flow-comet/skills/flow-comet/scripts/workflow-state.mjs +108 -2
- package/.flow-comet/skills/flow-comet-archive/SKILL.md +10 -19
- package/.flow-comet/skills/flow-comet-change/SKILL.md +2 -3
- package/.flow-comet/skills/flow-comet-compose/SKILL.md +1 -1
- package/.flow-comet/skills/flow-comet-design/SKILL.md +6 -6
- package/.flow-comet/skills/flow-comet-execute/SKILL.md +58 -16
- package/.flow-comet/skills/flow-comet-integration/SKILL.md +8 -5
- package/.flow-comet/skills/flow-comet-open/SKILL.md +5 -1
- package/.flow-comet/skills/flow-comet-plan/GUIDANCE.md +1 -1
- package/.flow-comet/skills/flow-comet-plan/SKILL.md +8 -8
- package/.flow-comet/skills/flow-comet-review/SKILL.md +9 -12
- package/.flow-comet/skills/flow-comet-subagent-execute/SKILL.md +59 -16
- package/.flow-comet/skills/flow-comet-task/SKILL.md +3 -2
- package/.flow-comet/skills/flow-comet-ui-design/SKILL.md +3 -3
- package/.flow-comet/skills/flow-comet-verify/SKILL.md +8 -17
- package/README.md +4 -4
- package/package.json +1 -1
- package/scripts/dsh-bridge.mjs +59 -26
- package/scripts/prepare-env.mjs +165 -1
- package/.flow-comet/skills/flow-comet/reference/TEST-MATRIX.md +0 -116
- package/.flow-comet/skills/flow-comet/reference/composition-report.md +0 -65
- package/.flow-comet/skills/flow-comet/reference/dsh-platform.md +0 -184
- package/.flow-comet/skills/flow-comet/reference/resolved-skills.json +0 -661
- package/.flow-comet/skills/flow-comet/reference/skill-review.md +0 -13
- package/.flow-comet/skills/flow-comet/reference/subagents/script-author.md +0 -7
- package/.flow-comet/skills/flow-comet/reference/worktree-notes.md +0 -70
|
@@ -11,7 +11,7 @@ Complete the `execute` Node for `flow-comet`.
|
|
|
11
11
|
|
|
12
12
|
Responsibility: 按 TASK.md 逐任务执行(**执行模式按 executionMode**:subagent 默认统一委托子代理、direct 逃生口主代理直写)。串行任务的 TDD + 6 维自查 + LESSONS 扫描 + diff 边界 verify 由执行者承担,无论哪种模式都必须加载 flow-comet-dev 协议。
|
|
13
13
|
|
|
14
|
-
In subagent mode (default) this node is a coordinator: it does not write implementation code directly — it delegates the pending serial tasks to fresh-context subagents
|
|
14
|
+
In subagent mode (default) this node is a coordinator: it does not write implementation code directly — it delegates the pending serial tasks to fresh-context subagents (all three platforms delegate under one identity-based criterion; worktree isolation is one optional implementation of attribute ①, not a requirement — see the four-attribute contract below), each subagent applies the full dev protocol (TDD RED/GREEN/REFACTOR, LESSONS scan, existing abstraction grep, self-review, diff boundary verification, atomic commits) and returns a Return Contract. 趟次协作:并行委托节点(subagent-execute)可多次往返——每趟委托全部依赖已满足的并行任务,本节点在趟间消化串行任务,直至两者清空。The coordinator records handoff evidence, verifies each SUMMARY, and marks tasks done in TASK.md. In direct mode (escape hatch, user-confirmed) the main agent implements serial tasks directly — see 执行模型 below.
|
|
15
15
|
|
|
16
16
|
## Guidance
|
|
17
17
|
|
|
@@ -29,7 +29,7 @@ guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B;「填得好
|
|
|
29
29
|
|
|
30
30
|
### 执行模型(按 executionMode,用户显式选择)
|
|
31
31
|
|
|
32
|
-
- **subagent(默认)**: 统一委托子代理——协调者流程(构造 handoff →
|
|
32
|
+
- **subagent(默认)**: 统一委托子代理——协调者流程(构造 handoff → 按平台通道委托(三平台同一身份判据;worktree 为属性①的可选实现)→ 收集 Return Contract → 验收标 done)
|
|
33
33
|
- **direct(逃生口,需用户显式切换)**: 主代理直接执行串行任务——但必须加载 flow-comet-dev 完整协议
|
|
34
34
|
(TDD/6 维自查/越界检查/原子 commit),SUMMARY 必填段 + `## 自检方法` 强制(guard 校验兜底)
|
|
35
35
|
- 无论哪种模式:`parallel="true"` 任务始终由 subagent-execute 并行委托,不在此节点执行。
|
|
@@ -44,7 +44,9 @@ execute 节点**只处理 `parallel="false"`(或未标注 parallel)的 pendi
|
|
|
44
44
|
|
|
45
45
|
**TASK 签名校验(C3,execute 期间)**:entry execute 时记录任务集签名(行尾规范化 + 标记属性剥离);exit 时比对——execute 期间 TASK.md **只允许改开标签的标记属性**(`status` done/pending;时间戳如需记录写在开标签属性如 `completed_at`——签名剥离白名单允许;**禁止写入 action/其他 task 内容**),增删任务/改 action/改边界/改其他内容会在 exit 被 BLOCKED(签名不匹配)。回退修复任务(review/verify 发现缺陷追加)须先经 review 流程追加到 `## Fix 任务` 段,再按下方「修复回路状态机路径」受控归位 execute,并由 entry execute 刷新签名(端到端验证实证:直接注入任务会被签名拦截)。
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
**任务集已修订 ⇒ 出口报「签名不匹配」时的合法出口**:**不要手改状态**——跑 `workflow-state.mjs replan "<原因>" --authorized-by <来源>` 重校重签(需用户显式授权;**要判定该不该重校、或签名不匹配要处置时读 `../flow-comet/reference/replan.md`**)。
|
|
48
|
+
|
|
49
|
+
本节点**不直接写实现代码**。所有 pending 任务统一委托 fresh-context 子代理执行(加载 flow-comet-dev + 回传 Return Contract);委托通道按平台(差异只在谁建树),见下方「并行安全四属性契约」与 `../flow-comet/reference/platform-facts.md`(三平台通道对照表)。
|
|
48
50
|
|
|
49
51
|
- `parallel="true"` 的 pending 任务由 subagent-execute 节点负责并行委托
|
|
50
52
|
- execute 遍历 TASK.md 时,遇到 `parallel="true" status="pending"` 的任务块应**跳过**
|
|
@@ -52,7 +54,48 @@ execute 节点**只处理 `parallel="false"`(或未标注 parallel)的 pendi
|
|
|
52
54
|
1. 正常流程下 determineNode 的 路由逻辑会**直接路由到 subagent-execute**(无需经过 execute 空退出)——协调者确认 路由逻辑生效(`NODE: subagent-execute`)后直接进入该节点
|
|
53
55
|
2. 若已进入 execute 且确认无串行任务可做:按正常 exit 流程处理(record execute evidence + 满足产物校验),需要豁免越俎代庖检测时用 `record execute '{"parallelTakeoverApproved":true}'` 显式声明;[P] 任务由 execute 完成属越权委托——新 change BLOCKED(旧 change WARN 渐进)
|
|
54
56
|
3. **显式空退出豁免(新 change 可用)**:确认全 parallel 无串行可做且无法路由时,用 `record execute '{"emptyExitApproved":true}'` 显式声明后 exit 通过(跳过串行 pending 与产物校验;防规划错误仍默认 BLOCKED——豁免须显式声明;exit 输出 EMPTY-EXIT 审计提示)
|
|
55
|
-
- determineNode 路由逻辑会优先检测依赖已满足的 parallel 任务并路由到 subagent-execute;若 determineNode 路由到了 execute,说明当前趟存在需要 execute
|
|
57
|
+
- determineNode 路由逻辑会优先检测依赖已满足的 parallel 任务并路由到 subagent-execute;若 determineNode 路由到了 execute,说明当前趟存在需要 execute 处理的串行任务(此时应执行而非空退出——**除非已显式声明空退出豁免** `emptyExitApproved`,见上条第 3 项)——串行消化完成后再次路由,剩余并行任务回到 subagent-execute 的下一趟(多趟循环直至无可并行 pending 且无串行残留)
|
|
58
|
+
|
|
59
|
+
### 并行安全四属性契约
|
|
60
|
+
|
|
61
|
+
> **并行安全四属性契约**:契约对象是**四属性**,不是 worktree——`worktree` 只是属性①「写权限」的**实现之一**,不是契约本身;「一律 worktree」的口号已作废(本仓决策:契约对象 = 四属性,worktree 降为实现之一)。三平台在同一判据下平行对等,**唯一差异是「谁建树」**。
|
|
62
|
+
>
|
|
63
|
+
> | # | 属性 | 含义 | 满足形态 |
|
|
64
|
+
> |---|------|------|----------|
|
|
65
|
+
> | ① | **写权限** | 每个写者必须有一条被守卫认可的写入通道 | **身份分派**(CC / Codex 载荷含 `agent_id` ⇒ 子代理语义;dsh 桥接以环境变量 `FLOW_COMET_AGENT_DEPTH` 透传正整数身份深度,**并同时注入桥接通道标记 `FLOW_COMET_AGENT_DEPTH_SOURCE`——守卫要求标记与深度同时在场才接受该通道**)——**worktree 只是本属性的实现之一**,不是必须;**最小保护集除外**:身份在场时 `.flow-comet/flow-comet-state.json` 与 `../flow-comet/reference/workflow-protocol.json` 仍受拦(三平台一致 BLOCKED) |
|
|
66
|
+
> | ② | **提交隔离** | 提交只含自己 `write_files` 的字面路径 | 提交面 pathspec 纪律五要素(见 Guidance 同名小节) |
|
|
67
|
+
> | ③ | **验证隔离** | 同一时刻只有一个写者:全量判据不得与在飞写者并行 | 出口校验锚 = `handoffRequests` 有 request 无对应 `handoffResult` ⇒ 新 change BLOCKED / 旧 change WARN;全部有 result ⇒ 放行;无证据 ⇒ 零输出(**已撤回的 request 不构成在飞委托**:`workflow-handoff.mjs withdraw <task-id> --by <来源>` 在原记录上留痕 `withdrawnAt` + `withdrawnBy`,已撤回 = 终态、历史不删) |
|
|
68
|
+
> | ④ | **集成纪律** | 机制选择 / 顺序 / 审计 / 冲突处置四项均有明文规则 | 集成纪律四要素(见 Guidance 同名小节) |
|
|
69
|
+
>
|
|
70
|
+
> **写面含 gitignored 面的任务(四属性映射 · 与其他任务同一判据)**:任务 `write_files` 全为 gitignored 字面路径时,四属性的满足方式不变——① **写权限**仍走**身份通道**(载荷 `agent_id` / 环境变量身份深度 ⇒ 子代理语义放行,项目内任意路径可写(含 gitignored);gitignored 只是路径属性,不是通道差异);② **提交隔离**走既有 **`noCommit` 资格**(request 按 `.gitignore` 命中记 `noCommit:true` ⇒ 任务零提交,「提交只含自己 `write_files` 的字面路径」由**无提交**满足,不是放宽校验;资格 fail-closed:glob / `..` 越界 / 非 git 仓 / tracked 文件 / 链接逃逸一律不授予,result 时刻按同一判据重验,失败即撤销资格);③④ 与其他任务同形(同一时刻单写者 + 集成四要素)。**并行 × 零提交**因此合法:任务可标 `parallel="true"` 并被并行委派,出口校验按 request 的 `noCommit` 资格豁免缺 `commitHash`。
|
|
71
|
+
> **留痕的边界(诚实声明 · 与 `directOverride` / `completedChecks` / `reentryAuthorization` 同族)**:留痕记录的是「**发生过委派**」,**不是**对执行者身份的物理证明——`handoffRequests` / `handoffResult` 只证明协调者写下过 request 与 result 两条记录,不证明写入确实由子代理完成;与 `completedChecks` 只能记录声明、`directOverride` 只能记录授权、`reentryAuthorization` 只能记录授权源同理。声明与事实不符属流程违规,验收以 transcript 可见的委派触发为准。
|
|
72
|
+
>
|
|
73
|
+
> **平台事实(三平台通道 · 判级三态 · 实测与边界)**:要判定平台能力(能否并行委派 / 谁建树 / 写通道是什么)或引用判级口径时读 `../flow-comet/reference/platform-facts.md`——三平台通道对照表、判级三态(证实 / 推翻 / 未覆盖)与该次实测的限定边界原文在该文件,本册不复述。
|
|
74
|
+
|
|
75
|
+
### 提交面 pathspec 纪律(要点 · 带适用条件)
|
|
76
|
+
|
|
77
|
+
**适用条件(先读)**:本条纪律适用于「**多个写者共享同一工作区**」形态——并发写者同处一个工作树(CC 非 worktree 委托 / Codex 共享工作区 / dsh 进程内子代理)。**各自独立工作区(worktree 等)内的局部 `reset` / `clean` 不在禁令内**;但只要本趟存在**任一**共享工作区的写者,本条即对整个并行趟生效。
|
|
78
|
+
|
|
79
|
+
要点(五要素 + 并行波次附加两条):
|
|
80
|
+
|
|
81
|
+
1. **`git add -- <自己字面路径>`** + **`git commit -- <同一路径>`**:逐条字面路径(取自本任务 `write_files`),两步路径集逐字一致——提交只含自己的文件;禁用 `.` / `-A` / `-u` 等宽泛形态。
|
|
82
|
+
2. **锁失败重试**:并发提交撞 `index.lock` / `cannot lock ref` ⇒ **失败即重试**,不得因锁失败改用宽泛命令。
|
|
83
|
+
3. **禁裸 `add` / `commit -a` / `stash` / `clean` / `reset`**:并发写者共享**同一个索引与工作树**——宽泛命令有**并发索引竞态**(把同伴半成品纳入自己的提交),`stash` / `clean` / `reset` 更会破坏同伴的未提交工作。
|
|
84
|
+
4. **并行波次禁用 `git commit --amend`**:共享工作区下 HEAD 会被并行写者推进;确需修正必须**先断言 `git rev-parse HEAD` 等于自己刚提交的哈希**,否则一律改用**新提交追加**。
|
|
85
|
+
5. **误改后的自救通道**(第 3 条「禁 `reset`」的定向例外):断言 HEAD 后 `git reset --soft <自己的父提交>`(**只用 `--soft`**),再以 **pathspec** 重建自己的提交。
|
|
86
|
+
|
|
87
|
+
> **要判定提交边界、或撞上锁 / 误改要收拾时读 `../flow-comet/reference/commit-discipline.md`**——五要素与并行波次附加两条的完整判据(含实测依据)在该文件。
|
|
88
|
+
|
|
89
|
+
### 集成纪律(要点)
|
|
90
|
+
|
|
91
|
+
要点(四要素):
|
|
92
|
+
|
|
93
|
+
1. **机制选择**:优先 **`git merge --no-ff`**(保留父子关系、可审计;comet 先例:集成用 `--no-ff`、交付用 `--ff-only`);冲突难解时**降级 `git cherry-pick` 并强制记因**(审计行写明降级原因)。
|
|
94
|
+
2. **顺序(确定性规则)**:先按 `depends_on` 的**拓扑序**(被依赖者先入),同一拓扑层内按 **task id 升序**——**不得依赖书写顺序** / 提交到达顺序 / 完成先后等运行期不确定量。
|
|
95
|
+
3. **审计留痕**:每次集成输出一行 `INTEGRATE: <task-id> <commitHash> → <集成提交>`(降级路径记降级原因),映射(task-id → commitHash → 集成提交)记入该趟流程记录(`<task-id>-SUMMARY.md` / handoff evidence 文本字段);**判级**:审计行是**执行纪律**(review 把关),本节点不声称存在机械门禁校验它。
|
|
96
|
+
4. **冲突处置(两类分别动作)**:**机械冲突**(不改用户可见行为)执行者**可自行解决** + 必须跑**合并后验证**并在审计行记因;**语义冲突**(两侧对同一行为 / 契约 / 接口给出不同语义)**必须中止集成并上抛**(记 BLOCKED + 恢复指引,由协调者 / 用户裁决)——不得由执行者自行拍板。
|
|
97
|
+
|
|
98
|
+
> **要在集成前定规则、或遇冲突 / 降级要判定时读 `../flow-comet/reference/commit-discipline.md`**——四要素的完整判据与 comet 先例在该文件。
|
|
56
99
|
|
|
57
100
|
### Prerequisites
|
|
58
101
|
|
|
@@ -61,15 +104,16 @@ execute 节点**只处理 `parallel="false"`(或未标注 parallel)的 pendi
|
|
|
61
104
|
- `.specs/LESSONS.md` must exist (or be created from template if missing).
|
|
62
105
|
- For frontend/UI tasks: `.specs/<change-id>/UI-DESIGN.md` must exist.
|
|
63
106
|
- 若当前任务的 `<task-id>-PROGRESS.md`(位于 `.specs/<change>/`;与 Recovery 段及归档期 `*-PROGRESS.md` 扫描同口径)存在,必须先读取"已排除方案"段(R1.6 反重复),确认当前计划不在排除列表中。完成后删除该文件,有用信息迁移至 SUMMARY。
|
|
64
|
-
- 委托前按
|
|
107
|
+
- 委托前按 `../flow-comet/reference/dirty-worktree.md` 检查脏工作树(`.specs/<change-id>/` 未提交工件会触发 entry execute 的 WORKTREE WARN;verify 前为自查建议,无 guard 检查)。
|
|
65
108
|
|
|
66
109
|
### Steps(subagent 模式 · 协调者流程,统一委托子代理)
|
|
67
110
|
|
|
68
111
|
对 TASK.md 每个 pending 串行任务,协调者执行:
|
|
69
112
|
|
|
70
113
|
1. **读 task 块,构造 handoff request**:读 `<task>` XML 块(`action` / `read_files` / `write_files` / `verify` / `done`)。若内容有歧义,停下询问——不要猜。构造 handoff request 内容:task 全文 + DESIGN §0/§0.5 + AC + read/write_files 边界。运行 `node .claude/skills/flow-comet/scripts/workflow-handoff.mjs request <task-id>` 记录。**委托即记 request**——直接记录 result 而无对应 request 时,write_files 允许列表为空会被 BLOCKED(新 change 强制委托边界),补 request 后再重录 result 即可(执行者实证)。
|
|
71
|
-
2.
|
|
114
|
+
2. **委托子代理**:按平台通道委托 fresh-context 子代理(三平台同一身份判据,差异只在谁建树;`isolation: "worktree"` 是属性①的可选实现,非强制——见「并行安全四属性契约」)。handoff prompt 强制协议:子代理用 **Skill 工具**加载 flow-comet-dev 并按 `flow-kit/prompts/4-dev.md` 协议执行(TDD RED/GREEN/REFACTOR、LESSONS 扫描、既有抽象 grep、verify、6 维自查、越界检查、原子 commit `<type>(<scope>): <subject>`(scope 推荐可选:子系统短词;禁 change-id/日期作 scope;任务号放提交正文尾注 Task: <task-id>,change-id 不入标题)),按 `flow-kit/templates/SUMMARY.md` 模板写 `.specs/<change-id>/<task-id>-SUMMARY.md`(标题/首部/段序保真,另补 flow-comet 增量 `## 自检方法` 段),回传 Return Contract(含 commitHash + greenEvidence + completedChecks + selfReview)。**SUMMARY 自引用 hash 注**:提交内容无法包含自身 hash——若子代理 amend 提交,SUMMARY 内记录的 commitHash 为 amend 前值属预期(文件集一致即可,以实际提交对象为准)。
|
|
72
115
|
**提交从属规则**:任务专属的 `<task-id>-SUMMARY.md`(位于 `.specs/<change-id>/`,是 flow-comet 强制产物)允许随任务提交属流程默认豁免——目标仓库的既有规定优先,若目标仓库忽略清单等既有规定拒绝其入库,被拒即为正确行为,严禁 force-add 强加越库提交;委托校验对任务摘要的豁免属于校验宽容度,不是入库指令。
|
|
116
|
+
**提交面 pathspec 纪律(五要素,见 Guidance 同名小节)**:handoff prompt 必须要求子代理用 `git add -- <自己字面路径>` + `git commit -- <同一路径>` 提交、锁失败重试、禁裸 `add` / `commit -a` / `stash` / `clean` / `reset`(适用条件:**多个写者共享同一工作区**;各自独立工作区内的局部 `reset` / `clean` 不在禁令内)。**集成纪律(四要素,见 Guidance 同名小节)**:协调者集成时优先 `git merge --no-ff`、降级 `cherry-pick` 记因、顺序按 `depends_on` 拓扑序 + 同层 task id 升序、冲突按机械 / 语义两类分别处置。
|
|
73
117
|
3. **记录 handoff result**:子代理回传后,运行 `node .claude/skills/flow-comet/scripts/workflow-handoff.mjs result <task-id> '<JSON>'` 记录(Return Contract 含 commitHash + greenEvidence + completedChecks + selfReview)。
|
|
74
118
|
4. **验收 SUMMARY,TASK.md 标 done**:确认 SUMMARY 按 `flow-kit/templates/SUMMARY.md` 填写且**模板保真**(标题 `# SUMMARY:` / 首部 4 字段 / 段序一致)、含 `## 自检方法` 段(声明 brooks-review / cache-brooks / builtin-quickcheck 三值之一)、verify 输出真实、6 维自查与越界检查有实质内容;通过后在 TASK.md 将任务标 `status="done"` 并加时间戳。
|
|
75
119
|
5. **下一个 pending 任务**:重复步骤 1-4。
|
|
@@ -107,18 +151,16 @@ This node is truly done when:
|
|
|
107
151
|
|
|
108
152
|
## 修复回路状态机路径
|
|
109
153
|
|
|
110
|
-
review / verify
|
|
154
|
+
review / verify 发现缺陷后的修复**必须回到 `execute` 节点生命周期内完成**,禁止驻留源节点「顺手修完」;路径要点(`<源节点>` = review 或 verify):
|
|
111
155
|
|
|
112
|
-
1. **追加 Fix
|
|
113
|
-
2. **受控归位 execute
|
|
114
|
-
3.
|
|
115
|
-
4.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
- **`next` 回程审计行语义**:回程豁免行始终输出中性 `RETURN: 回程源节点 <源节点>`(源节点产物在场且未出口;保留源节点跑出口),不再输出 FIX-BATCH;受控归位行的 `FIX-BATCH: 归位 <execute 家族>` 保留(真实 Fix 回退行),两者不得混同。
|
|
119
|
-
6. **禁止绕过**:驻留源节点不归位、顺手改完后直接跑源节点 exit 收场会被 BLOCKED(存在未归位/未跑出口的修复回路),必须按上述路径恢复;不得用跳过归位或出口门禁的手段(含手动改写 `.flow-comet/flow-comet-state.json`)替代本路径。
|
|
156
|
+
1. **追加 Fix 任务**:写进 `.specs/<change-id>/TASK.md` 的 `## Fix 任务` 段(完整任务字段),**禁止文件尾追加**;任务集修订必须在 `entry` 之前完成。
|
|
157
|
+
2. **受控归位 execute**:`workflow-state next`(或 `workflow-guard entry execute`)⇒ 引擎把当前节点受控归位为 `execute`(`currentNode=execute`)并输出 `FIX-BATCH` 审计行(`next` 同时输出 `NODE: execute`);用 `status` 确认 `stateCurrentNode` 已是 `execute` 再开工,未归位不得硬开工。
|
|
158
|
+
3. **执行修复 + 跑 execute 四类出口**:按节点生命周期完成全部 Fix 任务(委托 / 直写规则不变)→ `record execute` → `exit execute --apply`——**全任务 done / 逐任务 SUMMARY 完备 / 6 维自查 + 自检方法声明 / 任务集签名一致**,任一缺失即 BLOCKED 并给恢复指引;`entry execute` 刷新并锁定追加后的任务集(**归位后不得再增删任务或改任务内容**);通过后引擎在二次完成时把当前节点推回源节点。
|
|
159
|
+
4. **审计行三态**:真实 Fix 回炉保留 `FIX-BATCH: 回源节点 <源节点>`;正常多趟收尾(签名全等且无 Fix 标记)输出中性 `RETURN: 回源节点 <源节点>`;旧 state 缺闭合 / 修复证据输出 `RETURN: …(旧 state 缺闭合/修复证据,未分类)`——分类只改审计行文本,路由与 state 写入零变化(`RETURN:` 是审计行前缀,与子代理的 Return Contract 无关)。
|
|
160
|
+
5. **回源节点跑出口**:回到源节点后 `next` 应输出 `NODE: review` / `NODE: verify`(不因产物已存在而跳过),随后 `entry <源节点>` → `exit <源节点> --apply`;通过后继续正常路由(必要时进入下一轮 Fix 闭环)。
|
|
161
|
+
6. **禁止绕过**:不归位、顺手改完直接跑源节点 exit 收场、或手改 `.flow-comet/flow-comet-state.json` 一律 BLOCKED——不得用跳过归位 / 出口门禁的手段替代本路径。
|
|
120
162
|
|
|
121
|
-
|
|
163
|
+
> **要判定该不该开修复回路、要受控归位或受控重入、核对归档侧重入边界时读 `../flow-comet/reference/fix-loop.md`**——上述 6 步的完整判据 + 受控重入完整规格(archive 源:`workflow-state.mjs reenter <target> --authorized-by <source> --reason <text>`,每次需用户显式授权、每 change 上限 3 轮、自动落 state 备份、打印 `REENTRY` 审计行)+ 归档侧边界原文在该文件。
|
|
122
164
|
|
|
123
165
|
## Entry Check
|
|
124
166
|
|
|
@@ -20,19 +20,22 @@ description: "flow-kit INTEGRATION 阶段协议:集成验证 + UAT + 失败诊
|
|
|
20
20
|
3. **失败诊断**:root cause → fix-plan → 回到 execute 修复 → 重跑
|
|
21
21
|
- **自动重试 ≤ 3 轮**(R2.6),超限暂停等人工决策
|
|
22
22
|
|
|
23
|
-
### LESSONS 提名(archive
|
|
23
|
+
### LESSONS 提名(archive 前必跑 · 判据单一权威在本册)
|
|
24
24
|
|
|
25
|
-
扫描本次 change 的所有 `*-SUMMARY.md
|
|
25
|
+
扫描本次 change 的所有 `*-SUMMARY.md`(重点「决策与偏差」段)与遗留 `*-PROGRESS.md`(「已排除方案」段),按提名条件逐条筛选:
|
|
26
26
|
- 调试/试错耗时 > 30 分钟 → 提名
|
|
27
|
-
-
|
|
27
|
+
- 错因不限于本任务(其他任务也会撞上)→ 提名
|
|
28
28
|
- 6 个月内有合理概率被再次尝试 → 提名
|
|
29
|
+
- 其余一律不提名(避免污染 `.specs/LESSONS.md`)
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
提名动作:新条目编号 = 当前最大编号 + 1(续 `L-NNN`),插入 `## 条目区` 末尾(文件内升序,继续现有编号)——**禁止文件尾追加与乱序插入**;同时扫既有 active 条目,被本次结论取代 / 废弃的更新其状态。**不归档** `.specs/LESSONS.md`(项目级常驻,跨 change 累积)。
|
|
32
|
+
|
|
33
|
+
> 本段是提名判据的**单一权威**(本册同时是 verify 与 archive 两节点的 Required Skill,判据必然在上下文里);各节点册的同口径表述一律**以本册为准**——同一口径多处表达必分叉。
|
|
31
34
|
|
|
32
35
|
### 归档(archive 阶段)
|
|
33
36
|
|
|
34
37
|
1. `.specs/<change-id>/` → `.specs/archive/<YYYY-MM-DD>-<change-id>/`
|
|
35
|
-
2. `.specs/CHANGELOG.md`
|
|
38
|
+
2. `.specs/CHANGELOG.md` 顶部按日期倒序插入一行——**跟随项目既有格式**(非表格格式同样在顶部插入,不强制转表格;guard 的倒序检测只针对表格格式行)——完整协议见 `flow-comet-archive` 册
|
|
36
39
|
3. **不归档** `.specs/LESSONS.md`(项目级常驻)
|
|
37
40
|
4. DESIGN.md § 9 架构沉淀建议留待 A-evolve 批量同步
|
|
38
41
|
|
|
@@ -134,10 +134,14 @@ Evidence: `intake-summary` (required)
|
|
|
134
134
|
|
|
135
135
|
## Evidence Record
|
|
136
136
|
|
|
137
|
+
Record the node after the artifacts exist and before running the exit (the exit validates the evidence is present). Ask the engine for this node's commands — the printed `record` command carries the platform-correct script path, so there is no copy here to drift:
|
|
138
|
+
|
|
137
139
|
```bash
|
|
138
|
-
node .claude/skills/flow-comet/scripts/workflow-state.mjs
|
|
140
|
+
node .claude/skills/flow-comet/scripts/workflow-state.mjs explain open
|
|
139
141
|
```
|
|
140
142
|
|
|
143
|
+
A good `summary` names what was produced, for example `CHANGE.md + REQUIREMENT.md generated, user confirmed`.
|
|
144
|
+
|
|
141
145
|
## Guardrails
|
|
142
146
|
|
|
143
147
|
| Guardrail ID | Label | Validation Type |
|
|
@@ -17,7 +17,7 @@ Responsibility: 拆原子任务(XML 格式)+ 波次划分。生成 TASK.md
|
|
|
17
17
|
|
|
18
18
|
| 文件 | guard 强制段(缺失 = BLOCKED) | 其余模板段(模板要求,guard 不拦) |
|
|
19
19
|
|------|-------------------------------|-----------------------------------|
|
|
20
|
-
| TASK.md | 至少一个 `<task>` 块 + 每个任务含 `<verify>` 字段
|
|
20
|
+
| TASK.md | 至少一个 `<task>` 块 + 每个任务含 `<verify>` 字段 + 新格式任务的 7 字段在场(集合见本册 `SKILL.md`「必填段清单」表行;单一权威 = `workflow-guard.mjs` 的 `TASK7_REQUIRED` 常量,本文不复述集合) | 任务规模 / 粒度 / 字段内容质量(模板要求,guard 不拦)——**填得好不好**由 review 把关;`id` 是 `<task>` 元素的属性(不是字段:`<task id="T01" parallel="true" status="pending">`) |
|
|
21
21
|
|
|
22
22
|
guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B;「填得好不好」由 review 把关。
|
|
23
23
|
|
|
@@ -19,9 +19,9 @@ Responsibility: 拆原子任务(XML 格式)+ 波次划分。生成 TASK.md
|
|
|
19
19
|
|
|
20
20
|
| 文件 | guard 强制段(缺失 = BLOCKED) | 其余模板段(模板要求,guard 不拦) |
|
|
21
21
|
|------|-------------------------------|-----------------------------------|
|
|
22
|
-
| TASK.md | 至少一个 `<task>` 块 + 每个任务含 `<verify>` 字段
|
|
22
|
+
| TASK.md | 至少一个 `<task>` 块 + 每个任务含 `<verify>` 字段 + 新格式任务的 7 字段在场(`name` / `read_files` / `write_files` / `action` / `verify` / `done` / `depends_on`) | 任务规模 / 粒度 / 字段内容质量(模板要求,guard 不拦)——**填得好不好**由 review 把关 |
|
|
23
23
|
|
|
24
|
-
guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B
|
|
24
|
+
guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B:任务块结构、每任务 `<verify>`、**新格式任务的 7 字段在场**都由 guard 拦(新 change 缺任一 = 出口 BLOCKED;旧格式模板 / 旧 change 渐进 WARN);「填得好不好」——字段内容质量与任务粒度——由 review 把关。
|
|
25
25
|
|
|
26
26
|
> **模板权威**:本节点产出工件的段形唯一权威 = `flow-kit/templates/**`;`.specs/archive/**` 是历史证据、**不是模板来源**——不得以「上一轮就是这么写的」对齐段形。
|
|
27
27
|
|
|
@@ -31,7 +31,7 @@ guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B;「填得好
|
|
|
31
31
|
|
|
32
32
|
**约束本体**:并行任务按依赖关系组织——每个并行任务显式声明 `depends_on`,合法性只取决于依赖图本身:`depends_on` 无环且引用的任务都存在,规划即合法。全并行、全串行、串→并、并→串四种基本形态与任意混排序列(如 `S→P→S`、`P→S→P`)一律放行——引擎按依赖拓扑自动分趟(每趟委托全部依赖已满足的并行任务,趟间回串行消化),混排序列由多趟路由按依赖拓扑自动分趟消化,并行任务的先后位置不受任何限制。
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
**硬性拦截(规划出口 BLOCKED,附恢复指引)**:任务块结构(至少一个 `<task>` 块)/ 每任务 `<verify>` 字段 / 新格式任务的 7 字段在场(集合见上表;新 change 缺任一即 BLOCKED,旧格式模板 / 旧 change 渐进 WARN)/ 任务图依赖环 / 缺失依赖(`depends_on` 引用不存在的任务 id)/ 并行写写冲突(并行任务 `write_files` 重叠)——任一项不成立即在规划出口被 BLOCKED(读写重叠仅 WARN),按提示修正后重新 exit 即可通过。任务间依赖不得成环(如 A→B→A),也不得构成不可满足的依赖链。
|
|
35
35
|
|
|
36
36
|
**警示**:落笔时先画依赖方向再标 [P],避免出口返工。
|
|
37
37
|
|
|
@@ -42,6 +42,7 @@ guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B;「填得好
|
|
|
42
42
|
- **① 同一文件 ⇒ 同一任务**:一个文件只能有一个任务 owner;必须拆分时,在波次划分中显式排序并写明拆分理由与依赖方向,不得把同一文件的两处改动拆成无依赖的两个任务。
|
|
43
43
|
- **② [P] 只给本波确有并发同伴的任务**:`parallel="true"` 仅适用于同波确有其他可并行同伴、且 write_files 互不重叠的任务;孤立任务一律串行——「互不冲突」只是必要条件,不等于应标 `[P]`。
|
|
44
44
|
- **③ [P] × direct 模式**:`[P]` 任务只在 `subagent-execute` 节点委托消化;direct 模式只放行**串行任务**的主代理直写,`parallel="true"` 任务在 direct 下仍必须委托——direct 不是并行任务的逃生口。共享工作区下以 `write_files` 互斥 + 提交时点(提交前 diff 边界)作为并行子代理的相互隔离纪律。
|
|
45
|
+
- **④ 四属性可满足(并行安全的契约对象)**:标 `[P]` 前确认**并行安全四属性**(① 写权限 · ② 提交隔离 · ③ 验证隔离 · ④ 集成纪律)都能满足——worktree 只是「① 写权限」的实现之一,**不是** `[P]` 的前提。四属性的**含义与三平台通道**以入口册「并行委派契约(四属性)· 三平台通道」为单一来源,本节只点名不复述(同一口径两处表达必分叉)。
|
|
45
46
|
|
|
46
47
|
**上游语义显式覆盖**:flow-kit 上游(`flow-kit/prompts/3-task.md` 等 vendored 只读文件)的宽松语义——「无冲突即可标 [P]」「同层即同波并行」——以本节为准(显式覆盖;上游只读,不做修改)。
|
|
47
48
|
|
|
@@ -69,12 +70,11 @@ This node decomposes the technical design into atomic, executable tasks with cle
|
|
|
69
70
|
|
|
70
71
|
3. **Decompose by file conflict (vertical slices)**: Split tasks by file conflict, NOT by horizontal layers. Each task should be a vertical slice (one feature through model/API/UI) not a horizontal layer (all models first, then all APIs). Target: 2-10 minutes per task in fresh context. Do not split one file across tasks; if unavoidable, declare explicit order and reason.
|
|
71
72
|
|
|
72
|
-
4. **Mark parallel tasks with [P]**: only tasks with a genuine concurrent companion in the same wave and non-overlapping write_files get `parallel="true"`; isolated tasks are serial; under direct mode `[P]` tasks are still delegated at subagent-execute.
|
|
73
|
+
4. **Mark parallel tasks with [P]**: only tasks with a genuine concurrent companion in the same wave and non-overlapping write_files get `parallel="true"`; isolated tasks are serial; under direct mode `[P]` tasks are still delegated at subagent-execute. Each `[P]` task must also satisfy the four parallel-safety properties (write permission / commit isolation / verification isolation / integration discipline) — the contract object, with worktree as but one implementation of write permission and never a precondition; the entry SKILL's contract section is the single source for the per-platform channel facts.
|
|
73
74
|
|
|
74
75
|
5. **Declare depends_on**: Each task explicitly declares which tasks it depends on.
|
|
75
76
|
|
|
76
|
-
6. **Populate 7 required fields per task
|
|
77
|
-
- `id`: Format T01, T02, T02-1 etc. Continuous numbering.
|
|
77
|
+
6. **Populate 7 required fields per task** — `name` / `read_files` / `write_files` / `action` / `verify` / `done` / `depends_on` (the exact set the plan exit gate enforces). `id` is **not** one of the seven fields: it is an attribute of the `<task>` element (`<task id="T01" parallel="true" status="pending">`) — format T01, T02, T02-1 etc., continuous numbering. `depends_on` is a field, and its element must be present (write an empty element when the task has no dependency):
|
|
78
78
|
- `name`: One sentence.
|
|
79
79
|
- `read_files`: Files the task is allowed to read. Must include reuse targets from DESIGN 0.5. Supports glob patterns.
|
|
80
80
|
- `write_files`: Files the task is allowed to create/modify/delete. Must NOT include forbidden modules from DESIGN 0.5. Strictly controlled.
|
|
@@ -97,7 +97,7 @@ The full task decomposition protocol, XML template, and constraints are in:
|
|
|
97
97
|
|
|
98
98
|
This node is truly done when:
|
|
99
99
|
- `.specs/<change-id>/TASK.md` exists in XML format.
|
|
100
|
-
- At least one `<task>` block exists; every task carries a `<verify>` field
|
|
100
|
+
- At least one `<task>` block exists; every task carries a `<verify>` field, and the 7-field set `name` / `read_files` / `write_files` / `action` / `verify` / `done` / `depends_on` is present (`id` is an **attribute** of the `<task>` element, not a field) — field **presence** is enforced by the guard (missing any field on a new-format task in a new change = exit BLOCKED; old-format templates / old changes degrade to WARN), while **field content quality** is judged by review.
|
|
101
101
|
- Every `verify` field is an executable command (not a description).
|
|
102
102
|
- Every `write_files` is strictly within DESIGN.md touched + new modules range (not in forbidden list).
|
|
103
103
|
- Every `[P]` mark has a genuine concurrent companion in its wave with non-overlapping `write_files`; isolated tasks are serial (a fully serial plan is valid when no genuine companion exists).
|
|
@@ -160,7 +160,7 @@ node .claude/skills/flow-comet/scripts/workflow-state.mjs record plan '{"summary
|
|
|
160
160
|
| Guardrail ID | Label | Validation Type |
|
|
161
161
|
|--------------|-------|-----------------|
|
|
162
162
|
| `plan-artifacts` | TASK.md exists with XML tasks | artifact-exists |
|
|
163
|
-
| `task-fields-complete` | All tasks have 7 required fields |
|
|
163
|
+
| `task-fields-complete` | All tasks have 7 required fields | 结构在场(新格式任务缺任一字段 = 出口 BLOCKED;旧格式模板 / 旧 change 渐进 WARN)——**字段内容质量**由 review 把关 |
|
|
164
164
|
| `write-files-safe` | No write_files in DESIGN forbidden list | 执行纪律(review 把关),guard 不校验 |
|
|
165
165
|
| `has-parallel` | At least 1 [P] task (if applicable) | 执行纪律(review 把关),guard 不校验 |
|
|
166
166
|
|
|
@@ -128,18 +128,15 @@ This node is truly done when:
|
|
|
128
128
|
|
|
129
129
|
## 修复回路状态机路径
|
|
130
130
|
|
|
131
|
-
review /
|
|
132
|
-
|
|
133
|
-
1. **追加 Fix
|
|
134
|
-
2. **受控归位 execute
|
|
135
|
-
3.
|
|
136
|
-
4.
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
6. **禁止绕过**:驻留源节点不归位、顺手改完后直接跑源节点 exit 收场会被 BLOCKED(存在未归位/未跑出口的修复回路),必须按上述路径恢复;不得用跳过归位或出口门禁的手段(含手动改写 `.flow-comet/flow-comet-state.json`)替代本路径。
|
|
141
|
-
|
|
142
|
-
**由受控重入打开的场景(archive 源)**:缺陷在归档后才暴露、且归档移动尚未发生时,可先由用户显式授权把工作归属退回 `execute` / `subagent-execute` / `review` / `verify` 之一,再按本节路径回到 execute 生命周期完成修复。重入命令:`node .claude/skills/flow-comet/scripts/workflow-state.mjs reenter <target> --authorized-by <source> --reason <text> [--continue-round <n>]`——每次调用都需要用户显式授权,每 change 上限 3 轮(达上限后凭显式续轮授权 `--continue-round <n>`(n ≥ 已用轮次 + 1)可继续并计入下一轮);重入前自动落 state 备份快照(`.specs/<change-id>/.reentry-backups/`);成功打印 `REENTRY: archive → <target>(授权源 <source>;第 n/3 轮;备份 <file>)` 与 `REASON: <text>` 行(续轮审计行为 `第 n 轮(显式授权续轮,上限 3)`),与 Fix 回炉的 `FIX-BATCH` 行、正常多趟收尾的 `RETURN` 行三态可区分。归档移动已发生或 change 已 `completed` 时重入 BLOCKED,须走人工处置或新 change,不得静默跳过。重入只改工作归属,不写任何闭合标记,也不跳过目标节点入口 / 出口与源节点出口门禁;重复调用同一目标为空操作(输出 `REENTRY: 空操作——…`,不备份、不计数、不改写 state)。
|
|
131
|
+
review 发现 Critical / Major 后的修复必须回到 `execute` 节点生命周期内完成——**禁止驻留源节点「顺手修完」**(会被 BLOCKED)。要点:
|
|
132
|
+
|
|
133
|
+
1. **追加 Fix 任务**:把修复任务(完整任务字段)追加到 `.specs/<change-id>/TASK.md` 的 `## Fix 任务` 段内,**禁止文件尾追加**;任务集修订须在 `entry` 之前完成。
|
|
134
|
+
2. **受控归位 execute**:跑 `workflow-state next` 或 `workflow-guard entry execute` 触发受控归位(审计行 `FIX-BATCH: 归位`;`next` 同时输出 `NODE: execute`);用 `status` 确认 `stateCurrentNode` 已是 `execute` 再开工,未归位不得硬开工。
|
|
135
|
+
3. **跑完 execute 四类出口**:`record execute` → `exit execute --apply`——全任务 done / 逐任务 SUMMARY 完备 / 6 维自查 + 自检方法声明 / 任务集签名一致,任一缺失即 BLOCKED;通过后引擎把当前节点推回 review。
|
|
136
|
+
4. **回源节点跑出口**:回到源节点后跑该节点出口门禁(`entry <源节点>` → `exit <源节点> --apply`),通过后继续 review → verify 的正常路由,必要时进入下一轮 Fix 闭环。
|
|
137
|
+
5. **禁止绕过**:驻留源节点不归位、顺手改完后直接跑源节点 exit 收场会被 BLOCKED;不得用跳过归位或出口门禁的手段(含手动改写 `.flow-comet/flow-comet-state.json`)替代本路径。
|
|
138
|
+
|
|
139
|
+
**何时读完整规格**:要核对完整判据——Fix 任务与任务集签名的时序、受控归位的完整判定条件、`FIX-BATCH` / `RETURN` 审计行三态语义与回源节点的回程豁免、绕过的失败面与恢复指引——读 `../flow-comet/reference/fix-loop.md`(**当你 review 发现缺陷、要开修复回路把工作退回 execute 生命周期时读它**)。
|
|
143
140
|
|
|
144
141
|
## Entry Check
|
|
145
142
|
|
|
@@ -15,12 +15,23 @@ Responsibility: 委托 [P] 并行任务给子代理,要求加载 flow-comet-de
|
|
|
15
15
|
|
|
16
16
|
职责分工(趟次协作):本节点负责**并行委托**(`parallel="true"` 且依赖已满足的任务,同一趟内同时发出)——委托节点可多次往返:每趟委托当时全部依赖已满足的并行任务,趟间由 execute 节点串行消化,直至不存在依赖已满足的可并行 pending 且无串行残留。execute 节点负责**串行委托**(非 parallel 任务,一次一个)。两者共用同一委托证据库(handoff 记录在 subagent-execute evidence)。序列形态不是本节点的关注点:全并行、全串行、串→并、并→串及任意混排均合法(合法性只取决于 `depends_on` 无环且引用存在;依赖环与缺失依赖已在 plan 出口拦截并附恢复指引),到达本节点的任务序列由多趟路由按依赖拓扑自动分趟消化。
|
|
17
17
|
|
|
18
|
-
>
|
|
19
|
-
>
|
|
20
|
-
>
|
|
21
|
-
>
|
|
22
|
-
>
|
|
23
|
-
>
|
|
18
|
+
> **平台事实与判级口径(证据与过程记录)**:Codex 原生多代理 `multi_agent` 为 stable、默认启用,「Codex 不能委派 / 不使用并行委托」**不是平台事实**——该**机制缺口**已由身份分派(载荷 `agent_id`)关闭(**三平台均可并行委派,差异只在谁建树**);三平台通道对照表、逐平台载荷字段与判级口径(证实 / 推翻 / 未覆盖)、已知边界、旧结论留档、headless 子面实测订正见 `../flow-comet/reference/platform-facts.md`:**要判定某平台的能力边界、或要引用某条平台结论时读它。**
|
|
19
|
+
> **并行安全四属性契约**:契约对象是**四属性**,不是 worktree——`worktree` 只是属性①「写权限」的**实现之一**,不是契约本身;「一律 worktree」的口号已作废(本仓决策:契约对象 = 四属性,worktree 降为实现之一)。三平台在同一判据下平行对等,**唯一差异是「谁建树」**。
|
|
20
|
+
>
|
|
21
|
+
> | # | 属性 | 含义 | 满足形态 |
|
|
22
|
+
> |---|------|------|----------|
|
|
23
|
+
> | ① | **写权限** | 每个写者必须有一条被守卫认可的写入通道 | **身份分派**(CC / Codex 载荷含 `agent_id` ⇒ 子代理语义;dsh 桥接以环境变量 `FLOW_COMET_AGENT_DEPTH` 透传正整数身份深度,**并同时注入桥接通道标记 `FLOW_COMET_AGENT_DEPTH_SOURCE`——守卫要求标记与深度同时在场才接受该通道**)——**worktree 只是本属性的实现之一**,不是必须;**最小保护集除外**:身份在场时 `.flow-comet/flow-comet-state.json` 与 `../flow-comet/reference/workflow-protocol.json` 仍受拦(三平台一致 BLOCKED) |
|
|
24
|
+
> | ② | **提交隔离** | 提交只含自己 `write_files` 的字面路径 | 提交面 pathspec 纪律五要素(见 Guidance 同名小节) |
|
|
25
|
+
> | ③ | **验证隔离** | 同一时刻只有一个写者:全量判据不得与在飞写者并行 | 出口校验锚 = `handoffRequests` 有 request 无对应 `handoffResult` ⇒ 新 change BLOCKED / 旧 change WARN;全部有 result ⇒ 放行;无证据 ⇒ 零输出(**已撤回的 request 不构成在飞委托**:`workflow-handoff.mjs withdraw <task-id> --by <来源>` 在原记录上留痕 `withdrawnAt` + `withdrawnBy`,已撤回 = 终态、历史不删) |
|
|
26
|
+
> | ④ | **集成纪律** | 机制选择 / 顺序 / 审计 / 冲突处置四项均有明文规则 | 集成纪律四要素(见 Guidance 同名小节) |
|
|
27
|
+
>
|
|
28
|
+
> **写面含 gitignored 面的任务(四属性映射 · 与其他任务同一判据)**:任务 `write_files` 全为 gitignored 字面路径时,四属性的满足方式不变——① **写权限**仍走**身份通道**(载荷 `agent_id` / 环境变量身份深度 ⇒ 子代理语义放行,项目内任意路径可写(含 gitignored);gitignored 只是路径属性,不是通道差异);② **提交隔离**走既有 **`noCommit` 资格**(request 按 `.gitignore` 命中记 `noCommit:true` ⇒ 任务零提交,「提交只含自己 `write_files` 的字面路径」由**无提交**满足,不是放宽校验;资格 fail-closed:glob / `..` 越界 / 非 git 仓 / tracked 文件 / 链接逃逸一律不授予,result 时刻按同一判据重验,失败即撤销资格);③④ 与其他任务同形(同一时刻单写者 + 集成四要素)。**并行 × 零提交**因此合法:任务可标 `parallel="true"` 并被并行委派,出口校验按 request 的 `noCommit` 资格豁免缺 `commitHash`。
|
|
29
|
+
> **留痕的边界(诚实声明 · 与 `directOverride` / `completedChecks` / `reentryAuthorization` 同族)**:留痕记录的是「**发生过委派**」,**不是**对执行者身份的物理证明——`handoffRequests` / `handoffResult` 只证明协调者写下过 request 与 result 两条记录,不证明写入确实由子代理完成;与 `completedChecks` 只能记录声明、`directOverride` 只能记录授权、`reentryAuthorization` 只能记录授权源同理。声明与事实不符属流程违规,验收以 transcript 可见的委派触发为准。
|
|
30
|
+
>
|
|
31
|
+
> **dsh 平台委托方式(实测核对)**:dsh 的子代理是平台**进程内子代理**(不创建独立工作区)——写入守卫按**会话身份分派**:桥接**不再短路**,而是把身份深度以环境变量 `FLOW_COMET_AGENT_DEPTH` **连同通道标记 `FLOW_COMET_AGENT_DEPTH_SOURCE`** 透传给守卫(**身份与最小保护集的整条判定统一由守卫拥有**,单一实现;守卫要求标记与深度同时在场才接受该通道——CC / Codex 生成的 hook 直接调守卫、不走桥接,继承来的深度变量不构成身份);身份深度为正整数 ⇒ 放行(**最小保护集除外**)、**项目内任意路径可写(含 gitignored)**,因此**无需隔离区**;直接委托即可,不需要 worktree(**无需隔离区 ≠ 无需边界**:`write_files` 互斥与提交时点纪律仍是硬前置)。**通用边界**:同一工作区内的并行子代理会看到彼此未提交的中间态——任务的 `write_files` 边界与提交时点即相互隔离纪律(本节点第 1 步的 write_files 互斥检查因此仍是硬前置)。
|
|
32
|
+
>
|
|
33
|
+
> **受支持路径(三平台同一判据,差异只在谁建树)**:① **CC 平台**——直接委托子代理(守卫按身份分派放行);`Agent` 工具的 `isolation: "worktree"` 是属性①的一种实现(**非强制**,见步骤 3);② **dsh 平台**——直接委托平台进程内子代理(守卫按身份分派放行,**无需隔离区**;保持 `write_files` 边界与提交时点纪律);③ **Codex 平台**——直接委托原生子代理(`spawn_agent` 等,守卫按身份分派放行;默认共享工作区,保持 `write_files` 边界与提交时点纪律)。**建树选择的适用面**:协调者显式 `git worktree add <路径>`(手工建树)**是受支持的建树选择**——在委派 prompt 里指定 `workdir`,写入由身份通道放行(原生子代理无自动建树);**以建树绕过边界**不受支持——用独立树规避协调者禁令 / 最小保护集 / `write_files` 互斥与提交时点纪律 / handoff 与 Return Contract 证据,或把 worktree 当作四属性的替代品。headless 子面实测见 `../flow-comet/reference/platform-facts.md`(仅 `codex exec`,不得外推)。
|
|
34
|
+
> **不提供/不使用规避通道**:绕开守卫命令级检测的写法(如用 Python `open()` 等 File API 直写)**不是受支持路径**——它绕过的是写入防线本身(防线失效时无拦截、无记录),与三层防御的设计相反。需要越出边界时一律走上面的受支持路径,或如实上报 BLOCKED,**不得以更换工具形态绕过**。handoff 记录(workflow-handoff request/result)与 Return Contract 校验机制不变。
|
|
24
35
|
|
|
25
36
|
## Guidance
|
|
26
37
|
|
|
@@ -44,7 +55,7 @@ guard 校验见 workflow-guard.mjs NODE_TRANSITION_GATES / W1-B;「填得好
|
|
|
44
55
|
|
|
45
56
|
## Node Goal
|
|
46
57
|
|
|
47
|
-
This node parallelizes execution by delegating independent tasks (marked `parallel="true"` in TASK.md) to separate subagents. Each subagent loads the full `flow-comet-dev` protocol and operates within its task's `read_files`/`write_files` boundaries. This node produces handoff evidence for each delegated task and marks them done in TASK.md after all subagents complete. It exists to exploit parallelism when tasks have no file conflicts.
|
|
58
|
+
This node parallelizes execution by delegating independent tasks (marked `parallel="true"` in TASK.md) to separate subagents. Each subagent loads the full `flow-comet-dev` protocol and operates within its task's `read_files`/`write_files` boundaries. This node produces handoff evidence for each delegated task and marks them done in TASK.md after all subagents complete. It exists to exploit parallelism when tasks have no file conflicts. All three platforms (Claude Code / Codex / dsh) can delegate in parallel under one identity-based criterion; the only difference is who creates the tree (Claude Code may create one via `isolation: "worktree"`; Codex and dsh share the workspace). The contract object is the four parallel-safety attributes — worktree isolation is one optional implementation of attribute ①, not a requirement (see the four-attribute contract and the platform channel table above).
|
|
48
59
|
|
|
49
60
|
Division of labor (pass-based collaboration): this node handles parallel delegation (`parallel="true"` tasks whose dependencies are satisfied — all of them dispatched concurrently within a pass) and may be entered multiple times across passes: each pass delegates every currently eligible parallel task, serial tasks are digested by the `execute` node between passes, and the node counts as complete only when no dependency-satisfied parallel task and no serial task remains. The `execute` node handles serial delegation (non-parallel tasks, one at a time). Both share the same delegation evidence library (handoff recorded under subagent-execute evidence). Sequence shape is not this node's concern: all-parallel, all-serial, serial→parallel, parallel→serial, and any mixed interleaving are all legal (legality depends only on an acyclic `depends_on` graph whose references all exist; cycles and missing dependencies are already intercepted at the plan exit with recovery guidance), and any sequence reaching this node is digested pass by pass by multi-pass routing along the dependency topology.
|
|
50
61
|
|
|
@@ -52,27 +63,56 @@ Division of labor (pass-based collaboration): this node handles parallel delegat
|
|
|
52
63
|
|
|
53
64
|
### 协调者禁令(最高优先级)
|
|
54
65
|
|
|
55
|
-
|
|
66
|
+
主会话是协调者,不是执行者。禁止在主会话直接修改源码或执行实现。源码只能委托子代理完成,**委托形态按平台(差异只在谁建树)**:**CC = 直接委托子代理**(`isolation: "worktree"` 是属性①的可选实现,非强制);**dsh = 直接委托平台进程内子代理(无需隔离区;无需隔离区 ≠ 无需边界)**;**Codex = 直接委托原生子代理(`spawn_agent` 等,默认共享工作区)**——三平台同一身份判据放行,见上方「并行安全四属性契约」;三平台通道对照表与平台判级口径见 `../flow-comet/reference/platform-facts.md`。子代理派发失败时,主会话**不得接管实现**——记录当前任务为 BLOCKED 并走 Recovery。协调者只允许更新:TASK.md(标记 done)、`<task>-SUMMARY.md`、handoff evidence(workflow-handoff.mjs result)。
|
|
67
|
+
|
|
68
|
+
### 提交面 pathspec 纪律(要点 · 全文见 `../flow-comet/reference/commit-discipline.md`)
|
|
69
|
+
|
|
70
|
+
**适用条件**:并发写者共处一个工作树时(CC 非 worktree 委托 / Codex 共享工作区 / dsh 进程内子代理)本条生效;**各自独立工作区(worktree 等)内的局部 `reset` / `clean` 不在禁令内**——但只要本趟有**任一**共享工作区的写者,本条即覆盖整个并行趟。
|
|
71
|
+
|
|
72
|
+
五要素(缺一不可):
|
|
73
|
+
|
|
74
|
+
1. **`git add -- <自己字面路径>`**:逐条字面路径(取自本任务 `write_files`),禁用 `.` / `-A` / `-u` 等宽泛形态。
|
|
75
|
+
2. **`git commit -- <同一路径>`**:路径集与上一步**逐字一致**——提交只含自己的文件。
|
|
76
|
+
3. **锁失败重试**:并发提交会撞 `index.lock` / `cannot lock ref`,**失败即重试**,不得因此改用宽泛命令。
|
|
77
|
+
4. **禁裸 `add` / `commit -a` / `stash` / `clean` / `reset`**:它们作用于整个共享工作区。
|
|
78
|
+
5. **为什么**:并发写者共享**同一索引与工作树**,宽泛命令有**并发索引竞态**(把同伴半成品纳入自己的提交),`stash` / `clean` / `reset` 还会直接破坏同伴的未提交工作。
|
|
79
|
+
|
|
80
|
+
**并行波次另加两条**:禁用 `git commit --amend`(HEAD 会被并行写者推进——确需修正必须**先断言 `git rev-parse HEAD` 等于自己刚提交的哈希**,否则改用**新提交追加**);**误改后的自救通道**是第 4 条的定向例外——先断言 HEAD 即被误改的那次提交,再 `git reset --soft <自己的父提交>`(**只用 `--soft`**),最后以 **pathspec** 重建自己的提交;**无合法修复通道时人会暗改**(见 ADR-013 记录的同型教训)。
|
|
81
|
+
|
|
82
|
+
> **要判定提交边界、撞上锁或误改要收拾时读 `../flow-comet/reference/commit-discipline.md`**:五要素逐条判据、命令完整形态与实测依据在该文件。
|
|
83
|
+
|
|
84
|
+
### 集成纪律(要点 · 全文见 `../flow-comet/reference/commit-discipline.md`)
|
|
85
|
+
|
|
86
|
+
四要素:
|
|
87
|
+
|
|
88
|
+
1. **机制选择**:优先 **`git merge --no-ff`**(保留父子关系、可审计;comet 先例:集成用 `--no-ff`、交付用 `--ff-only`);冲突难解时**降级 `git cherry-pick` 并强制记因**。
|
|
89
|
+
2. **顺序(确定性规则)**:按 `depends_on` 的**拓扑序**(被依赖者先入),同一拓扑层内按 **task id 升序**——**不得依赖书写顺序** / 提交到达顺序 / 完成先后等运行期不确定量。
|
|
90
|
+
3. **审计留痕**:每次集成输出一行 `INTEGRATE: <task-id> <commitHash> → <集成提交>`(降级路径记降级原因),映射记入该趟流程记录;**判级**:审计行是**执行纪律**(review 把关),本节点不声称存在机械门禁校验它。
|
|
91
|
+
4. **冲突处置(两类分别动作)**:**机械冲突**(不改用户可见行为)执行者**可自行解决**,解决后必须跑**合并后验证**并在审计行记因;**语义冲突**(两侧对同一行为 / 契约 / 接口给出不同语义)**必须中止集成并上抛**(记 BLOCKED + 恢复指引,由协调者 / 用户裁决)——**不得**由执行者自行拍板。
|
|
92
|
+
|
|
93
|
+
> **要在集成前定规则、或遇冲突 / 降级要判定时读 `../flow-comet/reference/commit-discipline.md`**:四要素的完整判据与 comet 先例在该文件。
|
|
56
94
|
|
|
57
95
|
### 受控重入打开的修复场景(archive 源)
|
|
58
96
|
|
|
59
|
-
缺陷在归档后才暴露、且归档移动尚未发生时,可先由用户显式授权把工作归属退回本节点或 `execute` / `review` / `verify
|
|
97
|
+
缺陷在归档后才暴露、且归档移动尚未发生时,可先由用户显式授权把工作归属退回本节点或 `execute` / `review` / `verify`,再按常规委托与出口流程完成修复。命令:`node .claude/skills/flow-comet/scripts/workflow-state.mjs reenter <target> --authorized-by <source> --reason <text> [--continue-round <n>]`。要点:**每次调用都需要用户显式授权**(不得由执行者自决);每 change 上限 3 轮,达上限后凭 `--continue-round <n>`(n ≥ 已用轮次 + 1)显式续轮;重入前自动落 state 快照(`.specs/<change-id>/.reentry-backups/`);成功打印 `REENTRY:` 行与 `REASON: <text>` 行(与 `FIX-BATCH` / `RETURN` 行三态可区分)。归档移动已发生或 change 已 `completed` ⇒ 重入 BLOCKED(走人工处置或新 change,**不得静默跳过**);重入只改工作归属——不写闭合标记、不跳过本节点入口 / 出口门禁,重入后仍按本节点常规流程校验委托证据与 write_files 边界。
|
|
98
|
+
|
|
99
|
+
> **要核对授权留痕 / 轮次与续轮审计 / 备份指纹 / 归档侧重入边界时读 `../flow-comet/reference/fix-loop.md`**:受控重入的完整规格在该文件。
|
|
60
100
|
|
|
61
101
|
### Prerequisites
|
|
62
102
|
|
|
63
103
|
- `.specs/<change-id>/TASK.md` must exist with at least one task marked `parallel="true"` and `status="pending"`.
|
|
64
104
|
- `.specs/<change-id>/DESIGN.md` or `DESIGN-lite.md` must exist.
|
|
65
105
|
- `.specs/LESSONS.md` must exist (or be created).
|
|
66
|
-
- Delegation capability, split by platform: **Claude Code** requires the `Agent` tool (
|
|
106
|
+
- Delegation capability, split by platform: **Claude Code** requires the `Agent` tool (subagents are delegated with it; `isolation: "worktree"` is one optional implementation of attribute ①, not a requirement); **dsh** requires the platform's in-process delegation capability (subagents carry an identity depth > 0, share the workspace, and need no isolation directory); **Codex** requires the platform's native multi-agent capability (real, stable and default-enabled — its regular usage is the interactive CLI — and its subagents share the workspace by default). All three platforms delegate under the same identity criterion (payload `agent_id` for Claude Code / Codex; the bridge-forwarded identity signal for dsh), so the only difference is who creates the tree. A manually created `git worktree` **is a supported tree-creation choice** (see the "受支持路径" section above): point the delegation prompt at its `workdir` and the write is admitted through the identity channel (native subagents do not create a tree automatically). What is **not** supported is **using a tree to bypass the boundaries** — evading the coordinator prohibition / the minimum protection set / `write_files` mutual exclusion and commit-timing discipline / handoff and Return Contract evidence, or treating the worktree as a substitute for the four attributes.
|
|
67
107
|
|
|
68
108
|
### Steps
|
|
69
109
|
|
|
70
|
-
0.
|
|
71
|
-
- ① `git status --short`:change 工件(`.specs/<change-id>/`)**必须已 commit
|
|
110
|
+
0. **委托前检查清单(必做——走 worktree 隔离形态时,未 commit 的工件不会被 worktree 子代理看到,曾导致子代理空上下文运行)**:
|
|
111
|
+
- ① `git status --short`:change 工件(`.specs/<change-id>/`)**必须已 commit**——**走 worktree 隔离形态时**(CC `isolation: "worktree"`),未 commit 的工件对 worktree 子代理不可见(harness 从已提交 HEAD 创建 worktree);共享工作区形态(CC 非 worktree 委托 / Codex / dsh)无此限制,但**内联上下文仍是推荐做法**
|
|
72
112
|
- ② `git log --oneline -1`:确认 HEAD 位置(change 分支)
|
|
73
|
-
- ③ 委托 prompt **必须内联任务块全文 + 相关 AC**(worktree 基线可能不是 change 分支——harness
|
|
113
|
+
- ③ 委托 prompt **必须内联任务块全文 + 相关 AC**(worktree 基线可能不是 change 分支——harness 行为不可控;共享工作区形态虽可见工件,内联仍是唯一可靠路径)
|
|
74
114
|
- ④ **子代理会话 Skill 工具可用性(委托前探测)**:委托 prompt 必须要求子代理开工前确认本会话是否具备 Skill 工具——具备时用 Skill 工具加载 `flow-comet-dev`;不可用时按 Read 加载节点 SKILL + `flow-kit/prompts/4-dev.md` 协议执行,并在 Return Contract 回传 `"skillToolFallback": "<降级替代形态,如 file-read>"`(SUMMARY「自检方法」段同步声明该替代形态并注明未执行 Skill 工具注入)。**禁止把 Read 声称为已注入**;委托 prompt 未写明该口径 = 委托前检查未完成,不得发出委托
|
|
75
|
-
- **Red Flag**:worktree
|
|
115
|
+
- **Red Flag**:worktree 工件不可见 / 基线不确定时**禁止继续委托**——先 commit 或内联上下文
|
|
76
116
|
- 委托后:子代理回报 commitHash 后校验存在性(`git cat-file -e <commitHash>`,workflow-handoff result 已有 W2-D git show 校验兜底)
|
|
77
117
|
|
|
78
118
|
1. **Identify parallel tasks**: Read TASK.md and find all tasks with `parallel="true"` and `status="pending"`. Verify they are genuinely independent (no file conflicts between them — check `write_files` do not overlap).
|
|
@@ -91,7 +131,10 @@ Division of labor (pass-based collaboration): this node handles parallel delegat
|
|
|
91
131
|
- Instruction to produce `<task-id>-SUMMARY.md` in `.specs/<change-id>/` following the `flow-kit/templates/SUMMARY.md` template(标题/首部/段序保真,另补 flow-comet 增量 `## 自检方法` 段)。
|
|
92
132
|
- **提交边界警告**:提交**只含该任务 write_files 范围内的文件**(含测试文件)——不得包含 TASK.md 与其他协调者维护的 .specs 工件(新 change 提交越界 BLOCKED;实测子代理提交含 TASK.md 被 W2-D 拦截)。**提交从属规则**:任务专属的 `<task-id>-SUMMARY.md`(位于 `.specs/<change-id>/`,是 flow-comet 强制产物)允许随任务提交属流程默认豁免——目标仓库的既有规定优先,若目标仓库忽略清单等既有规定拒绝其入库,被拒即为正确行为,严禁 force-add 强加越库提交;委托校验对任务摘要的豁免属于校验宽容度,不是入库指令。
|
|
93
133
|
|
|
94
|
-
|
|
134
|
+
- **提交面 pathspec 纪律(五要素,见 Guidance 同名小节)**:子代理必须用 `git add -- <自己字面路径>` + `git commit -- <同一路径>`,锁失败重试,禁裸 `add` / `commit -a` / `stash` / `clean` / `reset`(适用条件:**多个写者共享同一工作区**;各自独立工作区内的局部 `reset` / `clean` 不在禁令内)。
|
|
135
|
+
- **集成纪律(四要素,见 Guidance 同名小节)**:协调者集成时优先 `git merge --no-ff`;降级 `cherry-pick` 必须记因;集成顺序按 `depends_on` 拓扑序 + 同层 task id 升序;冲突按**机械冲突 / 语义冲突**两类分别处置(后者必须中止并上抛)。
|
|
136
|
+
|
|
137
|
+
3. **Delegate to subagents**(三平台同一判据,差异只在谁建树): **Claude Code 平台**:直接委托子代理——守卫按**身份判据优先于路径判据**放行(载荷含 `agent_id` ⇒ 子代理语义);`Agent` 工具的 `isolation: "worktree"` 是属性①的一种实现(**可选,非强制**,见「并行安全四属性契约」);`.claude/worktrees/**` 路径前缀通道仍为兼容通道。**dsh 平台**:直接委托平台进程内子代理——守卫按会话身份分派(身份深度为正整数 ⇒ 放行(**最小保护集除外**)、项目内任意路径可写(含 gitignored)),**无需隔离区**;同一工作区的并行子代理会看到彼此未提交中间态,靠 `write_files` 边界互斥与提交时点作相互隔离纪律(**无需隔离区 ≠ 无需边界**)。**Codex 平台**:直接委托原生子代理(`spawn_agent` 等)——守卫按身份分派放行(真机实测:载荷含 `agent_id` / `agent_type`);默认**共享工作区**,同样靠 `write_files` 边界互斥与提交时点纪律。**建树选择的适用面**:协调者显式 `git worktree add <路径>`(手工建树)**是受支持的建树选择**——在委派 prompt 里指定 `workdir`,写入由身份通道放行(原生子代理无自动建树);**以建树绕过边界**不受支持——用独立树规避协调者禁令 / 最小保护集 / `write_files` 互斥与提交时点纪律 / handoff 与 Return Contract 证据,或把 worktree 当作四属性的替代品。**不得用 File API 直写等规避通道代替**(绕过写入防线不是受支持路径)。Each subagent (all three platforms):
|
|
95
138
|
- Reads TASK.md for its specific task block.
|
|
96
139
|
- Executes the full TDD protocol (RED/GREEN/REFACTOR). **纯文档/纯配置任务无生产代码可测时,`redEvidence` 与 `greenEvidence` 均允许 `{"command":"N/A (non-code task)","output":"..."}` 形态**(guard W1-D 接受此形状;不得伪造测试输出)。
|
|
97
140
|
- Greps existing abstractions (R6.4).
|
|
@@ -164,7 +207,7 @@ node .claude/skills/flow-comet/scripts/workflow-guard.mjs entry subagent-execute
|
|
|
164
207
|
|
|
165
208
|
## Skill Implementation
|
|
166
209
|
|
|
167
|
-
The subagent-execute node identifies all `parallel="true"` pending tasks in TASK.md, creates handoff requests via `workflow-handoff.mjs`, and delegates each to
|
|
210
|
+
The subagent-execute node identifies all `parallel="true"` pending tasks in TASK.md, creates handoff requests via `workflow-handoff.mjs`, and delegates each to a fresh-context subagent (identity-based write channel on all three platforms; worktree isolation is one optional implementation of attribute ①) with `flow-comet-dev` loaded. Each subagent executes the full dev protocol independently, follows the commit-pathspec discipline (five elements) and the integration discipline (four elements) recorded above, and the orchestrator collects evidence and marks tasks done after all subagents complete.
|
|
168
211
|
|
|
169
212
|
## Required Skill Calls
|
|
170
213
|
|
|
@@ -20,9 +20,10 @@ description: "flow-kit TASK 阶段协议:拆原子任务(XML 格式)、rea
|
|
|
20
20
|
- 并行标记 `[P]`:只给本波确有并发同伴、且 write_files 互不重叠的任务;孤立任务一律串行——「互不冲突」只是必要条件,不等于应标 `[P]`
|
|
21
21
|
- **同一文件 ⇒ 同一任务**:一个文件只能有一个任务 owner;必须拆分时,在波次划分中显式排序并写明拆分理由与依赖方向,不得把同一文件的两处改动拆成无依赖的两个任务
|
|
22
22
|
- **[P] × direct 模式**:`[P]` 任务只在 `subagent-execute` 节点委托消化;direct 模式只放行串行任务的主代理直写,`parallel="true"` 任务在 direct 下仍必须委托——direct 不是并行任务的逃生口;共享工作区以 `write_files` 互斥 + 提交时点(提交前 diff 边界)作为相互隔离纪律
|
|
23
|
-
-
|
|
23
|
+
- **四属性可满足(并行安全契约)**:标 `[P]` 的任务须确认**并行安全四属性**(① 写权限 · ② 提交隔离 · ③ 验证隔离 · ④ 集成纪律)可满足——worktree 只是「① 写权限」的实现之一,不是前提;四属性的**含义与三平台通道**以入口册「并行委派契约(四属性)· 三平台通道」为单一来源,本册只点名不复述
|
|
24
|
+
- 波次形态:依赖驱动多趟语义——每个并行任务显式声明 `depends_on`(后波依赖前波任务),引擎按依赖拓扑自动分趟消化(每趟委托全部依赖已满足的并行任务,趟间回串行),混排序列(串→并→串/并→串→并等交错形态)合法,无需压扁成单一串行段;硬性拦截(规划出口 BLOCKED,附恢复指引):任务块结构(至少一个 `<task>` 块)/ 每任务 `<verify>` 字段 / 新格式任务的 7 字段在场(集合见第 3 条;新 change 缺任一即 BLOCKED,旧格式模板 / 旧 change 渐进 WARN)/ 任务图依赖环 / 缺失依赖(`depends_on` 引用不存在的任务 id)/ 并行写写冲突(并行任务 `write_files` 重叠)——任一项不成立即被拦(读写重叠仅 WARN),修正后重新 exit 即可通过;跳过未满足依赖先跑并行同样被拦。落笔时先画依赖方向再标 [P]。flow-kit 上游模板未载此约束,以本条为准
|
|
24
25
|
- 依赖:`depends_on: <task-id>`
|
|
25
|
-
3. **每任务 7 字段**:
|
|
26
|
+
3. **每任务 7 字段**:name / read_files / write_files / action / verify / done / depends_on——与 plan 出口「新格式任务的 7 字段在场」判据同一集合;`id` **不是字段**,它是 `<task>` 元素的属性(`<task id="T01" parallel="true" status="pending">`);`depends_on` 元素必在(无依赖写空元素)
|
|
26
27
|
- **write_files 必须包含关联测试文件**:若任务修改组件/函数,且有关联测试直接 import 其本地导出(如 `src/**/__tests__/*.test.ts` 从组件文件 import),该测试文件**必须纳入该任务 write_files**。否则组件删除本地导出/改 import 后,关联测试会编译失败或断言失效(实测:改组件时破坏了关联测试文件)。
|
|
27
28
|
4. **波次划分**:跨层顺序;同层任务只有确有并发同伴、且 write_files 互不重叠时才标 [P],孤立任务一律串行;flow-kit 上游宽松语义(「无冲突即可标 [P]」「同层即同波并行」)以本节点为准(显式覆盖,vendored 只读不改)
|
|
28
29
|
5. **XML 格式**:便于 AI 解析与执行
|
|
@@ -13,7 +13,7 @@ description: "flow-kit 2a UI-DESIGN 阶段协议:美学方向 + design tokens
|
|
|
13
13
|
|
|
14
14
|
## 关键检查
|
|
15
15
|
|
|
16
|
-
- `flow-kit/reference/ui-anti-patterns.md`(
|
|
16
|
+
- `flow-kit/reference/ui-anti-patterns.md`(111 行 · 77 非空行,可全读)
|
|
17
17
|
- `flow-kit/reference/ui-aesthetics.md`(仅查「5 维度」+ 「给 AI 的模板」节)
|
|
18
18
|
- 装了 ui-ux-pro-max / impeccable 时优先用它们
|
|
19
19
|
|
|
@@ -31,7 +31,7 @@ description: "flow-kit 2a UI-DESIGN 阶段协议:美学方向 + design tokens
|
|
|
31
31
|
| 段在场,无**结构形态**的「不适用」标记 | 前端 change | 必须加载本技能并产出 `.specs/<change-id>/UI-DESIGN.md` |
|
|
32
32
|
| 段缺席 | 非前端 change | 同上按非前端处理——但缺席不留可读证据,故约定保留段并以结构形态标注「不适用」(见 `flow-comet-change` 的标记约定) |
|
|
33
33
|
|
|
34
|
-
**「结构形态」的三种任一**(与引擎判据同口径):标记**独立行**、居**行首**(可带列表符号 / 引用 / 加粗),或写在适用性类标签(`适用性` / `适用范围` / `是否前端` / `视觉调性` / `前端` / `界面` /
|
|
34
|
+
**「结构形态」的三种任一**(与引擎判据同口径):标记**独立行**、居**行首**(可带列表符号 / 引用 / 加粗),或写在适用性类标签(`适用性` / `适用范围` / `是否前端` / `视觉调性` / `前端` / `界面` / `适用`)的**字段值位**;标记之后须成**词形边界**(紧跟空白、行尾,或下列标点之一:`,。;、,;.::!!??…—()()【】「」『』“”"'`——**只有这一组**,组外的标点如 `/`、`-` 不算边界),命中即回显**命中片段**。段内其它位置顺带提到「不适用」(例如句子里写「不适用于暗色主题」)不算标注,仍判前端。
|
|
35
35
|
|
|
36
36
|
上游的语义信号(`flow-kit/prompts/2a-ui-design.md` 与 `4-dev` 的判定):任务触碰 `.css` / `.scss` / `.tsx` / `.vue` / `.jsx` / `.html` / `.svelte` / 设计 token / 用户可见文案,或 `action` 含 button / 颜色 / 字体 / 卡片 / 布局 / 动画 / 主题 等关键词。
|
|
37
37
|
|
|
@@ -39,7 +39,7 @@ description: "flow-kit 2a UI-DESIGN 阶段协议:美学方向 + design tokens
|
|
|
39
39
|
|
|
40
40
|
## 强制等级(design 节点 · guarded)
|
|
41
41
|
|
|
42
|
-
`design` 节点对本技能的绑定等级 = **guarded**(见
|
|
42
|
+
`design` 节点对本技能的绑定等级 = **guarded**(见 `../flow-comet/reference/workflow-protocol.json` 的 `requiredSkillCalls`)。前端 change 的完整动作是**先加载、再声明、后干活**:
|
|
43
43
|
|
|
44
44
|
1. 用 Skill 工具加载本技能(只读取 SKILL.md 文件不叫加载);
|
|
45
45
|
2. 立即声明已加载:`node .claude/skills/flow-comet/scripts/workflow-state.mjs skill-load design flow-comet-ui-design --prompt flow-kit/prompts/2a-ui-design.md`;
|