@xulthekl/team-flow 0.62.0 → 0.64.0

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.
Files changed (64) hide show
  1. package/.claude/always/phase-guard.md +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.codex-plugin/plugin.json +1 -1
  5. package/.cursor-plugin/marketplace.json +1 -1
  6. package/.cursor-plugin/plugin.json +1 -1
  7. package/.github/plugin/marketplace.json +2 -2
  8. package/.github/workflows/ci.yml +2 -0
  9. package/CHANGELOG.md +67 -0
  10. package/GEMINI.md +1 -1
  11. package/INSTALL.md +1 -1
  12. package/README.md +1 -1
  13. package/docs/README_en.md +1 -1
  14. package/docs/decision-points.md +8 -0
  15. package/docs/state-machine.md +4 -1
  16. package/docs/team-flow /344/275/277/347/224/250/350/257/264/346/230/216/357/274/210/347/240/224/345/217/221/345/233/242/351/230/237/347/211/210/357/274/211.md" +4 -4
  17. package/gemini-extension.json +1 -1
  18. package/hooks/session-start +2 -2
  19. package/llms.txt +1 -1
  20. package/package.json +1 -1
  21. package/plugin.json +1 -1
  22. package/scripts/guard/checks/_fs-utils.mjs +18 -0
  23. package/scripts/guard/checks/arch-design-light.mjs +39 -0
  24. package/scripts/guard/checks/arch-merged-light.mjs +67 -0
  25. package/scripts/guard/checks/arch-snapshot-light.mjs +30 -0
  26. package/scripts/guard/checks/artifacts-planned.mjs +38 -0
  27. package/scripts/guard/checks/compound-writeback-light.mjs +45 -0
  28. package/scripts/guard/checks/contract-fresh.mjs +48 -4
  29. package/scripts/guard/checks/cross-change-consistency-light.mjs +75 -0
  30. package/scripts/guard/checks/direct-short-path.mjs +52 -0
  31. package/scripts/guard/checks/direct-test-result.mjs +30 -0
  32. package/scripts/guard/checks/execution-plan-ready.mjs +7 -1
  33. package/scripts/guard/checks/execution-reviews-passed-light.mjs +28 -0
  34. package/scripts/guard/checks/gates-probed.mjs +175 -0
  35. package/scripts/guard/checks/lightweight-completion-evidence.mjs +27 -0
  36. package/scripts/guard/checks/specs-merged.mjs +25 -1
  37. package/scripts/guard/checks/test-matrix-complete.mjs +27 -1
  38. package/scripts/guard/checks/test-matrix-ready.mjs +28 -1
  39. package/scripts/guard/checks/test-merged-light.mjs +36 -0
  40. package/scripts/guard/guard.mjs +119 -14
  41. package/scripts/infer-workflow.mjs +35 -4
  42. package/scripts/lib/arch-merge.mjs +20 -4
  43. package/scripts/lib/cmd-execution.mjs +44 -1
  44. package/scripts/lib/cmd-state.mjs +98 -4
  45. package/scripts/lib/execution-plan.mjs +3 -1
  46. package/scripts/lib/state-loader.mjs +55 -0
  47. package/scripts/lib/surface-scan.mjs +156 -0
  48. package/scripts/lib/test-merge.mjs +10 -2
  49. package/scripts/team-flow.mjs +3 -3
  50. package/skills/build-executor/SKILL.md +6 -11
  51. package/skills/build-executor/references/wave-delivery-selfcheck.md +92 -0
  52. package/skills/clean-code/SKILL.md +1 -1
  53. package/skills/code-reviewer/SKILL.md +4 -0
  54. package/skills/contract-builder/SKILL.md +21 -0
  55. package/skills/contract-builder/references/bridging-gate-dry-run.md +89 -0
  56. package/skills/contract-builder/references/freeze-and-errata.md +81 -0
  57. package/skills/jarvis/SKILL.md +2 -0
  58. package/skills/release-archivist/SKILL.md +48 -13
  59. package/skills/session-handoff/SKILL.md +1 -0
  60. package/skills/spec-writer/SKILL.md +3 -0
  61. package/skills/spec-writer/references/facts-referencing.md +64 -0
  62. package/skills/test-strategy/SKILL.md +1 -1
  63. package/skills/workflow-start/SKILL.md +64 -5
  64. package/skills/workflow-start/references/routing-rules.md +4 -4
