harnessed 4.32.22 → 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.
- package/README.md +6 -6
- package/bin/harnessed-inject-state.mjs +16 -0
- package/dist/cli.mjs +1201 -235
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/schemas/index.mjs.map +1 -1
- package/manifests/optional/doc-discipline-gate.yaml +54 -0
- package/messages/en.json +8 -0
- package/messages/zh-Hans.json +8 -0
- package/package.json +1 -1
- package/routing/decision_rules.yaml +1 -1
- package/workflows/README.md +1 -1
- package/workflows/auto/SKILL.md +13 -9
- package/workflows/auto/SKILL.zh-Hans.md +13 -9
- package/workflows/capabilities.yaml +94 -39
- package/workflows/defaults.yaml +8 -2
- package/workflows/disciplines/karpathy.yaml +29 -0
- package/workflows/disciplines/karpathy.zh-Hans.yaml +27 -0
- package/workflows/disciplines/language.yaml +15 -10
- package/workflows/disciplines/operational.yaml +1 -1
- package/workflows/disciplines/operational.zh-Hans.yaml +1 -1
- package/workflows/disciplines/output-style.yaml +10 -2
- package/workflows/disciplines/output-style.zh-Hans.yaml +10 -2
- package/workflows/disciplines/priority.yaml +15 -2
- package/workflows/disciplines/priority.zh-Hans.yaml +15 -2
- package/workflows/discuss/auto/SKILL.md +4 -4
- package/workflows/discuss/auto/SKILL.zh-Hans.md +4 -4
- package/workflows/discuss/auto/workflow.yaml +16 -3
- package/workflows/discuss/phase/SKILL.md +1 -1
- package/workflows/discuss/phase/SKILL.zh-Hans.md +1 -1
- package/workflows/discuss/strategic/SKILL.md +1 -1
- package/workflows/discuss/strategic/SKILL.zh-Hans.md +1 -1
- package/workflows/discuss/subtask/SKILL.md +1 -1
- package/workflows/discuss/subtask/SKILL.zh-Hans.md +1 -1
- package/workflows/judgments/parallelism-gate.yaml +11 -6
- package/workflows/judgments/phase-gate.yaml +5 -1
- package/workflows/judgments/stage-routing.yaml +21 -26
- package/workflows/judgments/strategic-gate.yaml +30 -0
- package/workflows/judgments/user-overrides.yaml +7 -3
- package/workflows/judgments/web-testing-routing.yaml +19 -7
- package/workflows/plan/architecture/SKILL.md +7 -3
- package/workflows/plan/architecture/SKILL.zh-Hans.md +7 -3
- package/workflows/plan/auto/SKILL.md +11 -7
- package/workflows/plan/auto/SKILL.zh-Hans.md +11 -7
- package/workflows/plan/phase/SKILL.md +7 -3
- package/workflows/plan/phase/SKILL.zh-Hans.md +7 -3
- package/workflows/research/SKILL.md +24 -9
- package/workflows/research/SKILL.zh-Hans.md +23 -9
- package/workflows/research/workflow.yaml +43 -3
- package/workflows/retro/SKILL.md +7 -3
- package/workflows/retro/SKILL.zh-Hans.md +7 -3
- package/workflows/role-prompts.yaml +28 -21
- package/workflows/role-prompts.zh-Hans.yaml +22 -17
- package/workflows/ship/auto/SKILL.md +11 -7
- package/workflows/ship/auto/SKILL.zh-Hans.md +11 -7
- package/workflows/ship/preflight/SKILL.md +7 -3
- package/workflows/ship/preflight/SKILL.zh-Hans.md +7 -3
- package/workflows/task/auto/SKILL.md +26 -16
- package/workflows/task/auto/SKILL.zh-Hans.md +26 -16
- package/workflows/task/auto/workflow.yaml +11 -4
- package/workflows/task/clarify/SKILL.md +1 -1
- package/workflows/task/clarify/SKILL.zh-Hans.md +1 -1
- package/workflows/task/code/SKILL.md +7 -3
- package/workflows/task/code/SKILL.zh-Hans.md +7 -3
- package/workflows/task/deliver/SKILL.md +53 -35
- package/workflows/task/deliver/SKILL.zh-Hans.md +54 -36
- package/workflows/task/deliver/workflow.yaml +32 -24
- package/workflows/task/test/SKILL.md +7 -3
- package/workflows/task/test/SKILL.zh-Hans.md +7 -3
- package/workflows/task/test/workflow.yaml +13 -0
- package/workflows/verify/auto/SKILL.md +12 -8
- package/workflows/verify/auto/SKILL.zh-Hans.md +12 -8
- package/workflows/verify/auto/workflow.yaml +3 -1
- package/workflows/verify/code-review/SKILL.md +7 -3
- package/workflows/verify/code-review/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/design/SKILL.md +24 -10
- package/workflows/verify/design/SKILL.zh-Hans.md +24 -10
- package/workflows/verify/design/workflow.yaml +36 -7
- package/workflows/verify/eval-review/SKILL.md +7 -3
- package/workflows/verify/eval-review/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/multispec/SKILL.md +17 -10
- package/workflows/verify/multispec/SKILL.zh-Hans.md +16 -10
- package/workflows/verify/multispec/workflow.yaml +7 -5
- package/workflows/verify/paranoid/SKILL.md +7 -3
- package/workflows/verify/paranoid/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/progress/SKILL.md +7 -3
- package/workflows/verify/progress/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/qa/SKILL.md +33 -14
- package/workflows/verify/qa/SKILL.zh-Hans.md +33 -14
- package/workflows/verify/qa/workflow.yaml +55 -2
- package/workflows/verify/security/SKILL.md +7 -3
- package/workflows/verify/security/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/simplify/SKILL.md +7 -3
- package/workflows/verify/simplify/SKILL.zh-Hans.md +7 -3
- package/workflows/verify/validate-phase/SKILL.md +7 -3
- package/workflows/verify/validate-phase/SKILL.zh-Hans.md +7 -3
- package/manifests/skill-packs/karpathy-skills.yaml +0 -65
- package/manifests/tools/ralph-loop.yaml +0 -46
|
@@ -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
|
|
2
|
+
# (D-09 + D-10 + D-11 + R20.10 + ADR 0011 SDK wrapper)
|
|
3
3
|
#
|
|
4
|
-
# Stage ③.d 子任务交付 —
|
|
5
|
-
# "COMPLETE" (R20.10 + D-10
|
|
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
|
-
#
|
|
10
|
-
#
|
|
11
|
-
#
|
|
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
|
-
# -
|
|
15
|
-
# - parallelism-gate ref: judgments.parallelism-gate.
|
|
16
|
-
# (R20.10
|
|
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.
|
|
25
|
-
# - workflows/capabilities.yaml
|
|
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 子任务交付 —
|
|
40
|
-
"COMPLETE" (R20.10 + D-10
|
|
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 (
|
|
45
|
-
|
|
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
|
-
-
|
|
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 (
|
|
59
|
-
|
|
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.
|
|
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.
|
|
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: '
|
|
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 —
|
|
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 证据门; 在
|
|
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`
|
|
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>"`.
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
|
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`
|
|
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>"`.
|
|
93
|
-
e. If the
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
92
|
-
e. 若
|
|
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.
|
|
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
|
-
|
|
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`
|
|
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>"`.
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
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
|
-
|
|
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.
|
|
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/
|
|
45
|
-
- `
|
|
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`
|
|
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>"`.
|
|
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.
|
|
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/
|
|
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
|
|
@@ -19,17 +19,21 @@ trigger_phrases:
|
|
|
19
19
|
|
|
20
20
|
## 概览
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
3-phase 子工作流,将 CLAUDE.md「Verify 阶段 — 可选 /design-review」映射到 harnessed
|
|
23
23
|
运行时(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.
|
|
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 配置从 `workflows/verify/design/workflow.yaml` 加载;引擎 4-level gate
|
|
31
33
|
resolver 通过 expr-eval 计算 `phase.has_design_changes == true` — 为 true 则调用 gstack
|
|
32
|
-
`/design-review`(设计系统一致性 + AI 审美问题识别),为 false 则跳过。
|
|
34
|
+
`/design-review`(设计系统一致性 + AI 审美问题识别),为 false 则跳过。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` 条目:
|
|
|
41
45
|
|
|
42
46
|
## Gate ref
|
|
43
47
|
|
|
44
|
-
Sister `workflows/judgments/
|
|
45
|
-
- `
|
|
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
|
## 路由规则(bundled web-design routing — `workflows/judgments/web-design-routing.yaml`)
|
|
48
58
|
|
|
@@ -64,11 +74,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
|
|
|
64
74
|
Code 内部会阻塞 session)。
|
|
65
75
|
|
|
66
76
|
1. Bash: `harnessed prompt verify-design --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
67
|
-
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
77
|
+
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
78
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete verify-design --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
79
|
+
- 若被拦下,跑 `harnessed checkpoint fail verify-design --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
80
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
68
81
|
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
|
|
69
|
-
4. 命中 `<promise>COMPLETE</promise
|
|
82
|
+
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete verify-design --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`),不是静默放行。
|
|
83
|
+
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail verify-design --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
70
84
|
|
|
71
|
-
<!-- harnessed-generated:v4.
|
|
85
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
72
86
|
|
|
73
87
|
## 参考资料
|
|
74
88
|
|
|
@@ -76,5 +90,5 @@ Code 内部会阻塞 session)。
|
|
|
76
90
|
- D-12 gstack 治理关卡可选
|
|
77
91
|
- workflows/judgments/web-design-routing.yaml — 两段式 ui-ux-pro-max 结构 → design-taste-frontend 打磨
|
|
78
92
|
- workflows/capabilities.yaml — gstack-design-review / ui-ux-pro-max / design-taste-frontend
|
|
79
|
-
- workflows/
|
|
93
|
+
- workflows/verify/auto/workflow.yaml — `design` delegate gate = 同一个 design-review-post trigger
|
|
80
94
|
- workflows/verify-work/workflow.yaml v2 SHIPPED phase 07-design-review-conditional sister verbatim
|
|
@@ -4,8 +4,10 @@
|
|
|
4
4
|
# (has_design_changes 触发, 可选 conditional; bundled verify-stage optional /design-review step).
|
|
5
5
|
#
|
|
6
6
|
# Sister refs:
|
|
7
|
-
# - workflows/judgments/web-design-routing.yaml —
|
|
8
|
-
#
|
|
7
|
+
# - workflows/judgments/web-design-routing.yaml — 3 trigger 全接线 (T2.3):
|
|
8
|
+
# design-review-post (01) + ui-ux-pro-max-structure (02) + design-taste-polish (03)
|
|
9
|
+
# design-review-post 同时是 workflows/verify/auto/workflow.yaml `design`
|
|
10
|
+
# delegate 的 gate (stage-routing.verify-design-changes 那份逐字副本已删)
|
|
9
11
|
# - workflows/capabilities.yaml — gstack-design-review / ui-ux-pro-max / design-taste-frontend
|
|
10
12
|
# - workflows/verify-work/workflow.yaml v2 SHIPPED phase 07-design-review-conditional sister pattern
|
|
11
13
|
# - .planning/phase-v3.0-3.2/RESEARCH-workflows.md § Area 2 verify/design example verbatim
|
|
@@ -14,10 +16,11 @@ schema_version: harnessed.workflow.v3
|
|
|
14
16
|
workflow: verify-design
|
|
15
17
|
description: |
|
|
16
18
|
Stage ④.f gstack /design-review 设计系统一致性 + AI 审美问题识别 (has_design_changes 触发,
|
|
17
|
-
可选 conditional)。Gate: judgments.
|
|
18
|
-
(phase.has_design_changes == true) — UI module fire only;
|
|
19
|
-
tools_available 含 ui-ux-pro-max (Stage 1 结构骨架) +
|
|
20
|
-
per bundled 两段式 web-design routing
|
|
19
|
+
可选 conditional)。Gate: judgments.web-design-routing.design-review-post.fires
|
|
20
|
+
(phase.stage == 'verify' and phase.has_design_changes == true) — UI module fire only;
|
|
21
|
+
后端 / docs PR skip。tools_available 含 ui-ux-pro-max (Stage 1 结构骨架) +
|
|
22
|
+
design-taste-frontend (Stage 2 视觉打磨叠加) per bundled 两段式 web-design routing
|
|
23
|
+
(workflows/judgments/web-design-routing.yaml); T2.3 起两段式各成一条 remediation lane phase。
|
|
21
24
|
|
|
22
25
|
disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
|
|
23
26
|
tools_available: [gstack-design-review, ui-ux-pro-max, design-taste-frontend]
|
|
@@ -28,8 +31,34 @@ phases:
|
|
|
28
31
|
upstream: gstack
|
|
29
32
|
capability: '{{ capabilities.gstack-design-review.cmd }}'
|
|
30
33
|
model: sonnet
|
|
31
|
-
gate
|
|
34
|
+
# T2.3 — gate 由 judgments.stage-routing.verify-design-changes.fires 换成
|
|
35
|
+
# 同址的 judgments.web-design-routing.design-review-post.fires。两个 trigger 的
|
|
36
|
+
# fires_when 逐字等价 ("phase.stage == 'verify' and phase.has_design_changes == true"),
|
|
37
|
+
# 所以行为零变化; 换 ref 让 web-design-routing 的第 3 个 trigger 不再是运行时孤儿。
|
|
38
|
+
# 后续: stage-routing 的那份副本已删, verify/auto 的 delegate gate 也指到这里 —
|
|
39
|
+
# 一个判据一个家 (guard: tests/workflow/judgment-expression-dedup.test.ts)。
|
|
40
|
+
gate: judgments.web-design-routing.design-review-post.fires
|
|
32
41
|
max_iterations: 3
|
|
33
42
|
# D2-followup (ADR-0033): declare report artifact so the evidence guard is real
|
|
34
43
|
# (verified, not none_declared) — proves the design-review consistency pass actually ran.
|
|
35
44
|
artifacts_expected: [design-review-report.md]
|
|
45
|
+
|
|
46
|
+
# T2.3 — 两段式 remediation lane。01-design-review 出问题清单后:
|
|
47
|
+
# 命中结构 / 交互逻辑问题 → Stage 1 ui-ux-pro-max; 命中视觉打磨 / AI 味问题 → Stage 2
|
|
48
|
+
# design-taste-frontend (顺序上 polish 在结构之后, per web-design-routing.yaml)。
|
|
49
|
+
# 两条 lane 之前是运行时孤儿 (零 gate ref → 文件永不加载求值)。
|
|
50
|
+
- id: 02-ui-ux-structure
|
|
51
|
+
name: ui-ux-pro-max (Stage 1 — 受众 / 交互逻辑 / 设计主轴, 数据驱动结构骨架)
|
|
52
|
+
upstream: ui-ux-pro-max
|
|
53
|
+
capability: '{{ capabilities.ui-ux-pro-max.cmd }}'
|
|
54
|
+
model: sonnet
|
|
55
|
+
gate: judgments.web-design-routing.ui-ux-pro-max-structure.fires
|
|
56
|
+
max_iterations: 3
|
|
57
|
+
|
|
58
|
+
- id: 03-design-taste-polish
|
|
59
|
+
name: design-taste-frontend (Stage 2 — 细节 + 视觉打磨 → 高级感, anti-slop)
|
|
60
|
+
upstream: design-taste-frontend
|
|
61
|
+
capability: '{{ capabilities.design-taste-frontend.cmd }}'
|
|
62
|
+
model: sonnet
|
|
63
|
+
gate: judgments.web-design-routing.design-taste-polish.fires
|
|
64
|
+
max_iterations: 3
|
|
@@ -57,11 +57,15 @@ Do NOT pipe to `harnessed run verify-eval-review` — that is the CI/headless pa
|
|
|
57
57
|
that blocks the session inside Claude Code).
|
|
58
58
|
|
|
59
59
|
1. Bash: `harnessed prompt verify-eval-review --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
60
|
-
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
60
|
+
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
61
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete verify-eval-review --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
62
|
+
- if it blocks, run `harnessed checkpoint fail verify-eval-review --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
63
|
+
- 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.
|
|
61
64
|
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.
|
|
62
|
-
4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-eval-review --summary "<one-line>"`.
|
|
65
|
+
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete verify-eval-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.
|
|
66
|
+
5. If the complete gate blocked: Bash `harnessed checkpoint fail verify-eval-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.
|
|
63
67
|
|
|
64
|
-
<!-- harnessed-generated:v4.
|
|
68
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
65
69
|
|
|
66
70
|
## References
|
|
67
71
|
|