harnessed 4.32.21 → 4.36.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 (105) hide show
  1. package/README.md +6 -6
  2. package/bin/harnessed-inject-state.mjs +16 -0
  3. package/dist/cli.mjs +1419 -276
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/schemas/index.mjs.map +1 -1
  8. package/manifests/optional/chrome-devtools-mcp.yaml +60 -0
  9. package/manifests/optional/doc-discipline-gate.yaml +54 -0
  10. package/manifests/optional/ecc.yaml +28 -14
  11. package/manifests/tools/exa-mcp.yaml +51 -0
  12. package/manifests/tools/tavily-mcp.yaml +4 -4
  13. package/messages/en.json +11 -0
  14. package/messages/zh-Hans.json +11 -0
  15. package/package.json +1 -1
  16. package/routing/decision_rules.yaml +1 -1
  17. package/workflows/README.md +1 -1
  18. package/workflows/auto/SKILL.md +13 -9
  19. package/workflows/auto/SKILL.zh-Hans.md +13 -9
  20. package/workflows/capabilities.yaml +105 -45
  21. package/workflows/defaults.yaml +8 -2
  22. package/workflows/disciplines/karpathy.yaml +29 -0
  23. package/workflows/disciplines/karpathy.zh-Hans.yaml +27 -0
  24. package/workflows/disciplines/language.yaml +15 -10
  25. package/workflows/disciplines/operational.yaml +1 -1
  26. package/workflows/disciplines/operational.zh-Hans.yaml +1 -1
  27. package/workflows/disciplines/output-style.yaml +10 -2
  28. package/workflows/disciplines/output-style.zh-Hans.yaml +10 -2
  29. package/workflows/disciplines/priority.yaml +15 -2
  30. package/workflows/disciplines/priority.zh-Hans.yaml +15 -2
  31. package/workflows/discuss/auto/SKILL.md +4 -4
  32. package/workflows/discuss/auto/SKILL.zh-Hans.md +4 -4
  33. package/workflows/discuss/auto/workflow.yaml +16 -3
  34. package/workflows/discuss/phase/SKILL.md +1 -1
  35. package/workflows/discuss/phase/SKILL.zh-Hans.md +1 -1
  36. package/workflows/discuss/strategic/SKILL.md +1 -1
  37. package/workflows/discuss/strategic/SKILL.zh-Hans.md +1 -1
  38. package/workflows/discuss/subtask/SKILL.md +1 -1
  39. package/workflows/discuss/subtask/SKILL.zh-Hans.md +1 -1
  40. package/workflows/judgments/parallelism-gate.yaml +11 -6
  41. package/workflows/judgments/phase-gate.yaml +5 -1
  42. package/workflows/judgments/stage-routing.yaml +21 -26
  43. package/workflows/judgments/strategic-gate.yaml +30 -0
  44. package/workflows/judgments/user-overrides.yaml +7 -3
  45. package/workflows/judgments/web-search-routing.yaml +3 -3
  46. package/workflows/judgments/web-testing-routing.yaml +24 -7
  47. package/workflows/plan/architecture/SKILL.md +7 -3
  48. package/workflows/plan/architecture/SKILL.zh-Hans.md +7 -3
  49. package/workflows/plan/auto/SKILL.md +11 -7
  50. package/workflows/plan/auto/SKILL.zh-Hans.md +11 -7
  51. package/workflows/plan/phase/SKILL.md +7 -3
  52. package/workflows/plan/phase/SKILL.zh-Hans.md +7 -3
  53. package/workflows/research/SKILL.md +24 -9
  54. package/workflows/research/SKILL.zh-Hans.md +23 -9
  55. package/workflows/research/workflow.yaml +43 -3
  56. package/workflows/retro/SKILL.md +7 -3
  57. package/workflows/retro/SKILL.zh-Hans.md +7 -3
  58. package/workflows/role-prompts.yaml +28 -21
  59. package/workflows/role-prompts.zh-Hans.yaml +22 -17
  60. package/workflows/ship/auto/SKILL.md +11 -7
  61. package/workflows/ship/auto/SKILL.zh-Hans.md +11 -7
  62. package/workflows/ship/preflight/SKILL.md +7 -3
  63. package/workflows/ship/preflight/SKILL.zh-Hans.md +7 -3
  64. package/workflows/task/auto/SKILL.md +26 -16
  65. package/workflows/task/auto/SKILL.zh-Hans.md +26 -16
  66. package/workflows/task/auto/workflow.yaml +11 -4
  67. package/workflows/task/clarify/SKILL.md +1 -1
  68. package/workflows/task/clarify/SKILL.zh-Hans.md +1 -1
  69. package/workflows/task/code/SKILL.md +7 -3
  70. package/workflows/task/code/SKILL.zh-Hans.md +7 -3
  71. package/workflows/task/deliver/SKILL.md +53 -35
  72. package/workflows/task/deliver/SKILL.zh-Hans.md +54 -36
  73. package/workflows/task/deliver/workflow.yaml +32 -24
  74. package/workflows/task/test/SKILL.md +7 -3
  75. package/workflows/task/test/SKILL.zh-Hans.md +7 -3
  76. package/workflows/task/test/workflow.yaml +13 -0
  77. package/workflows/verify/auto/SKILL.md +12 -8
  78. package/workflows/verify/auto/SKILL.zh-Hans.md +12 -8
  79. package/workflows/verify/auto/workflow.yaml +3 -1
  80. package/workflows/verify/code-review/SKILL.md +7 -3
  81. package/workflows/verify/code-review/SKILL.zh-Hans.md +7 -3
  82. package/workflows/verify/design/SKILL.md +24 -10
  83. package/workflows/verify/design/SKILL.zh-Hans.md +24 -10
  84. package/workflows/verify/design/workflow.yaml +36 -7
  85. package/workflows/verify/eval-review/SKILL.md +7 -3
  86. package/workflows/verify/eval-review/SKILL.zh-Hans.md +7 -3
  87. package/workflows/verify/multispec/SKILL.md +17 -10
  88. package/workflows/verify/multispec/SKILL.zh-Hans.md +16 -10
  89. package/workflows/verify/multispec/workflow.yaml +7 -5
  90. package/workflows/verify/paranoid/SKILL.md +7 -3
  91. package/workflows/verify/paranoid/SKILL.zh-Hans.md +7 -3
  92. package/workflows/verify/progress/SKILL.md +7 -3
  93. package/workflows/verify/progress/SKILL.zh-Hans.md +7 -3
  94. package/workflows/verify/qa/SKILL.md +33 -14
  95. package/workflows/verify/qa/SKILL.zh-Hans.md +33 -14
  96. package/workflows/verify/qa/workflow.yaml +55 -2
  97. package/workflows/verify/security/SKILL.md +7 -3
  98. package/workflows/verify/security/SKILL.zh-Hans.md +7 -3
  99. package/workflows/verify/simplify/SKILL.md +7 -3
  100. package/workflows/verify/simplify/SKILL.zh-Hans.md +7 -3
  101. package/workflows/verify/validate-phase/SKILL.md +7 -3
  102. package/workflows/verify/validate-phase/SKILL.zh-Hans.md +7 -3
  103. package/manifests/skill-packs/karpathy-skills.yaml +0 -65
  104. package/manifests/tools/chrome-devtools-mcp.yaml +0 -64
  105. package/manifests/tools/ralph-loop.yaml +0 -46