@@ -0,0 +1,81 @@
1
+ # 规划制品冻结与契约勘误登记(v0.63.0;feedback 20260923-013114 S3)
2
+
3
+ > **来源**:v2-C2(跨 4 仓命名统一,生产逻辑实改 ≈1 if + 1 enum + 3 文案)三轮 dispatch 实证——规划制品数字靠抄写而非实测,
4
+ > 过期声明 6 处 + 派生描述 4 处 + tasks 测试计数 3 处 + 契约/矩阵计数 3 处,每轮订正触发 `artifacts_hash` 漂移 →
5
+ > `contract-fresh` 失败 → rebuild → plan revise(`.team-flow.yaml:7 revision: 3` 三次重签全可定位)。
6
+
7
+ ## 1. 冻结规则
8
+
9
+ DP-3 批准后,**planning 四件(proposal.md / specs/ / design.md / tasks.md)默认冻结**。
10
+
11
+ 陈述性订正**不再改 planning 原文**,改记入 `execution-contract.md` 的 **`## Errata Register`(勘误登记段)**。
12
+
13
+ ## 2. 勘误登记段模板
14
+
15
+ 追加到契约的固定段名与字段:
16
+
17
+ ```markdown
18
+ ## Errata Register
19
+
20
+ | 日期 | 原文(planning 制品:位置) | 订正后 | 例外条款 | 授权人 | 留痕 |
21
+ |------|--------------------------|--------|---------|--------|------|
22
+ | 2026-09-22 | design.md §Risks 第 3 条 | 基线 115 → 132 | 例外 1(作者裁决) | LT | dp_3_result |
23
+ ```
24
+
25
+ - **留痕要求**:每行必须有 `例外条款` 与 `授权人`;订正前原文须可追溯(引用制品位置,必要时附原句)。
26
+ - 勘误段**入 `contract_hash`**(契约全文入 hash),故写入后必须按下节操作序处理。
27
+
28
+ ## 3. 操作序(MUST)
29
+
30
+ > **勘误段写入后 MUST 执行 `tf execution refresh-hash`。**
31
+ >
32
+ > **理由**:写契约 = 改 `contract_hash`;不 refresh 会卡 `execution-plan-ready`(该维度挂 `executing:closing` 与 `debugging:executing`)——**恰复活了本机制要消除的 revision 回路**。
33
+ > **先例**:`references/glaf4-delegation.md`(契约改 hash → 必须先 refresh-hash)。
34
+
35
+ ## 4. 三分处方表(禁止混用)
36
+
37
+ | 变更对象 | 处方 | 说明 |
38
+ |---|---|---|
39
+ | `test-matrix.md` 段 | `tf state rebuild` | 矩阵 hash 独立(`hash.mjs computeTestMatrixHash`) |
40
+ | 契约段(含 `## Errata Register`) | `tf execution refresh-hash` | 只动 plan 内嵌的 `contract_hash`,不碰 state |
41
+ | wave / 执行模式变更 | plan revise | 结构性变更,走重规划 |
42
+
43
+ **rebuild 与勘误段的存续顺序**:`tf state rebuild` 会重建契约 → **勘误段随旧契约丢失**,须在 rebuild 后将勘误段**回填**(回填内容以 `dp_N_result` + 审查报告为源)。
44
+
45
+ ## 5. 冻结例外(六条,均须留痕)
46
+
47
+ | # | 例外 | 处置 |
48
+ |---|------|------|
49
+ | 1 | **作者级裁决落地**(LT/业务作者定稿变更,如 C2-CONFLICT-001 desc1) | 按契约裁决记录 + 订正前原文留痕;**若触及 gate-affecting → 回归例外 2** |
50
+ | 2 | **gate-affecting 勘误必改**(矩阵 expected/方法名、闸门基线数字、契约 Test Matrix 段) | 触发 rebuild → revise |
51
+ | 3 | **checkbox 勾选回写**(进度位) | **显式豁免**——`hash.mjs normalizeCheckboxes` 已归一化,不属冻结对象(否则与 v0.49.0 修复自相矛盾) |
52
+ | 4 | **显式 Rewind 后的修改**(scope→re-specify、contract→re-bridge) | 冻结**不豁免** Rewind |
53
+ | 5 | **Review Findings 分轨文本订正**(M-1/M-2 类纯文本缺陷) | 经 doc-only 授权、收口波次落地,与代码修复分轨 |
54
+ | 6 | **LT 书面授权兜底** | 须写入 `dp_N_result` 或契约勘误段 |
55
+
56
+ **例外授权升级序**:例外 6 **不可与其他例外叠加降级**——不得以「LT 曾授权例外 6」为由豁免例外 2 的判定复核;例外 1 如触及 gate-affecting,**回归例外 2** 处理。
57
+
58
+ ## 6. 非例外(禁止)
59
+
60
+ - 无新证据的措辞美化
61
+ - 把陈述性订正**伪装**成 gate-affecting(或其反向:把 gate-affecting 记成陈述性)
62
+ - 绕过 Rewind 改 brief 级范围
63
+
64
+ ## 7. 例外 2 的判定与呈报(防伪绿关键)
65
+
66
+ **判定权升格**:实施方仅**提议**,**判定由审查侧复核**(code-reviewer)+ closing 侧反查。**自判错判的方向恰是伪绿出口**。
67
+
68
+ **呈报纪律(MUST)**:
69
+
70
+ 1. 「例外 2 提议 + 判定依据 + `## Errata Register` 摘要」**并入 wave review prompt**;
71
+ 2. **根仓 planning 制品 diff 单列进审查范围**——多仓场景下 wave `base..head` 的 git range 解析到**子仓**,而 planning 制品在**根仓**,子仓 diff 里看不到它们被改;
72
+ 3. **未在 DP-3 摘要中呈报的差异,不得执行 `tf execution refresh-hash`**(该命令是唯一能把「改过 planning」从 `validatePlan` 比对中抹掉的操作)。
73
+
74
+ **closing 侧反查锚(v0.63.0 新增)**:`executing:closing` 维度已补挂 `contract-fresh`——它比对 `state.artifacts_hash` 与制品实算值,**`refresh-hash` 无法清屏**(后者只改 plan JSON)。
75
+
76
+ ## 8. 机械强度如实声明
77
+
78
+ v0.63.0 **不加专用冻结 guard 维度**。本期 = 本文件纪律 + Staleness advisory + `contract-fresh`(含 closing 新挂)+ `executing:closing` 反查三者合成。
79
+ **硬门禁**(DP-3 写 planning 快照 hash + closing 快照比对)归**远期上游 PR**。
80
+
81
+ **收益如实拆分**:本机制消除的是**陈述性订正**的回路;**gate-affecting 订正仍走例外 2 → 仍触发 rebuild→revise**(v2-C2 的 revision 3 订正大半属此类)。不得宣称「消除了全部重签回路」。
@@ -16,6 +16,8 @@ description: This skill should be used when the user asks to "启动 Jarvis", "
16
16
 
17
17
  **核心边界**:Jarvis 只做决策与编排——**不写产线代码、不改 team-flow 状态文件(`.team-flow.yaml`)、不发明任务方向**。(「不改状态文件」专指 team-flow 的门禁真相源;Jarvis 自己的 `state/*.log|md` 当然要写。)
18
18
 
19
+ **前门回显(v0.64.0)**:接管/恢复任何 team-flow change 时,简报须读取并回显 `workflow_variant`(direct/planned/legacy/null)——direct/planned **轻路径无 DP-0~7 决策点可代答**(代答权限表对该两档恒 N/A);升档决策(`tf state upgrade`)属「挂起交 LT」类,不在代答权限内。
20
+
19
21
  > **与 firstmate 的分工**:Jarvis 是 **team-flow 专用**的决策代理,深度集成状态机 / 决策点 / 门禁;通用跨项目的「大副」角色由 firstmate 承担。两者不重叠——Jarvis 不做通用编码、调查或审计工作。
20
22
 
21
23
  > **命令形态以官方为准**:本文命令随 Orca 版本演进,**运行前先读一次** `orca skills get orchestration`,不要凭记忆推断子命令或参数——v0.60.0 实测暴露的 skill 缺陷之一即命令形态错误。
@@ -79,9 +79,10 @@ Check for files modified outside scope fence, new dependencies not in design. Un
79
79
  - **Prototype sync**: <synced N pages / N components / design-system updated | no UX delta | conflicts: N>
80
80
  - **Compound promotion**: <promoted N / confirmed N / unchanged N / skipped N | no learnings>
81
81
 
82
- **Verdict**: PASS (all PASS) / CONDITIONAL (WARN only) / FAIL (any FAIL).
82
+ **Verdict**: PASS (all PASS) / CONDITIONAL (WARN only) / **ACCEPTED-RISK** / FAIL (any FAIL).
83
83
  - FAIL → fix issues or route back to build-executor
84
84
  - CONDITIONAL → present WARNs, proceed only with user acceptance
85
+ - **ACCEPTED-RISK(v0.64.0,§3.7)**: 用户**显式**拍板「带风险收尾」——三硬条件:① `tf state set <dir> dp_6_result "accepted-risk: <reason>"` + reason 非空(DP-6 段四值格式;`dp_7` 同记)② **不伪造通过**(验证步骤照跑,失败项原样列进 closing 总结的 Known Risks 段)③ **不自动合并**(merge/发布仍走人工)。**作用域:仅非 guard 维度发现——tests-passing/direct-test-result 等门禁失败不被 accepted-risk 放行**(见 DP-6 段)。拒绝空 Git range / 截断 `HEAD~1` / 失效快照充当验证证据。触发仅限 AskUserQuestion 用户选择,**禁止主代理自判 accepted-risk**
85
86
  - PASS → proceed to final checks
86
87
 
87
88
  ### Step 5b: E2E Verification (conditional, v0.38.0 起由"存在 e2e/ 套件"改为"矩阵含 E2E case"触发)
@@ -129,16 +130,20 @@ Check for files modified outside scope fence, new dependencies not in design. Un
129
130
 
130
131
  ### DP-6 (Verification Outcome)
131
132
  ```bash
132
- tf state set <change-dir> dp_6_result "<pass|conditional|fail>: <summary>"
133
+ tf state set <change-dir> dp_6_result "<pass|conditional|fail|accepted-risk>: <summary/reason>"
133
134
  tf state set <change-dir> dp_6_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
134
135
  ```