@@ -1,21 +1,22 @@
1
1
  ---
2
2
  name: task-deliver
3
3
  description: |
4
- task-deliver workflow v3 — Stage ③.d 子任务交付 sub-workflow (ralph-loop COMPLETE
5
- wrapper + Agent Teams conditional escalation + R20.10 explicit max_iterations_exceeded
6
- fallback)。2-phase composition: 01-deliver (ralph-loop SDK wrapper with completion_promise
7
- verbatim "COMPLETE" + parallelism judgments.parallelism-gate.ralph-loop-wrapper.fires +
4
+ task-deliver workflow v3 — Stage ③.d 子任务交付 sub-workflow (harnessed 自有 completion-gate
5
+ + Agent Teams conditional escalation + R20.10 explicit max_iterations_exceeded
6
+ fallback)。2-phase composition: 01-deliver (completion-gate with completion_promise
7
+ verbatim "COMPLETE" + parallelism judgments.parallelism-gate.completion-gate-wrapper.fires +
8
8
  fallback emit_warning_and_halt exit_code 1) → 02-progress-mark (Claude Code plugin
9
9
  /plan mark subtask complete in progress.md)。
10
10
  schema_version: harnessed.workflow.v3 with disciplines_applied [6] + tools_available
11
- [ralph-loop, agent-teams-create, agent-teams-send-message, agent-teams-shutdown,
11
+ [completion-gate, verification-before-completion, agent-teams-create,
12
+ agent-teams-send-message, agent-teams-shutdown,
12
13
  planning-with-files]. Triggered by harnessed CLI `harnessed task-deliver --task <text>`
13
14
  or slash command `/task-deliver` after `harnessed setup`.
14
15
  trigger_phrases:
15
16
  - "deliver this subtask"
16
17
  - "task-deliver workflow"
17
18
  - "Stage 3 deliver"
18
- - "ralph-loop COMPLETE"
19
+ - "completion gate COMPLETE"
19
20
  - "跑 task-deliver"
20
21
  ---
21
22
 
@@ -25,36 +26,46 @@ trigger_phrases:
25
26
 
26
27
  2-phase 子工作流,将 CLAUDE.md Stage ③.d 子任务交付纪律映射到 harnessed runtime,
27
28
  完整采用 `harnessed.workflow.v3` schema(Phase v3.0-3.4 W0 T3.4.W0.9 — D-09 L0
28
- Discipline Substrate + D-10 ralph-loop SDK wrapper + D-11 Agent Teams 升级 5 触发
29
+ Discipline Substrate + D-10 完成保证 + D-11 Agent Teams 升级 5 触发
29
30
  OR-chain + R20.10 explicit max_iterations_exceeded handler)。
30
31
 
31
32
  | phase | id | upstream | model | capability / args / parallelism / fallback |
32
33
  | ----- | -- | -------- | ----- | ------------------------------------------ |
33
- | 1 | `01-deliver` | ralph-loop | haiku | `{{ capabilities.ralph-loop.cmd }}` + `args: {completion_promise: COMPLETE, max_iterations: ...}` + `parallelism: judgments.parallelism-gate.ralph-loop-wrapper.fires` + `fallback.max_iterations_exceeded.action: emit_warning_and_halt` |
34
+ | 1 | `01-deliver` | (无 — harnessed 自有 CLI) | haiku | `{{ capabilities.completion-gate.cmd }}` + `args: {completion_promise: COMPLETE, max_iterations: ...}` + `parallelism: judgments.parallelism-gate.completion-gate-wrapper.fires` + `fallback.max_iterations_exceeded.action: emit_warning_and_halt` |
34
35
  | 2 | `02-progress-mark` | planning-with-files | haiku | `{{ capabilities.planning-with-files.cmd }}` / `invokes: /plan` / `artifacts_expected: [progress.md]` |
35
36
 
36
37
  每阶段配置从 `workflows/task/deliver/workflow.yaml` 加载;engine.runRouting 通过
37
38
  `@anthropic-ai/claude-agent-sdk` 0.3.142+ 将每个阶段 spawn 为 sub-agent。
38
39
 
39
- ## Phase 01 ralph-loop COMPLETE wrapper (R20.10 + D-10 + ADR 0011)
40
+ ## Phase 01 完成闸门 (R20.10 + D-10 + ADR 0039)
40
41
 
41
- ralph-loop SDK wrapper 保 completion-promise verbatim string `"COMPLETE"`——sub-task
42
- 被认为完成的判据是子任务输出包含 verbatim "COMPLETE" string(NOT 启发式 / NOT
43
- LLM-as-judge)。Sister capabilities.yaml `ralph-loop` entry impl `bundled-skill` +
44
- `sdk_ref: src/workflow/lib/ralphLoop.ts`(Phase 2.2 v0.2.0 ship)。
42
+ 完成判据是子任务输出包含 verbatim `"COMPLETE"` string(NOT 启发式 / NOT LLM-as-judge)。
43
+ 4.36.0 起这条保证**完全内置**,跑在 harnessed 自己的 live path 上,不依赖任何上游 plugin:
45
44
 
46
- 交互面三级偏好链(v4.15.0 / ADR 0036):ralph-loop plugin 优先(fail-closed 逐字匹配 +
47
- 硬 max-iterations)→ 未装时 native `/goal` gate(Claude Code 2.1.139+ / Codex 双平台内置,
48
- 条件句写 verbatim `<promise>COMPLETE</promise>` + turn 上界)→ `/goal` 亦不可用时 self-loop
49
- 兜底。SDK 路径(ralphLoopWrap 硬上界)不参与该链,始终 verbatim 匹配。
45
+ - `harnessed checkpoint complete <sub> --result-file <path>` —— fail-CLOSED,同时校验
46
+ 声明的 `artifacts_expected` 产物存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 /
47
+ 测试文件未被删除)、结果含 verbatim `<promise>COMPLETE</promise>`(或结构化 COMPLETE
48
+ 状态)。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。
49
+ `--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
50
+ - `harnessed checkpoint fail <sub> --failing-tests <n>` —— 记录本次尝试,并在命中停机
51
+ 条件时打印 `BUDGET-EXHAUSTED`(已用尝试次数 vs `workflows/defaults.yaml
52
+ ralph_max_iterations`)/ `NO-PROGRESS`(连续 N 次无进展;失败测试数,省略该 flag 时退回
53
+ 证据产物摘要)/ `BREAK-LOOP`(该 sub 失败次数达阈值)。
54
+ - **仅当**这三条停机理由都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、
55
+ 修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
50
56
 
51
- ### Parallelism — ralph-loop 正交 wrapper
57
+ 这三条停机理由 == 上游 `/ralph-loop --max-iterations` + `--completion-promise` 曾经提供的
58
+ 东西,只是长在自有路径上、没有「装没装」的问题(ADR 0039 supersedes ADR 0036 的
59
+ plugin → `/goal` → self-loop 三级链)。Sister capabilities.yaml `completion-gate` entry
60
+ impl `harnessed-bundled` + `sdk_ref: src/workflow/lib/ralphLoop.ts`。
52
61
 
53
- `parallelism: judgments.parallelism-gate.ralph-loop-wrapper.fires` ref——遵循 R20.10
54
- + D-10,ralph-loop 是**正交 wrapper**,套在 subagent-default / agent-teams-upgrade /
62
+ ### Parallelism — 完成闸门正交 wrapper
63
+
64
+ `parallelism: judgments.parallelism-gate.completion-gate-wrapper.fires` ref——遵循 R20.10
65
+ + D-10,完成闸门是**正交 wrapper**,套在 subagent-default / agent-teams-upgrade /
55
66
  main-session-fallback 任意 1 种模式外层(NOT 互斥触发器,而是 parallelism-gate.yaml
56
- L42-45 中的 `wraps:` 正交字段)。Runtime engine 评估 wrapping mode 后 spawn 相应
57
- 执行单元并套 ralph-loop completion check。
67
+ 中的 `wraps:` 正交字段)。Runtime engine 评估 wrapping mode 后 spawn 相应
68
+ 执行单元并套 completion check。
58
69
 
59
70
  ### Agent Teams 条件性升级 (D-11 + agent-teams.md 5 OR-chain)
60
71
 
@@ -66,18 +77,20 @@ L42-45 中的 `wraps:` 正交字段)。Runtime engine 评估 wrapping mode 后
66
77
  5. `fullstack_three_way == true` — 全栈三路协同
67
78
 
68
79
  任 1 触发 → 升级 subagent fan-out → Agent Teams Pattern A/B/C。清理是强制的,
69
- 遵循 agent-teams.md 防呆清单(SendMessage shutdown_request + TeamDelete)——属于
70
- engine 级别的连接,NOT yaml schema 的职责范围。
80
+ 遵循 agent-teams.md 防呆清单(lead 按名请求每个 teammate shut down;CC 2.1.178+ 已无
81
+ teardown 工具,团目录在 session 退出时自动清理——剩下的纪律是别把 teammate 落在运行态)
82
+ ——属于 engine 级别的连接,NOT yaml schema 的职责范围。
71
83
 
72
84
  ### R20.10 explicit max_iterations_exceeded handler(非静默中止)
73
85
 
74
86
  phase.fallback.max_iterations_exceeded = `{action: emit_warning_and_halt, message,
75
87
  exit_code: 1}`——通过 FallbackMaxIterationsExceeded Type.Literal(
76
88
  'emit_warning_and_halt')(workflow.ts L70-77)做 schema 级强制约束。Sister Phase 2.4
77
- W1.2 fallbackHandlers.ts engine.ts wire——ralph-loop 撞 max_iterations 时显式 emit
78
- warning + halt with exit_code 1,NOT 静默中止/继续执行。
89
+ W1.2 fallbackHandlers.ts engine.ts wire——撞 max_iterations 时显式 emit
90
+ warning + halt with exit_code 1,NOT 静默中止/继续执行。交互面的对应物是
91
+ `checkpoint fail` 打印的 `BUDGET-EXHAUSTED`。
79
92
 
80
- Brief enforcement W0.9: ✅ ralph-loop completion_promise COMPLETE / ✅ parallelism-gate
93
+ Brief enforcement W0.9: ✅ completion-gate completion_promise COMPLETE / ✅ parallelism-gate
81
94
  ref / ✅ R20.10 explicit max_iterations_exceeded handler。
82
95
 
83
96
  ## Phase 02 progress-mark planning-with-files (D-15 + Q-AUDIT-5a Option A)
@@ -101,24 +114,29 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
101
114
  Code 内部会阻塞 session)。
102
115
 
103
116
  1. Bash: `harnessed prompt task-deliver --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
104
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
117
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
118
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete task-deliver --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
119
+ - 若被拦下,跑 `harnessed checkpoint fail task-deliver --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
120
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
105
121
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
106
- 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete task-deliver --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
122
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete task-deliver --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
123
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail task-deliver --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
107
124
 
108
- <!-- harnessed-generated:v4.9.3 -->
125
+ <!-- harnessed-generated:v4.12.0 -->
109
126
 
110
127
  ## References
111
128
 
112
129
  - D-09 — L0 Discipline Substrate always-on (6 disciplines)
113
- - D-10 — ralph-loop 真接 SDK wrapper (NOT mock reference; v0.2.0 ship)
130
+ - D-10 — 完成保证真接 SDK wrapper (NOT mock reference; v0.2.0 ship)
114
131
  - D-11 — Agent Teams 升级 5 触发 OR-chain per bundled parallelism-gate rules
115
- - R20.10 — ralph-loop max_iterations_exceeded explicit emit_warning_and_halt
116
- (acceptance c "NOT silent abort"); ralph-loop 正交 wrapper wraps 3 mode
132
+ - R20.10 — max_iterations_exceeded explicit emit_warning_and_halt
133
+ (acceptance c "NOT silent abort"); 完成闸门正交 wrapper wraps 3 mode
117
134
  - D-02 — SKILL.md `name:` bare slash cmd (`task-deliver` NOT `task/deliver`) per ADR 0030
118
- - ADR 0011 — SDK + ralph-loop integration v0.2.0 baseline
119
- - `workflows/judgments/parallelism-gate.yaml` triggers.ralph-loop-wrapper +
135
+ - ADR 0011 — SDK + 完成保证 integration v0.2.0 baseline
136
+ - ADR 0039 — 完成保证内置化 + 摘除上游 `/ralph-loop` 依赖(supersedes ADR 0036)
137
+ - `workflows/judgments/parallelism-gate.yaml` triggers.completion-gate-wrapper +
120
138
  agent-teams-upgrade + subagent-default + main-session-fallback
121
- - `workflows/capabilities.yaml` — ralph-loop + agent-teams-{create,send-message,shutdown}
139
+ - `workflows/capabilities.yaml` — completion-gate + agent-teams-{create,send-message,shutdown}
122
140
  + planning-with-files entries
123
141
  - `workflows/defaults.yaml` — ralph_max_iterations.task-deliver.* values (T3.4.W2.2 followup)
124
142
  - `docs/WORKFLOW.md` — 4-stage workflow mermaid + Stage ③ Execute 章节
@@ -1,19 +1,23 @@
1
1
  # workflows/task/deliver/workflow.yaml — Phase v3.0-3.4 W0 T3.4.W0.9
2
- # (D-09 + D-10 + D-11 + R20.10 + ADR 0011 ralph-loop 真接 SDK wrapper)
2
+ # (D-09 + D-10 + D-11 + R20.10 + ADR 0011 SDK wrapper)
3
3
  #
4
- # Stage ③.d 子任务交付 — ralph-loop COMPLETE wrapper 保 completion-promise verbatim
5
- # "COMPLETE" (R20.10 + D-10 v0.2.0 ralph-loop SDK pattern)。Parallelism: subagent
4
+ # Stage ③.d 子任务交付 — completion-gate 保 completion-promise verbatim
5
+ # "COMPLETE" (R20.10 + D-10)。Parallelism: subagent
6
6
  # default fan-out OR Agent Teams 升级 (5 触发 OR-chain per bundled Agent Teams
7
7
  # routing + D-11)。02-progress-mark: planning-with-files /plan 更新 progress.md 标记完成。
8
8
  #
9
- # v4.15.0 (ADR 0036) 交互面三级偏好链: ralph-loop plugin 优先 → 未装时 native /goal
10
- # gate (CC 2.1.139+ / Codex) → self-loop 兜底。SDK 路径 (ralphLoopWrap 硬上界) 不变;
11
- # defaults.ralph_max_iterations 插值语义不变(/goal 分支映射为条件句 turn 上界)。
9
+ # 4.36.0 — 上游 ralph-loop plugin 依赖摘除。完成保证 4.35.0 起完全内置并跑在 harnessed
10
+ # 自己的 live path 上:`harnessed checkpoint complete <sub> --result-file <path>`
11
+ # (evidence artifacts / TDD boundary / verbatim promise 三重 fail-closed) +
12
+ # `harnessed checkpoint fail <sub> --failing-tests <n>` (BUDGET-EXHAUSTED /
13
+ # NO-PROGRESS / BREAK-LOOP)。这取代 ADR 0036 的 plugin → /goal → self-loop 三级链
14
+ # (该链的存在理由就是 plugin 可用性,依赖摘掉后不再需要)。SDK 路径 (ralphLoopWrap 硬上界,
15
+ # harnessed 自有代码) 不变;defaults.ralph_max_iterations 键名沿用不改名 (见 defaults.yaml)。
12
16
  #
13
17
  # Brief enforcement (W0.9 spec MUST include):
14
- # - ralph-loop completion_promise = COMPLETE (R20.10 verbatim acceptance string)
15
- # - parallelism-gate ref: judgments.parallelism-gate.ralph-loop-wrapper.fires
16
- # (R20.10 ralph-loop 正交 wraps subagent-default / agent-teams-upgrade / main-session-fallback)
18
+ # - completion_promise = COMPLETE (R20.10 verbatim acceptance string)
19
+ # - parallelism-gate ref: judgments.parallelism-gate.completion-gate-wrapper.fires
20
+ # (R20.10 正交 wraps subagent-default / agent-teams-upgrade / main-session-fallback)
17
21
  # - Agent Teams route conditional via on[] clause when 5 escalation triggers fire
18
22
  # - R20.10 explicit max_iterations_exceeded handler:
19
23
  # {action: emit_warning_and_halt, message, exit_code: 1} — NOT silent abort
@@ -21,8 +25,8 @@
21
25
  #
22
26
  # Sister refs:
23
27
  # - .planning/phase-v3.0-3.2/RESEARCH-workflows.md § Area 2 task/deliver sub yaml example
24
- # - workflows/judgments/parallelism-gate.yaml triggers.ralph-loop-wrapper (Phase 2.3 W0.2 SHIPPED)
25
- # - workflows/capabilities.yaml ralph-loop + agent-teams-{create,send-message,shutdown} +
28
+ # - workflows/judgments/parallelism-gate.yaml triggers.completion-gate-wrapper (Phase 2.3 W0.2 SHIPPED)
29
+ # - workflows/capabilities.yaml completion-gate + agent-teams-{create,send-message,shutdown} +
26
30
  # planning-with-files (Phase 2.3 W0.1 + 3.3 W0.2 SHIPPED)
27
31
  # - workflows/judgments/parallelism-gate.yaml — 5 升级触发 OR-chain
28
32
  # (teammate_send_message_needed / subagent_context_overflow / shared_task_list /
@@ -36,17 +40,17 @@
36
40
  schema_version: harnessed.workflow.v3
37
41
  workflow: task-deliver
38
42
  description: |
39
- Stage ③.d 子任务交付 — ralph-loop COMPLETE wrapper 保 completion-promise verbatim
40
- "COMPLETE" (R20.10 + D-10 v0.2.0 ralph-loop SDK pattern)。Parallelism subagent
43
+ Stage ③.d 子任务交付 — completion-gate 保 completion-promise verbatim
44
+ "COMPLETE" (R20.10 + D-10;harnessed 自有 checkpoint CLI,无上游 plugin)。Parallelism subagent
41
45
  default fan-out OR Agent Teams 升级 (5 触发 OR-chain per bundled Agent Teams routing
42
46
  + D-11)。R20.10 explicit max_iterations_exceeded handler: emit_warning_and_halt
43
47
  exit_code 1 (NOT silent abort, sister Phase 2.4 W1.2 fallbackHandlers.ts engine.ts
44
- wire pattern)。Cleanup mandatory when Agent Teams escalation path fires (shutdown_request
45
- + TeamDelete per bundled Agent Teams cleanup discipline)。
48
+ wire pattern)。Cleanup mandatory when Agent Teams escalation path fires (按名请求每个
49
+ teammate shut down per bundled Agent Teams cleanup discipline; 团目录 session 退出自动清理)。
46
50
 
47
51
  disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
48
52
  tools_available:
49
- - ralph-loop
53
+ - completion-gate
50
54
  - verification-before-completion
51
55
  - agent-teams-create
52
56
  - agent-teams-send-message
@@ -54,26 +58,30 @@ tools_available:
54
58
  - planning-with-files
55
59
 
56
60
  phases:
61
+ # `upstream:` is deliberately ABSENT here (schema: Optional). Every other phase's
62
+ # `upstream:` names the third-party system that supplies the capability
63
+ # (superpowers / planning-with-files / gsd / gstack). This phase's capability is
64
+ # harnessed's own `checkpoint` CLI, so there is no upstream to name — asserting one
65
+ # would be the same false-dependency claim 4.36.0 removes.
57
66
  - id: 01-deliver
58
- name: deliver (ralph-loop COMPLETE wrapper + Agent Teams conditional escalation)
59
- upstream: ralph-loop
60
- capability: '{{ capabilities.ralph-loop.cmd }}'
67
+ name: deliver (completion-gate + Agent Teams conditional escalation)
68
+ capability: '{{ capabilities.completion-gate.cmd }}'
61
69
  model: haiku
62
70
  args:
63
71
  completion_promise: COMPLETE
64
72
  max_iterations: '{{ defaults.ralph_max_iterations.task-deliver.01-deliver }}'
65
- parallelism: judgments.parallelism-gate.ralph-loop-wrapper.fires
73
+ parallelism: judgments.parallelism-gate.completion-gate-wrapper.fires
66
74
  on:
67
75
  - if: 'subtask.lines >= 20 and subtask.type != "single_command_query"'
68
- invoke: '{{ capabilities.ralph-loop.cmd }}'
76
+ invoke: '{{ capabilities.completion-gate.cmd }}'
69
77
  - if: 'subtask.lines < 20 or subtask.type == "single_command_query"'
70
78
  action: skip
71
79
  fallback:
72
80
  max_iterations_exceeded:
73
81
  action: emit_warning_and_halt
74
- message: 'ralph-loop max-iterations exceeded for task-deliver. Sub-task likely incomplete — explicit halt per R20.10 (NOT silent abort).'
82
+ message: 'attempt budget exhausted for task-deliver (BUDGET-EXHAUSTED). Sub-task likely incomplete — explicit halt per R20.10 (NOT silent abort).'
75
83
  exit_code: 1
76
- # v3.8.0 P1 — ralph-loop COMPLETE + Agent Teams escalation phase, full 3-RULES inject.
84
+ # v3.8.0 P1 — completion-gate COMPLETE + Agent Teams escalation phase, full 3-RULES inject.
77
85
  injects_rules: [escalation, transparent-skip, agent-teams-prevention]
78
86
 
79
87
  - id: 01b-verify-evidence
@@ -81,7 +89,7 @@ phases:
81
89
  upstream: superpowers
82
90
  capability: '{{ capabilities.verification-before-completion.cmd }}'
83
91
  model: haiku
84
- # v13.0 P42 — superpowers-native per-claim 证据门; 在 ralph-loop COMPLETE (01-deliver)
92
+ # v13.0 P42 — superpowers-native per-claim 证据门; 在 completion-gate COMPLETE (01-deliver)
85
93
  # 之后、progress-mark 标记完成之前强制贴验证 output (evidence before claims)。
86
94
  artifacts_expected: [verification-evidence.md]
87
95
 
@@ -78,11 +78,15 @@ Do NOT pipe to `harnessed run task-test` — that is the CI/headless path (in-pr
78
78
  that blocks the session inside Claude Code).
79
79
 
80
80
  1. Bash: `harnessed prompt task-test --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
81
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
81
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
82
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete task-test --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
83
+ - if it blocks, run `harnessed checkpoint fail task-test --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
84
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
82
85
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
83
- 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete task-test --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
86
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete task-test --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
87
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail task-test --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
84
88
 
85
- <!-- harnessed-generated:v4.9.3 -->
89
+ <!-- harnessed-generated:v4.12.0 -->
86
90
 
87
91
  ## References
88
92
 
@@ -77,11 +77,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
77
77
  Code 内部会阻塞 session)。
78
78
 
79
79
  1. Bash: `harnessed prompt task-test --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
80
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
80
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
81
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete task-test --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
82
+ - 若被拦下,跑 `harnessed checkpoint fail task-test --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
83
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
81
84
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
82
- 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete task-test --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
85
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete task-test --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
86
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail task-test --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
83
87
 
84
- <!-- harnessed-generated:v4.9.3 -->
88
+ <!-- harnessed-generated:v4.12.0 -->
85
89
 
86
90
  ## 参考资料
87
91
 
@@ -44,3 +44,16 @@ phases:
44
44
  # v3.8.0 P1 — TDD core-logic phase, opts into full 3-RULES inject (escalation
45
45
  # may fire when test failures trigger /diagnosing-bugs handoff or subagent context overflow).
46
46
  injects_rules: [escalation, transparent-skip, agent-teams-prevention]
47
+ # TDD 跳过声明协议 machine-ization — sister CLAUDE.md「无跳过声明且未执行测试验证,
48
+ # 主会话将拒绝验收」. ONE artifact both branches must produce:
49
+ # - gate fired → red→green record (failing test first, then the pass)
50
+ # - gate skipped (crud / ui_polish / docs_only per tdd-gate.skips_when)
51
+ # → explicit `SKIPPED — <reason>` declaration
52
+ # `artifacts_expected` is AND semantics (every declared path must exist), so the
53
+ # two-way choice lives INSIDE the file content, not in the list. Reuses the
54
+ # existing fail-closed guard (src/checkpoint/evidence.ts checkArtifacts →
55
+ # src/cli/checkpoint.ts BLOCKED exit 1; `--force` records evidence_status=
56
+ # overridden = audited escape hatch). Dedicated name on purpose: reusing
57
+ # findings.md (discuss-phase / discuss-strategic) would let an unrelated upstream
58
+ # artifact satisfy this gate via the 4.22.1 bare-name .planning/phases/*/ probe.
59
+ artifacts_expected: [tdd-evidence.md]
@@ -31,7 +31,7 @@ via stage-routing.yaml):
31
31
  | parallel | `paranoid` | `judgments.stage-routing.verify-paranoid-critical.fires` | parallel | phase.is_critical_module == true |
32
32
  | parallel | `qa` | `judgments.stage-routing.verify-qa-ui.fires` | parallel | phase.has_ui_changes == true |
33
33
  | parallel | `security` | `judgments.stage-routing.verify-security-secrets.fires` | parallel | phase.has_auth_or_secrets == true |
34
- | parallel | `design` | `judgments.stage-routing.verify-design-changes.fires` | parallel | phase.has_design_changes == true |
34
+ | parallel | `design` | `judgments.web-design-routing.design-review-post.fires` | parallel | phase.has_design_changes == true |
35
35
  | parallel | `multispec` | `judgments.stage-routing.verify-multispec-critical-release.fires` | parallel | is_critical_release == true (Pattern C 4-specialist Agent Team) |
36
36
  | 99 (serial) | `simplify` | (unconditional — 末尾 tail) | serial | always — code-simplifier 末尾移除重复 / 多余逻辑 |
37
37
 
@@ -80,22 +80,26 @@ Do NOT pipe to `harnessed run verify` — that is the CI/headless path (in-proce
80
80
  that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
81
81
 
82
82
  1. If the clarification criteria fire for "$ARGUMENTS" (≥2 approaches / core algorithm / API contract / high error cost), clarify interactively in THIS session first (AskUserQuestion) and lock decisions; otherwise transparent-skip. Produce a locked spec.
83
- 2. Bash: `harnessed gates verify --task "<locked spec>" --skip-sub discuss` → parse the JSON `{fire, skip, parallelism}`. This is the plan SoT (no spawn). Keep the verbatim JSON.
83
+ 1b. Bash: `harnessed facts verify --out .harnessed-facts.json` → it lists ONLY the facts this stage’s gates actually read: deterministic ones already filled (change size / files touched / stage, from git), judgement calls left `null` with a one-line hint of what to judge. Edit the file and replace each `null` in `facts` with your honest answer from the locked spec — leave one null only if you genuinely cannot judge it (it then falls back to the built-in default). Do NOT skip this step and do NOT invent facts the command did not ask for.
84
+ 2. Bash: `harnessed gates verify --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → parse the JSON `{fire, skip, parallelism}`. This is the plan SoT (no spawn). Keep the verbatim JSON.
84
85
  3. Bash: `harnessed checkpoint start verify --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
85
- 4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team (`TeamCreate` → `Agent(name, team_name, …)` per sub with its `harnessed prompt <sub>` prompt → coordinate via `SendMessage` → `SendMessage shutdown_request` + `TeamDelete`). Still checkpoint each sub (`complete` / `fail`) as below.
86
+ 4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team. There is NO create step and no create tool — spawn one background teammate per fired sub with `Agent(name: <sub>, run_in_background: true, prompt: <that sub's `harnessed prompt <sub>` prompt>)` and the team forms implicitly on the FIRST spawn, with this session as lead (the `team_name` input is accepted but ignored — the name is session-derived). Coordinate via `SendMessage`; when a sub is finished, ask that teammate to shut down BY NAME (e.g. "ask the verify-qa teammate to shut down"). Still checkpoint each sub (`complete` / `fail`) as below.
86
87
  5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
87
- - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
88
+ - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed facts <sub> --out .harnessed-facts.json` (fill the nulls) → `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
88
89
  - **Else (leaf sub):**
89
90
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
90
- b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
91
+ b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
92
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete <sub> --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
93
+ - if it blocks, run `harnessed checkpoint fail <sub> --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
94
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
91
95
  c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
92
- d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it, or pass `--force` only to deliberately override.
93
- e. If the sub cannot reach COMPLETE (max_iterations exhausted / unrecoverable error): Bash `harnessed checkpoint fail <sub> --summary "<why>"`, then STOP and report to the user.
96
+ d. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete <sub> --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. On a non-zero exit the sub is NOT done — re-spawn to close the gap, or pass `--force` only to deliberately override (records `evidence_status=overridden`, an audited override rather than a silent pass).
97
+ e. If the complete gate blocked: Bash `harnessed checkpoint fail <sub> --failing-tests <n>` to record the attempt (omit the flag when the sub has no tests — the evidence-artifact digest is the fallback progress metric). It prints `BUDGET-EXHAUSTED` (attempts spent vs `workflows/defaults.yaml ralph_max_iterations`), `NO-PROGRESS` (no improvement for N consecutive attempts) or `BREAK-LOOP` (this sub failed >= the threshold) once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope, fix the blocker, or escalate to the user, and report it.
94
98
  6. After all fired subs are `done` (or recorded `failed`), Bash `harnessed status --recover` to confirm the ledger and report a per-sub fired/skipped/done/failed summary to the user.
95
99
 
96
100
  **If you lose context (compaction / resume):** run `harnessed status --recover` first — it reads the ledger and prints "you are here, this is next" so you resume at the first `pending` sub instead of restarting. If the ledger is empty, re-run steps 2-3.
97
101
 
98
- <!-- harnessed-generated:v4.9.3 -->
102
+ <!-- harnessed-generated:v4.12.0 -->
99
103
 
100
104
  ## References
101
105
 
@@ -31,7 +31,7 @@ via stage-routing.yaml):
31
31
  | parallel | `paranoid` | `judgments.stage-routing.verify-paranoid-critical.fires` | parallel | phase.is_critical_module == true |
32
32
  | parallel | `qa` | `judgments.stage-routing.verify-qa-ui.fires` | parallel | phase.has_ui_changes == true |
33
33
  | parallel | `security` | `judgments.stage-routing.verify-security-secrets.fires` | parallel | phase.has_auth_or_secrets == true |
34
- | parallel | `design` | `judgments.stage-routing.verify-design-changes.fires` | parallel | phase.has_design_changes == true |
34
+ | parallel | `design` | `judgments.web-design-routing.design-review-post.fires` | parallel | phase.has_design_changes == true |
35
35
  | parallel | `multispec` | `judgments.stage-routing.verify-multispec-critical-release.fires` | parallel | is_critical_release == true(Pattern C 4-specialist Agent Team) |
36
36
  | 99 (serial) | `simplify` | (无条件 — 末尾收尾) | serial | 始终触发 — code-simplifier 末尾移除重复 / 多余逻辑 |
37
37
 
@@ -79,22 +79,26 @@ Sister `workflows/capabilities.yaml`:
79
79
  session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
80
80
 
81
81
  1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清(AskUserQuestion)并锁决策;否则透明 skip。产出 locked spec。
82
- 2. Bash: `harnessed gates verify --task "<locked spec>" --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。
82
+ 1b. Bash: `harnessed facts verify --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
83
+ 2. Bash: `harnessed gates verify --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。
83
84
  3. Bash: `harnessed checkpoint start verify --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
84
- 4. 若 `parallelism.escalate_to_teams === true`:读 `~/.claude/rules/agent-teams.md`,然后把 fired subs 作为 Agent Team 驱动(`TeamCreate` → 每个 sub `Agent(name, team_name, …)` + 其 `harnessed prompt <sub>` prompt → 用 `SendMessage` 协调 → `SendMessage shutdown_request` + `TeamDelete`)。每个 sub 仍按下方 checkpoint(`complete` / `fail`)。
85
+ 4. 若 `parallelism.escalate_to_teams === true`:读 `~/.claude/rules/agent-teams.md`,然后把 fired subs 作为 Agent Team 驱动。**没有建团步骤、也没有建团工具** —— 对每个 fired sub 用 `Agent(name: <sub>, run_in_background: true, prompt: <该 sub 的 `harnessed prompt <sub>` prompt>)` spawn 一个后台 teammate,团在**第一个** spawn 时隐式形成,本 session 即 lead(`team_name` 入参被接受但忽略 —— 团名由 session 派生)。用 `SendMessage` 协调;某个 sub 完成后,**按名**请求该 teammate 关闭(例如「ask the verify-qa teammate to shut down」)。每个 sub 仍按下方 checkpoint(`complete` / `fail`)。
85
86
  5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
86
- - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
87
+ - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed facts <sub> --out .harnessed-facts.json`(填完 null)→ `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
87
88
  - **否则(leaf sub):**
88
89
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
89
- b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
90
+ b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
91
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
92
+ - 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
93
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
90
94
  c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
91
- d. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它,或仅在刻意覆盖时传 `--force`。
92
- e. 若 sub 无法达到 COMPLETE(max_iterations 耗尽 / 不可恢复错误):Bash `harnessed checkpoint fail <sub> --summary "<why>"`,然后 STOP 并向用户报告。
95
+ d. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete <sub> --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。exit 非零即表示该 sub **未** done —— 重 spawn 补齐,或仅在刻意覆盖时传 `--force`(记录 `evidence_status=overridden`,是可审计的覆盖而非静默放行)。
96
+ e. 若 complete 闸门拦下:Bash `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试(该 sub 无测试时省略该 flag —— 回退用证据产物摘要作进展度量)。命中停机条件时它会打印 `BUDGET-EXHAUSTED`(已用尝试次数 vs `workflows/defaults.yaml ralph_max_iterations`)、`NO-PROGRESS`(连续 N 次无进展)或 `BREAK-LOOP`(该 sub 失败次数达阈值)。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
93
97
  6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
94
98
 
95
99
  **若丢失上下文(compaction / resume):** 先跑 `harnessed status --recover` —— 它读 ledger 并打印「你在这里,下一步是什么」,让你从第一个 `pending` sub 续跑而非重启。若 ledger 为空,重跑 step 2-3。
96
100
 
97
- <!-- harnessed-generated:v4.9.3 -->
101
+ <!-- harnessed-generated:v4.12.0 -->
98
102
 
99
103
  ## 参考资料
100
104
 
@@ -65,7 +65,9 @@ delegates_to:
65
65
  gate: judgments.stage-routing.verify-security-secrets.fires
66
66
  mode: parallel
67
67
  - sub: design
68
- gate: judgments.stage-routing.verify-design-changes.fires
68
+ # Canonical design-tier trigger (was a verbatim stage-routing copy; the sub's
69
+ # own phase gate has pointed here since T2.3 — same predicate, one home now).
70
+ gate: judgments.web-design-routing.design-review-post.fires
69
71
  mode: parallel
70
72
  - sub: eval-review
71
73
  gate: judgments.stage-routing.verify-eval-review-aiphase.fires
@@ -63,11 +63,15 @@ Do NOT pipe to `harnessed run verify-code-review` — that is the CI/headless pa
63
63
  that blocks the session inside Claude Code).
64
64
 
65
65
  1. Bash: `harnessed prompt verify-code-review --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
66
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
66
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
67
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete verify-code-review --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
68
+ - if it blocks, run `harnessed checkpoint fail verify-code-review --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
69
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
67
70
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
68
- 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-code-review --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
71
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete verify-code-review --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
72
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail verify-code-review --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
69
73
 
70
- <!-- harnessed-generated:v4.9.3 -->
74
+ <!-- harnessed-generated:v4.12.0 -->
71
75
 
72
76
  ## References
73
77
 
@@ -62,11 +62,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
62
62
  Code 内部会阻塞 session)。