135
136
  If FAIL, do NOT proceed to DP-7. Route back or ask about abandonment.
136
137
 
138
+ **ACCEPTED-RISK 作用域(v0.64.0,防死锁)**:`accepted-risk` 仅覆盖**非 guard 维度**的发现(文档缺口、非阻断 WARN、已知展示层风险)。**命中 guard 维度的失败不因此放行**——`tests-passing` / `direct-test-result` 只认 `tf test record` 的结构化 pass 证据,测试失败必须修复或转 `abandoned`,否则 `executing→closing` 转换必被阻断(不存在 accepted-risk 放行通道)。reason 写入 `dp_6_result` 的 summary 段与 closing 总结 Known Risks 段。
139
+
137
140
  **测试门禁凭证(v0.13 §50 修订)**:`dp_6_result` 只是决策点记录,不再是 `tests-passing` 门禁的证据(BUG-A 等价通道仅对存量 change 保留)。非存量 change 的 `executing → closing` 放行凭证是 Step 1 中 `tf test record` 写入的结构化 `test_result`(+ 证据文件)。若 Step 1 尚未执行 `tf test record`,先补跑测试套件并记录,再守 DP-6。
138
141
 
139
142
  ### DP-7 (Archive Confirmation)
140
143
  ```bash
141
144
  tf state set <change-dir> dp_7_result "confirmed: <archive summary>"
145
+ # accepted-risk 收尾时同记(与 DP-6 四值一致,reason 非空):
146
+ # tf state set <change-dir> dp_7_result "accepted-risk: <reason>"
142
147
  tf state set <change-dir> dp_7_timestamp $(date -u +%Y-%m-%dT%H:%M:%SZ)
143
148
  ```
144
149
  Verify DP-0 through DP-6 are recorded before DP-7.
@@ -149,8 +154,11 @@ If implementation diverged from the contract, return to `bridging` before closur
149
154
 
150
155
  ## Post-Verification
151
156
 
152
- ### ⚠ 执行顺序(v0.53.0 §110 B' 时序前移 — MUST)
157
+ ### ⚠ 执行顺序(v0.53.0 §110 B' 时序前移 — MUST;v0.64.0 按 variant 分叉,§3.7 唯一真相源)
158
+
159
+ **先读 `workflow_variant` 再选序列**(读法见 workflow-start SKILL「Front Doors」):
153
160
 
161
+ **legacy / full(默认序列,v0.53.0 原序不动):**
154
162
  ```
155
163
  ① tf arch-merge <change-dir> ← 架构增量回写全局台账
156
164
  ② tf state transition <change-dir> closing
@@ -160,7 +168,25 @@ If implementation diverged from the contract, return to `bridging` before closur
160
168
  ⑥ 设计系统待办检查(v0.54.0) ← 只读检查 + 报告,不执行 iterate
161
169
  ```
162
170
 
163
- (各步详细说明见下方对应节标题的 ①–⑤ 编号。)
171
+ **planned(v0.64.0:回写与审查全前置,transition 是最后一步——closing 段 light 维度在 transition 时一次性校验,④⑤ 后置会死锁,B-13):**
172
+ ```
173
+ ① tf arch-merge <change-dir> --light ← 有架构 surface 才跑;持久源 = 最小 architecture.md(+api/database delta)
174
+ ② tf test-merge <change-dir> --light ← 有测试触碰才跑;changelog 首行写 change:<name> 归因锚
175
+ ③ tf solutions capture <args> --source "change:<name>" ← 必执行(归因 = --source;含「无新增决策」空捕获;禁 compound_skipped 自清)
176
+ ④ final-review.md 复核(≥5 行;**回写之后**核验台账条目 vs diff 抽样,B-01/D5)
177
+ ⑤ tf state transition <change-dir> closing ← planned closing 维度表此刻全部满足
178
+ ⑥ tf prototype-sync <change-dir> ← 有原型才跑(closing 后)
179
+ ⑦ 设计系统待办检查(只读)
180
+ ```
181
+
182
+ **direct(v0.64.0:验证记录即证据,回写全跳过——G4 前提 = 无架构 surface):**
183
+ ```
184
+ ① tf state transition <change-dir> closing ← direct 维度表:direct-short-path 扫描 + tf test record 证据 + test-matrix 轻判据
185
+ ② tf prototype-sync / test-merge / solutions promote 全部跳过(若 direct 触及 design-system 共享层 → 提示补 prototype-sync 或升 planned,B-14)
186
+ ③ G5 同步门禁点(阶段产物同步确认)、Workflow Feedback、Deisolation 等**通用收尾步骤照跑**(仅架构/测试/复利三类回写按 direct 跳过)
187
+ ```
188
+
189
+ (legacy/full 各步详细说明见下方对应节标题的 ①–⑤ 编号;planned/direct 分支以本块为唯一真相源。)
164
190
 
165
191
  > **本块是全流程中该顺序的【唯一真相源】**(v0.53.0 §115.10):②③ 两节及「阶段产物同步门禁点」原先各自复述同一顺序串(本文件内共 4 处),是既有的漂移源——`agents/release-archivist.md` 已明文禁止复述,本文件却复述了 4 次。现各处改为指向本块。
166
192
  >
@@ -168,7 +194,7 @@ If implementation diverged from the contract, return to `bridging` before closur
168
194
 
169
195
  **架构快照门禁(arch-snapshot,v0.36.0 / v0.36.3)**:本轮迭代产品级架构快照 `iterations/vN/architecture.md` 必须已落盘("先快照后回写"强制化)。**FAIL 升级路径**:回 orchestrator 的 ARCH 阶段补快照;存量升级在途 change(快照缺失但 change 有增量产物)→ WARN 兜底放行;`arch_baseline` 缺失 → WARN 不阻断。hotfix/tweak 豁免(不挂该维度)。判定逻辑见插件内 `scripts/guard/checks/arch-gate-exemptions.mjs`(引用,非调用)。
170
196
 
171
- ### ① Architecture Merge (v0.10 §28-§31) — MUST run first
197
+ ### ① Architecture Merge (v0.10 §28-§31) — MUST run first(legacy/full 序列;planned 走上方 ⚠ 块 ① `--light`,direct 跳过)
172
198
 
173
199
  Merge change-level architecture artifacts to the global `docs/architecture/` baseline **before** the state transition and before any other post-verification step:
174
200
 
@@ -185,13 +211,13 @@ tf state set <change-dir> arch_merge_skipped true
185
211
  tf state set <change-dir> arch_merge_skip_reason "<理由>"
186
212
  ```
187
213
 
188
- ### ② State Transition
214
+ ### ② State Transition(legacy/full 序列)
189
215
 
190
216
  Run `tf state transition <change-dir> closing`. If delta specs exist, route to `spec-merger`.
191
217
 
192
- **顺序(MUST)**:见 `### ⚠ 执行顺序` 的 ①–⑤(**本步是 ②**,前置 ① 已完成)。不得并行——全局文档不得处于半更新态。
218
+ **顺序(MUST)**:见 `### ⚠ 执行顺序` 的 ①–⑤(**本步是 legacy/full 序的 ②**,前置 ① 已完成;planned 序中 transition 是第 ⑤ 步且前置为回写+审查,direct 序中 transition 是唯一步——三分支各不相同,勿跨分支套用)。不得并行——全局文档不得处于半更新态。
193
219
 