63
63
 
64
64
  1. Bash: `harnessed prompt verify-code-review --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
65
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
65
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
66
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete verify-code-review --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
67
+ - 若被拦下,跑 `harnessed checkpoint fail verify-code-review --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
68
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
66
69
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
67
- 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-code-review --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
70
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete verify-code-review --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
71
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail verify-code-review --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
68
72
 
69
- <!-- harnessed-generated:v4.9.3 -->
73
+ <!-- harnessed-generated:v4.12.0 -->
70
74
 
71
75
  ## 参考资料
72
76
 
@@ -19,17 +19,21 @@ trigger_phrases:
19
19
 
20
20
  ## Overview
21
21
 
22
- 1-phase sub-workflow mapping CLAUDE.md "Verify 阶段 — 可选 /design-review" onto harnessed
22
+ 3-phase sub-workflow mapping CLAUDE.md "Verify 阶段 — 可选 /design-review" onto harnessed
23
23
  runtime (Phase v3.0-3.4 W0.13c — D-04 Stage ④ Verify 7 sub + D-12 gstack 治理关卡 +
24
- Pattern A sub-workflow ship)。
24
+ Pattern A sub-workflow ship; T2.3 两段式 remediation lane 接线)。
25
25
 
26
26
  | phase | id | upstream | model | capability | gate |