194
- ### ③ Prototype Sync (v0.5)
220
+ ### ③ Prototype Sync (v0.5)(legacy/full 序列;planned 为其 ⑥、direct 见例外)
195
221
 
196
222
  After `arch-merge` (①) completes **and the state transition to `closing` (②) has been run**, run prototype-sync to merge UX deltas back to the global prototype:
197
223
 
@@ -199,15 +225,15 @@ After `arch-merge` (①) completes **and the state transition to `closing` (②)
199
225
  tf prototype-sync <change-dir>
200
226
  ```
201
227
 
202
- **顺序(MUST)**:见 `### ⚠ 执行顺序` 的 ①–⑤(**本步是 ③**,①② 已完成)。同一 change closing 内**顺序执行**,不得并行——`docs/architecture/` / `prototype/` / `docs/test-ledger/` 不得处于半更新态,否则下一个 change 会以半态为基。
228
+ **顺序(MUST)**:见 `### ⚠ 执行顺序` 的 ①–⑤(**本步是 legacy/full 序的 ③**,①② 已完成)。同一 change closing 内**顺序执行**,不得并行——`docs/architecture/` / `prototype/` / `docs/test-ledger/` 不得处于半更新态,否则下一个 change 会以半态为基。
203
229
 
204
230
  If `prototype-sync` reports conflicts, list them in the closing summary and flag for manual resolution. Do not block closing on prototype-sync conflicts (advisory level).
205
231
 
206
232
  **Execution verification(v0.24.0)**:`prototype-sync` 命令执行后,检查其 stdout 输出确认合并完成(输出含 `merged`/`no UX delta`/`conflicts` 之一)。若命令未执行或执行失败,Step 5 Report 的 `Prototype sync` 行必须标注 `SKIPPED` 或 `FAILED`,并在 closing summary 中说明原因。**禁止在 prototype-sync 未执行时将 Prototype sync 行标注为已完成**。
207
233
 
208
- ### ④ Test Merge (v0.12 §43)
234
+ ### ④ Test Merge (v0.12 §43)(legacy/full 序列;planned 走 ⚠ 块 ② `--light` 且在 prototype-sync **之前**,direct 跳过)
209
235
 
210
- After `prototype-sync` completes, run test-merge to write test matrix results back to the global test ledger:
236
+ In the legacy/full sequence, run test-merge after `prototype-sync` completes to write test matrix results back to the global test ledger(位置断言仅限 legacy/full 序——planned 序中 test-merge 是第 ② 步、prototype-sync 是第 ⑥ 步,勿跨分支套用):
211
237
 
212
238
  ```bash
213
239
  tf test-merge <change-dir>
@@ -223,7 +249,7 @@ Skip silently when `test-matrix.md` does not exist (legacy change or test_matrix
223
249
 
224
250
  **Execution verification**: check stdout output for `test-merge complete` confirmation. If the command did not execute or failed, Step 5 Report's `Test Matrix` row (from Step 2b) must note the reason.
225
251
 
226
- ### ⑤ Compound Promotion (v0.5)
252
+ ### ⑤ Compound Promotion (v0.5)(legacy/full 序列;planned 走 ⚠ 块 ③ capture `--source`,direct 跳过)
227
253
 
228
254
  Promote change-level learnings to the global solutions library:
229
255
 
@@ -245,7 +271,7 @@ tf solutions promote <change-dir>
245
271
 
246
272
  ### 阶段产物同步门禁点(v0.37.0 §68.2 G5)
247
273
 
248
- 回写链(顺序见 `### ⚠ 执行顺序` 的 ①–⑤)**全部完成后**,**阻塞确认**(AskUserQuestion)是否同步 change 实施结果(团队协作:落地结果是团队最需要看的内容):
274
+ 回写链(顺序见 `### ⚠ 执行顺序` 的**本分支对应序列**——legacy/full 为 ①–⑤、planned 为 ①–③、direct 无回写)**全部完成后**,**阻塞确认**(AskUserQuestion)是否同步 change 实施结果(团队协作:落地结果是团队最需要看的内容):
249
275
 
250
276
  > **v0.53.0 时序说明**:本门禁点原先表述为"回写链全部完成后、`tf state transition closing` **之前**"——那是旧顺序(转换在最后)。B' 方案已把状态转换前移到 ②,故本门禁点改为以「回写链**全部完成后**」为准,**不再对转换位置附加约束**。二者不冲突:本门禁只关心"实施结果是否同步",与转换先后无关。
251
277
  - **A 提交并推送**:`tf publish --changes <change-dir> --push`
@@ -254,6 +280,15 @@ tf solutions promote <change-dir>
254
280
 
255
281
  同步对象:实施代码 `changes/<change-dir>/` + arch-merge 回写(docs/architecture/)+ test-ledger(docs/test-ledger/)。**原型独立仓库场景**:若本 change 有 UX 增量回写原型,push 对应 `prd-vN` 分支(`tf prototype branch <prd-vN>` 确认/创建 worktree)。
256
282
 
283
+ **决策点攒批与预批复单(v0.63.0;feedback 20260923-013114 S5)**:
284
+
285
+ - **同根因攒批(MUST)**:同一根因的多个发现**攒成一次 ask**,不得逐个往返确认。
286
+ - **closing 边界并入**:**DP-6 与 roadmap/push 边界并入同一次 closing 确认**(既有确认点合并三组为 DP-0+DP-A、DP-3+G4+DP-4、DP-7+落地+G5,**均不含 DP-6**,故本项为新增;三组清单以 `docs/decision-points.md` 为准)。
287
+ - **批量预批复单模板**(closing 型变更可启用):一次性列出全部待确认项 + 各项的建议取值 + 理由,由用户一次批复。
288
+
289
+ > **⛔ 防伪绿护栏(MUST)**:**门禁类 DP(`dp_3` / `dp_4`)禁止超时代答**——这两个字段是 `dp-gate-passed` 门禁的数据源(`checks/dp-gate-passed.mjs` 仅映射 dp_3/dp_4)。**预批复只作用于非门禁确认**;DP-6 预批复为**条件式**(机器门禁全 PASS 才生效)。
290
+ > **Rewind 作废**:Rewind 后已发出的预批复**自动作废**,须重新征询。
291
+
257
292
  ### Worktree Deisolation (v0.35.0) — advisory
258
293
 
259
294
  After compound promotion, check if worktree isolation exists for this change:
@@ -67,6 +67,7 @@ argument-hint: "[下一个会话的关注点描述]"
67
67
  4. **用户偏好**:不在文档中的隐性偏好
68
68
  5. **失败尝试**:尝试过但放弃的方案及原因
69
69
  6. **敏感信息**:API Key / Token / 密码 → 替换为 `${PLACEHOLDER}`
70
+ 7. **状态机快照(v0.64.0)**:`state` + `workflow` + **`workflow_variant`**(direct/planned/legacy/null)+ `planned_arch`——恢复会话据此选前门路由(workflow-start Front Doors),缺 variant 会误入 legacy 分支
70
71
 
71
72
  ### Step 3:文档生成
72
73
 
@@ -84,6 +84,8 @@ Run: `tf runtime config --get artifacts.order` — generate in configured order
84
84
 
85
85
  **Honor Architecture (v0.9 §26, v0.10 §28-§31)**: 若 `architecture/` 目录存在,design.md 的 Decisions 段必须引用其架构决策(聚合/限界上下文/CQRS/API/DB),tasks.md 的接口定义(对齐 api.md 架构路由表)和数据层任务(引用 sql/ddl/ + sql/migration/ 脚本路径)必须与 architecture/ 产出对齐——不得静默忽略或矛盾架构设计产出。
86
86
 
87
+ **Fact Referencing (v0.63.0;feedback 20260923-013114 S1)**: 制品中凡涉及**基线数字、测试计数、目标行号、枚举现状、编号在册性**,一律从 `<change-dir>/.superpowers/facts.json` 引用键名,**不裸写数字**(抄写的事实下轮修订即漂移 → `artifacts_hash` 漂移 → 契约重签)。每个键须带采集命令 / 时间戳 / 口径声明。**强度如实声明**:这是**纪律条款**,不是硬门禁(`tf facts probe` 与 WARNING lint 归远期上游 PR);但 facts.json 不进任何 hash,无新回路。判据四条(`command grep` / 原始输出先落文件 / 模式自证 / 数字注明命令+环境+时间戳+口径)见 `references/facts-referencing.md`(含跨仓 `repos.<name>` 结构与 bridging 复测呈报纪律)。
88
+
87
89
  ### proposal.md
88
90
  Must state: problem, what changes, capabilities affected, impact areas.
89
91
 
@@ -144,6 +146,7 @@ Generate one at a time. Confirm each before next. This prevents scope drift —
144
146
 
145
147
  ### tasks.md
146
148
  - `## File Structure`, `## Interfaces`, numbered tasks, exact file paths, TDD phases, ≤5 min steps, no placeholders, every requirement mapped, explicit dependencies
149
+ - **任务行形态强制 `- [ ]`(v0.63.0;feedback 20260923-013114 E1)**:tasks.md 的**每条任务行 MUST 生成为 `- [ ]` checkbox 形态**,不得写成纯编号/纯列表。理由:`templates/tasks.md` 本就是 `- [ ]` 形态;`tasks-complete` 门禁对零已勾选**无条件 FAIL**(closing 死锁);`hash.mjs` 的 `normalizeCheckboxes` 只归一化勾选态、**救不了行结构变化**——事后补 checkbox 会造成 `artifacts_hash` 漂移 + 契约重签(v2-C2 实证:wave1 即知风险、拖到 closing 才改,致 revision 3 重签)。生成期一行约束即同时消掉「closing 死锁」与「hash 漂移重签」双源头。
147
150
  - **接口交叉核对(v0.35.0,v0.14 §61.1)**:若 `architecture/api.md` 存在,机械比对 `tasks.md` `## Interfaces` 声明的端点集合与 `api.md` 架构路由表端点集合——tasks 引用了 api.md 未声明的端点、或 api.md 声明的关键端点 tasks 未落地 → 告警修正(traceability 从自报升级为机械比对)
148
151
 
149
152
  **If any artifact fails validation, fix before handing off to contract-builder.**
@@ -0,0 +1,64 @@
1
+ # 事实引用惯例(v0.63.0;feedback 20260923-013114 S1)
2
+
3
+ > **来源**:v2-C2 实证——规划制品里的数字靠**抄写**而非实测:过期声明 6 处 + 派生描述 4 处 +
4
+ > tasks 测试计数 3 处 + 契约/矩阵计数 3 处(均带【订正】标记)。每轮订正触发 `artifacts_hash` 漂移 →
5
+ > `contract-fresh` 失败 → rebuild → plan revise(revision 3 三次重签全可定位)。
6
+
7
+ ## 1. 规则
8
+
9
+ **基线数字必须写成带来源的形式:`<值>(facts:<键>,ts=<时间戳>)`——脱离 facts 键的裸值即违规。**
10
+
11
+ (值本身当然要写在制品里才能读懂;违规的是「值没有可追溯的 facts 键与采集时点」,不是「出现了数字」。
12
+ 阈值类 specs 正常书写不受影响。)
13
+
14
+ 凡涉及以下内容,一律写入 `<change-dir>/.superpowers/facts.json` 并在制品中**引用键名**:
15
+ - G1/G2 残差基线(如「G2 违规数 119 → 132」)
16
+ - 各仓测试计数
17
+ - 目标文件 / 目标行号
18
+ - 枚举现状、PRD 编号在册性
19
+
20
+ **强度如实声明**:「禁止裸数字」**不是硬门禁**——自由 markdown 上硬禁会全量误报。本惯例是
21
+ **纪律条款**(`tf facts probe` 子命令与 WARNING lint 均归远期上游 PR,v0.63.0 未实现)。
22
+ 但 facts.json 本身**不进任何 hash**(`hash.mjs` 白名单仅 proposal/specs/design/tasks/architecture),
23
+ 所以写 facts 不产生新回路。
24
+
25
+ ## 2. facts 三件套(每个键必带)
26
+
27
+ | 项 | 要求 |
28
+ |---|---|
29
+ | **采集命令** | 可原样复跑的命令行 |
30
+ | **时间戳** | ISO 8601 UTC |
31
+ | **口径声明** | 含/不含副本、排除目录清单 |
32
+
33
+ **跨仓**:facts.json **仍为单文件**,per-repo 数据以 `repos.<name>.{test_counts, target_lines, enums}`
34
+ 分节;`repos` 的键集合须与 `repo_layout` 一致(缺仓 = facts 不完整,须补采)。
35
+
36
+ ```json
37
+ {
38
+ "repos": {
39
+ "ui": { "test_counts": { "value": 16, "command": "command grep -c '@Test' …", "ts": "2026-09-22T09:00:00Z", "scope": "含 dist 行" } }
40
+ }
41
+ }
42
+ ```
43
+
44
+ ## 3. 判据四条(母本 161200;以下为转述,以母本为准)
45
+
46
+ 1. 扫描/计数一律 `command grep`(绕过 shell function 包装);
47
+ 2. 原始输出**先落文件**,计数从落盘文件算出(不对管道中间结果计数);
48
+ 3. 扫描脚本必含**模式自证段**(探针证明模式有效,防空结果假 PASS);
49
+ 4. 每个基线数字注明**采集命令、时间戳、口径**——注意 161200 原文是「采集命令与**采集环境**」,
50
+ **时间戳**属本文件三件套要求(专家评审 :49),二者分开陈述、不混同转述。
51
+
52
+ ## 4. bridging 复测(防 specifying→bridging 漂移)
53
+
54
+ 契约生成前由 **contract-builder** 复测一次 facts,差异计入 `facts.bridging_recheck` 段。
55
+
56
+ **差异裁决(MUST)**:差异摘要(含超口径项)**并入 DP-3 批准 ask 一并呈报**,裁决权归 LT。
57
+ **不得**由实施方(含主会话)自行解释掉——错判方向即伪绿:把超口径差异解释为「口径问题」→
58
+ 闸门基线数字错。无法在声明口径内解释的差异 → 触发**契约侧重签判断**。
59
+
60
+ ## 5. 反模式
61
+
62
+ - ❌ 写数字但不带 `facts:<键>` 与 `ts=`(下轮修订即漂移,且无从核对口径)
63
+ - ❌ 同一事实在多个制品各写一遍(口径不一致的根源)
64
+ - ❌ 引用其它 change 的计数而不声明它的采集时点
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: test-strategy
3
- description: 测试设计方法论 skill——design_method 选择、分层策略、对抗验证、复杂度分级。build-executor / contract-builder 通过 skills 字段预加载。
3
+ description: 测试设计方法论 skill——design_method 选择、分层策略、对抗验证、复杂度分级。仅供 build-executor / contract-builder 经 skills 字段预加载,不面向用户直接触发(v0.64.0 §3.8 收紧)。
4
4
  user-invocable: false