27
27
  | ----- | -- | -------- | ----- | ---------- | ---- |
28
- | 1 | `01-design-review` | gstack | sonnet | `{{ capabilities.gstack-design-review.cmd }}` | `judgments.stage-routing.verify-design-changes.fires` |
28
+ | 1 | `01-design-review` | gstack | sonnet | `{{ capabilities.gstack-design-review.cmd }}` | `judgments.web-design-routing.design-review-post.fires` |
29
+ | 2 | `02-ui-ux-structure` | ui-ux-pro-max | sonnet | `{{ capabilities.ui-ux-pro-max.cmd }}` | `judgments.web-design-routing.ui-ux-pro-max-structure.fires` |
30
+ | 3 | `03-design-taste-polish` | design-taste-frontend | sonnet | `{{ capabilities.design-taste-frontend.cmd }}` | `judgments.web-design-routing.design-taste-polish.fires` |
29
31
 
30
32
  Per-phase config loads from `workflows/verify/design/workflow.yaml`; engine 4-level gate
31
33
  resolver evaluates `phase.has_design_changes == true` via expr-eval — true 则 invoke gstack
32
- `/design-review` (设计系统一致性 + AI 审美问题识别), false 则 skip。
34
+ `/design-review` (设计系统一致性 + AI 审美问题识别), false 则 skip。Phase 02 / 03 是
35
+ review 出问题清单后的两段式 remediation lane (结构问题 → Stage 1; 视觉打磨 / AI 味 → Stage 2),
36
+ 各由 `phase.has_ui_changes == true` 独立 gate。
33
37
 