5
5
  ---
6
6
 
@@ -7,6 +7,59 @@ description: Primary entry point for the team-flow state-machine workflow. Invok
7
7
 
8
8
  Primary entry point for `team-flow`. Jobs: inspect change context, check for updates, confirm DP-0, determine state, route to correct skill, block invalid transitions.
9
9
 
10
+ ## Front Doors(前门路由,v0.64.0 · spec-superflow 2.0 同步)
11
+
12
+ 进入任何路由前先读 `tf state get <change-dir> workflow_variant`,按分支处理:
13
+
14
+ | `workflow_variant` | 路由 |
15
+ |---|---|
16
+ | `null`(存量 / `tf state init` 新 change / orchestrator S4 创建) | **≡ legacy 分支**:走本文件既有全量流程,行为与 v0.63 一致。有 TTY 且处于 `exploring` → **单次** AskUserQuestion 提示可选前门;无 TTY(headless / e2e Tier2 / jarvis worker)→ **不提示**直接 legacy,绝不挂起(B-11 协议)。 |
17
+ | `direct` | → Direct 路由 |
18
+ | `planned` | → Planned 路由 |
19
+ | `legacy` | 全量冻结流程(本文件既有路由),不可中途转档 |
20
+
21
+ **显式选门落盘**(`--path` 是本 skill 参数,无 `tf workflow` CLI;**新 change 先 `tf state init` 再 set**——BUG-B 要求 state 文件先存在;`base_sha` 仅首建打戳,重复 init 不追加):
22
+
23
+ ```bash
24
+ tf state init <change-dir> # 首建 state 文件 + 打戳 base_sha(扫描基线)
25
+ tf state set <change-dir> workflow quick # direct → quick;planned → full
26
+ tf state set <change-dir> workflow_variant direct # 或 planned
27
+ tf state set <change-dir> planned_arch true # 仅 planned 且用户选轻架构
28
+ ```
29
+
30
+ **优先级铁律:显式 `--path` > 内容启发式 legacy 识别**——显式选门时**不跑** legacy 内容判定(否则 planned「先写 proposal 再 start」第一步就误判 legacy,S-05)。`exploring` 态且未产规划制品时允许**一次**改选前门(首选/纠错);此后只可经 Upgrade 升档,降档禁止。
31
+
32
+ **infer 双通道**:见下方「Mode Detection」节(**唯一落点**,本节不复述——同文件双份规则是漂移源)。
33
+
34
+ **`lightweight` 归属(孤儿值补全)**:`workflow=lightweight` 无独立前门——手动 `tf state set workflow lightweight` + `workflow_variant direct` 使用(quick 的加严变体:closing 追加 `lightweight-completion-evidence`),infer 不产出该值。
35
+
36
+ ### Direct 路由(`workflow=quick`·零文档零契约)
37
+
38
+ 1. 快速 DP-0(一句话确认 scope/AC,仍写 `dp_0_confirmed=true`)
39
+ 2. `tf state init`(若尚未建)→ 上述两条 `tf state set`(先 init 后 set,见落盘块)
40
+ 3. 产出最小 `test-matrix.md`,或显式 `test_matrix_skipped=true`+理由(D4 底线;无契约轻判据)
41
+ 4. 转换 `exploring→approved-for-build→executing`(guard 走 direct 维度表)。**架构 surface(API/DB/聚合)扫描命中 → FAIL** → 走 Upgrade 升 planned,禁止硬闯
42
+ 5. 实施:**主代理当前会话直接写代码**(direct 前门无子代理——Artifact Ownership 的子代理委派要求不适用本分支)
43
+ 6. 验证:跑验证命令 → **`tf test record <dir> --from <输出文件>`(必须 record;guard 只读记录、不现场跑测试,A-19)**
44
+ 7. 转 `closing` → release-archivist **direct 分支**(仅 transition + 验证记录;回写全跳过)
45
+
46
+ ### Planned 路由(`workflow=full`+`variant=planned`·两份文档 + 一次最终审查)
47
+
48
+ 1. 产出 `proposal.md`(≥10 非空行)+ `tasks.md`(≥1 checkbox)——轻路径无 spec-writer 子代理,主代理可直接写。**DP-0 并入本步一次确认**(scope/约束/AC 一次问完,`dp_0_confirmed=true` 照写——与 Direct 快速 DP-0 同型)
49
+ 2. `tf state init`(若尚未建,先 init 后 set)→ `tf state set workflow full` + `workflow_variant planned`(+ `planned_arch true` 如选轻架构)
50
+ 3. **轻架构(`planned_arch=true` 时)**:写 `architecture/light-note.md`(简短说明)+ `architecture/snapshot-light.md`;declined 则显式跳过:`arch_design_light_skipped=true` + `arch_design_light_skip_reason`(两键缺一不可)
51
+ 4. **plan 派生**:`tf execution plan <dir> --derive --confirm --reason "<一句话>"`——tasks.md → 单 wave(serial),写入即同步 `state.execution_mode/execution_plan_hash/execution_plan_revision`;**无需 recommend/receipt/DP-4**(validatePlan 对 planned 豁免)
52
+ 5. D4:最小 `test-matrix.md` 或显式 skip(同 direct)
53
+ 6. 转换 `exploring→approved-for-build→executing`(planned 维度表:无契约、无 DP-3、无 architecture-design 重门)
54
+ 7. 实施:主代理当前会话执行单 wave;完成 → 跑测试 → `tf test record`
55
+ 8. **关门 → dispatch/执行 release-archivist(planned 分支单点执行)**:回写三步(`arch-merge --light` / `test-merge --light` / `tf solutions capture --source "change:<name>"`)→ `final-review.md` 最终审查(**在回写之后核验台账条目 vs diff 抽样**,B-01/D5)→ 转 `closing` → prototype-sync(closing 后,有原型才跑)。**序列只存在于 release-archivist「⚠ 执行顺序」块(唯一真相源,§3.7 B-13),本 skill 不重复执行、不本地复述命令(防双跑)**。
56
+
57
+ ### Upgrade(升档,G5/D9)
58
+
59
+ - 触发:direct 被 `direct-short-path` 判命中架构 surface;或 planned 发现跨模块/高不确定性需重设计。
60
+ - **唯一机械入口**:`tf state upgrade <change-dir> <planned|full>`——校验方向向上 → 原子写 `variant_source=upgrade` + `variant_direction=up` → state 回退 `approved-for-build` → 重算 `artifacts_hash`。**已产代码、`tf test record` 证据、`test_matrix_hash` 全部保留**(B-10 含 hash 重算)。
61
+ - 之后按目标档位补齐缺口(planned:proposal/tasks/derive/回写序列;full:完整仪式)再重新推进。**降档一律禁止**(guard fail-closed:非 exploring 的 variant 变更若 `variant_source≠upgrade` 或方向为降 → 拒绝)。
62
+
10
63
  ## Use This Skill When
11
64
 
12
65
  Only invoke when team-flow context is present: `.team-flow.yaml` exists, artifacts like `proposal.md`/`specs/`/`design.md`/`tasks.md`/`execution-contract.md` are present, or user explicitly invokes team-flow by name. When in doubt, check for `.team-flow.yaml` first.
@@ -70,13 +123,15 @@ Config-aware routing: check `artifacts.order` and `artifacts.skip` from project
70
123
 
71
124
  ## Mode Detection
72
125
 
73
- If workflow is `auto`/`null`/unset: run `tf runtime infer <change-dir>`. Inference: **hotfix** (≤2 tasks, ≤2 files, no schema/API/new modules), **tweak** (≤4 tasks, config/doc only), **full** (anything larger). Persist with `tf state set <dir> workflow <mode>`.
126
+ If workflow is `auto`/`null`/unset: run `tf runtime infer <change-dir>`. 双通道输出(v0.64.0):`mode` ∈ **hotfix**(≤2 tasks/≤2 files) / **tweak**(≤4, config/doc) / **full**(更大;quick/lightweight 仅由显式前门写入)+ `suggested_path` ∈ direct|planned|null(arch/API/DB/聚合信号 → 建议 planned 而非 full,D1)。
127
+
128
+ **持久化改为「建议+询问」(P4 落地)**:有 TTY → 回显 `mode` + `suggested_path` 建议,AskUserQuestion 确认后 `tf state set <dir> workflow <mode>`;无 TTY → 按建议直接落盘并在输出中记 `infer_source=suggested`(B-12,e2e/jarvis 不挂起)。**`suggested_path` 只进前门选择提示,绝不写入 `state.workflow`。**
74
129
 
75
- Validate mode against artifact content. If hotfix/tweak criteria not met → upgrade to `full` and output reason. Don't overwrite explicit mode unless user asks.
130
+ Validate mode against artifact content. If hotfix/tweak criteria not met → upgrade to `full` and output reason. Don't overwrite explicit mode unless user asks. 显式 `--path` 已选前门时跳过本节询问(显式 > 推断)。
76
131
 
77
132
  ## Routing Rules
78
133
 
79
- > **⚠️ 路由优先级(硬规则)**:路由按文档顺序从前到后评估,**第一个匹配的路由必须执行**。关键门控:`arch_design_decision` 为 `null` 时 MUST 路由到 `architecture-design`,即使后续路由(spec-writer / contract-builder / build-executor)的其他条件也满足——架构判定是 exploring→specifying 的硬前置,不可跳过。hotfix/tweak 走快速转换,guard 不挂 `arch-design` 维度(`exploring:bridging`/`exploring:approved-for-build` 为空维度),但 **SOP 层仍须过 architecture-design 判断门,不豁免**(v0.9 §26,见 Fast-Path Routing;hotfix 可能正是架构缺陷导致)——判断结果由 architecture-design 子代理写入 `arch_design_decision`,无"自动写 skipped"行为。
134
+ > **⚠️ 路由优先级(硬规则)**:路由按文档顺序从前到后评估,**第一个匹配的路由必须执行**。**前置例外(v0.64.0 Q3/F-15②)**:`workflow_variant` 为 `direct`/`planned` 时**先走 Front Doors 分支**,结构性不经 `exploring:specifying`,本节 `arch_design_decision` 硬前置与下方「不豁免」规则**不适用**(direct/planned 的架构 surface 由 `direct-short-path` 扫描 + `arch-merged-light` 底线接管);`legacy`/`null`/hotfix/tweak/显式 full 照旧。关键门控:`arch_design_decision` 为 `null` 时 MUST 路由到 `architecture-design`,即使后续路由(spec-writer / contract-builder / build-executor)的其他条件也满足——架构判定是 exploring→specifying 的硬前置,不可跳过。hotfix/tweak 走快速转换,guard 不挂 `arch-design` 维度(`exploring:bridging`/`exploring:approved-for-build` 为空维度),但 **SOP 层仍须过 architecture-design 判断门,不豁免**(v0.9 §26,见 Fast-Path Routing;hotfix 可能正是架构缺陷导致)——判断结果由 architecture-design 子代理写入 `arch_design_decision`,无"自动写 skipped"行为。
80
135
 
81
136
  ### Sub-agent Dispatch Protocol (v0.30.0)
82
137
 
@@ -88,6 +143,7 @@ Validate mode against artifact content. If hotfix/tweak criteria not met → upg
88
143
  - **返回即验证(validation gate)**:子代理返回产物后**立即** `tf validate <change-dir>`;FAIL → SendMessage 回**原**子代理修复,通过后才能继续/转换。把格式失败拦截在返回时,而非状态转换时(避免浪费整次执行后再失败)。**build-executor 附加验证(v0.13 §52 B3,SDD/full 模式)**:返回的 diff 中必须包含测试文件(src/test/ 或项目测试目录);零测试文件的实现返回一律 BLOCK,SendMessage 回原子代理按 test-matrix.md / TDD Iron Law 补齐——不得以"手动验证"替代(C1-domain-policy 事件教训)。例外:已显式记录 `test_matrix_skipped=true` + 理由的 change(纯文档/配置类)不要求测试文件
89
144
  - **结果协议**:子代理终态须标注 `FINAL VERDICT: <DONE|BLOCKED|FAIL>`(审查类用 PASS/PASS_WITH_WARNINGS/FAIL);**SendMessage 报告为权威结果**,task-notification.result 仅内部元数据
90
145
  - **子代理状态边界**:子代理 MUST NOT 修改 `.team-flow.yaml` 的 `state`/`workflow` 核心字段(状态转换是主代理专有职责,经 `tf state transition` 执行),只写自己的 `dp_N_*` 决策字段
146
+ - **环境清单注入(v0.63.0;feedback 20260923-013114 S6)**:dispatch 前检查 `.team-flow/environment.md` 是否存在——**存在则全文附入 dispatch prompt**。该文件承载**机器级事实**(grep=ugrep shim → 扫描一律 `command grep`;`tf` CLI 来自 npm 全局包而非插件缓存;Eclipse JDT 写 `target/` → Maven 必须带 `clean`;node 版本可直跑 ui 测试等),避免每个子代理 prompt 重复教学、且防止它们在不知情下踩坑。**嵌套 dispatch 同样注入**:注入时**必须在清单全文之后追加一句元指令**——「请将本清单原样继续附入你的所有下游 dispatch」——因为收到的是清单全文、不是这条规则本身,而子代理不继承主代理的 skills;仅在 workflow-start 侧声明不够(规则到不了第二跳)。(与 `conventions/` 分层互补:conventions = 项目级规范、可跨机器共享;environment = 机器级事实、不入库、不污染他机。)
91
147
 
92
148
  ### Route to need-explorer
93
149
  Change is fuzzy, scope unclear, comparing options, no stable change name.(交互式澄清,主进程执行,见 Sub-agent Dispatch Protocol)
@@ -262,7 +318,8 @@ build-executor 修复 findings 后,workflow-start 必须:
262
318
  - No transition to `abandoned` from `closing` or `abandoned`
263
319
  - No auto-abandon without user confirmation
264
320
  - No merging delta specs from abandoned change