34
38
  ## Capability refs
35
39
 
@@ -41,8 +45,14 @@ Sister `workflows/capabilities.yaml` entries:
41
45
 
42
46
  ## Gate ref
43
47
 
44
- Sister `workflows/judgments/stage-routing.yaml`:
45
- - `verify-design-changes.fires` — `phase.stage == 'verify' and phase.has_design_changes == true`
48
+ Sister `workflows/judgments/web-design-routing.yaml`:
49
+ - `design-review-post.fires` — `phase.stage == 'verify' and phase.has_design_changes == true`
50
+ - `ui-ux-pro-max-structure.fires` — `phase.has_ui_changes == true`
51
+ - `design-taste-polish.fires` — `phase.has_ui_changes == true`
52
+
53
+ `workflows/verify/auto/workflow.yaml` 的 `delegates_to` 也 gate 在
54
+ `design-review-post.fires` 上 — 之前那条逐字等价的 `stage-routing.verify-design-changes`
55
+ 副本已删,一个判据一个家。
46
56
 
47
57
  ## Routing rules (bundled web-design routing — `workflows/judgments/web-design-routing.yaml`)
48
58
 
@@ -65,11 +75,15 @@ Do NOT pipe to `harnessed run verify-design` — that is the CI/headless path (i
65
75
  that blocks the session inside Claude Code).
66
76
 
67
77
  1. Bash: `harnessed prompt verify-design --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
68
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
78
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
79
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete verify-design --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
80
+ - if it blocks, run `harnessed checkpoint fail verify-design --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
81
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
69
82
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
70
- 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-design --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
83
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete verify-design --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
84
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail verify-design --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
71
85
 
72
- <!-- harnessed-generated:v4.9.3 -->
86
+ <!-- harnessed-generated:v4.12.0 -->
73
87
 
74
88
  ## References
75
89
 
@@ -77,5 +91,5 @@ that blocks the session inside Claude Code).
77
91
  - D-12 gstack 治理关卡可选
78
92
  - workflows/judgments/web-design-routing.yaml — 两段式 ui-ux-pro-max 结构 → design-taste-frontend 打磨
79
93
  - workflows/capabilities.yaml — gstack-design-review / ui-ux-pro-max / design-taste-frontend
80
- - workflows/judgments/stage-routing.yaml — verify-design-changes trigger
94
+ - workflows/verify/auto/workflow.yaml — `design` delegate gate = 同一个 design-review-post trigger
81
95
  - workflows/verify-work/workflow.yaml v2 SHIPPED phase 07-design-review-conditional sister verbatim