265
- - **No routing to spec-writer without architecture-design gate pass** (v0.9 §26): `arch_design_decision` must be `required` or `skipped` (not `null`). hotfix/tweak 不豁免
321
+ - **No routing to spec-writer without architecture-design gate pass** (v0.9 §26): `arch_design_decision` must be `required` or `skipped` (not `null`). hotfix/tweak 不豁免;**direct/planned 前门结构性不经该门(v0.64.0 Q3)**,架构 surface 由 `direct-short-path` 扫描 + `arch-merged-light` 底线接管
322
+ - **Front-door 主代理直写例外(v0.64.0)**:direct/planned 分支**无子代理**,下条 Artifact Ownership 的「主代理不得直接 Edit/Write」在该两分支不适用(proposal/tasks/light-note/final-review/代码均主代理直写);`legacy`/full/hotfix/tweak 分支该禁令原样生效
266
323
  - **No arch state write without auto-review PASS** (v0.28.1 §36): when `decision: required`, auto-review MUST complete with PASS or PASS_WITH_WARNINGS before writing `arch_design_decision` to yaml. FAIL → loop fix (≤3 rounds) or escalate to human
267
324
  - **No routing past DP-A without user confirmation** (v0.29.0 §37): architecture-design 四步协议完成后,必须经 DP-A 用户确认门(AskUserQuestion)才能路由到 spec-writer。用户选择"需要调整"时,修改必须通过子代理执行,修改后重新 auto-review + 重新 DP-A 确认
268
325
  - **Artifact Ownership — 主代理不得直接修改子代理产物** (v0.29.0 §37): 子代理是其产物的唯一负责人(architecture-design → `architecture/` 目录,spec-writer → `proposal.md`/`specs/`/`design.md`/`tasks.md`,contract-builder → `execution-contract.md`,build-executor → 代码文件)。**tasks.md 的勾选状态属执行期写入区**(v0.49.0 §83.3.4):任务文本归 spec-writer,勾选标记由 build-executor 在 wave 完成时回写(主代理只检查不代写)。**hotfix/tweak 路径的 tasks.md 归属 contract-builder**(v0.22 §85):该路径跳过 spec-writer,若 change 需要任务记录则由 contract-builder 一并产出;默认路径是显式跳过(`tasks_skipped=true` + `tasks_skip_reason`——hotfix 由 contract-builder 写入,tweak 由主代理写入)。主代理(workflow-start)不得通过 Read + Edit/Write 直接修改子代理的产物文件。修改必须通过 `SendMessage` 恢复原子代理(优先)或启动新子代理执行。**v0.39.0 强化**:主代理 MUST NOT 直接 Edit/Write 任何文件 under `changes/<name>/` 或 `.worktrees/`——无论改动量大小,必须通过 SendMessage 委托子代理执行。例外:仅当子代理无法启动且用户明确授权时,主代理可直接修改,但必须在修改后重新触发对应的 review 验证
@@ -275,7 +332,9 @@ workflow-start 负责写入以下字段到 `.team-flow.yaml`:
275
332
 
276
333
  **核心状态字段**:
277
334
  - `state`:当前状态(exploring/specifying/bridging/approved-for-build/executing/debugging/closing/abandoned)
278
- - `workflow`:工作流类型(auto/full/hotfix/tweak)
335
+ - `workflow`:工作流类型(auto/full/hotfix/tweak/**quick/lightweight**,v0.64.0 五值 + auto)
336
+ - `workflow_variant`:前门意图(null/direct/planned/legacy,v0.64.0)——与 `workflow` 是两个维度,禁止混写
337
+ - `planned_arch` / `variant_source` / `variant_direction` / `base_sha` / `model_profile`:v0.64.0 新字段(写入规则见 Front Doors;`workflow_variant` 通用通道仅 exploring 态,升档走 `tf state upgrade`)
279
338
 
280
339
  **决策点字段**(各阶段确认后写入;v0.30.0 修正错位,以各 skill 实际 `tf state set` 为准):
281
340
  - `dp_0_*`:DP-0 用户确认门(workflow-start 本 skill 写入)
@@ -7,7 +7,7 @@ Change is fuzzy, scope unclear, comparing options, no stable change name.
7
7
 
8
8
  ## Route to architecture-design (v0.9 §26, v0.11 §34 审查增强, v0.28.1 §36 主干补强, v0.29.0 §37 DP-A 确认门)
9
9
 
10
- Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer.
10
+ Guard: `arch_design_decision` in `.team-flow.yaml` is `null` → must run before spec-writer. **前门例外(v0.64.0)**:`workflow_variant` 为 direct/planned 时结构性不经本门(见 SKILL.md「Front Doors」),本节协议仅适用 legacy/null/hotfix/tweak/full。
11
11
 
12
12
  **架构门禁(v0.36.0 / v0.36.3)**:`exploring→specifying` 还挂 `arch-readiness` 维度(产品级架构快照 `iterations/vN/architecture.md` 存在 或 ARCH skip 物化 或 在途兜底)。**FAIL 升级路径**:回 orchestrator 的 ARCH 阶段补快照(或确认 ARCH skip 物化);`arch_baseline` 缺失(存量项目)→ WARN 不阻断。判定逻辑见 `scripts/guard/checks/arch-gate-exemptions.mjs`。
13
13
 
@@ -99,7 +99,7 @@ tf state set <change-dir> arch_review_rounds "<N>"
99
99
  tf state set <change-dir> arch_review_report "architecture/auto-review.md"
100
100
  ```
101
101
 
102
- **hotfix / tweak 不豁免**:同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。
102
+ **hotfix / tweak 不豁免**:同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。**direct/planned 前门豁免(v0.64.0 Q3)**:结构性不经本门,架构 surface 由 `direct-short-path` 扫描 + `arch-merged-light` 接管。
103
103
 
104
104
  ### Step 4: DP-A 用户确认门 (v0.29.0 §37)
105
105
 
@@ -204,7 +204,7 @@ AskUserQuestion:
204
204
 
205
205
  ## Route to spec-writer (dispatch sub-agent)
206
206
  Guard: `tf runtime guard check <dir> exploring specifying --json` → fail = BLOCK.
207
- **arch_design_decision must not be null** → fail = BLOCK(architecture-design gate not passed,v0.9 §26)。
207
+ **arch_design_decision must not be null** → fail = BLOCK(architecture-design gate not passed,v0.9 §26)。**前门例外(v0.64.0)**:direct/planned 不经本转换(走 `exploring→approved-for-build` 捷径),本 BLOCK 不适用。
208
208
  User knows what they want, artifacts missing/incomplete.
209
209
 
210
210
  ## Route to contract-builder (dispatch sub-agent)
@@ -248,7 +248,7 @@ User explicitly requests, bug-investigator escalates after 3+ failures AND user
248
248
 
249
249
  - **Hotfix**: Route to contract-builder (minimal), skip need-explorer + spec-writer, guard check `exploring bridging --workflow hotfix`, then `bridging -> approved-for-build`, after DP-3 → build-executor, after → release-archivist (lightweight).
250
250
  - **Tweak**: Route to build-executor (direct edit), skip need-explorer + spec-writer + contract-builder, guard check `exploring approved-for-build --workflow tweak`, after → release-archivist (lightweight).
251
- - **architecture-design 不豁免**(v0.9 §26):hotfix / tweak 同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。
251
+ - **architecture-design 不豁免**(v0.9 §26):hotfix / tweak 同样过 architecture-design 子代理判断门(hotfix 可能正是架构缺陷导致)。**direct/planned 前门豁免(v0.64.0)**:见 SKILL.md「Front Doors」,不在本 Fast-Path 序列内。
252
252
 
253
253
  ## Optional Prototype Handoff
254
254