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.
- package/README.md +6 -6
- package/bin/harnessed-inject-state.mjs +16 -0
- package/dist/cli.mjs +1419 -276
- 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/chrome-devtools-mcp.yaml +60 -0
- package/manifests/optional/doc-discipline-gate.yaml +54 -0
- package/manifests/optional/ecc.yaml +28 -14
- package/manifests/tools/exa-mcp.yaml +51 -0
- package/manifests/tools/tavily-mcp.yaml +4 -4
- package/messages/en.json +11 -0
- package/messages/zh-Hans.json +11 -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 +105 -45
- 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-search-routing.yaml +3 -3
- package/workflows/judgments/web-testing-routing.yaml +24 -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/chrome-devtools-mcp.yaml +0 -64
- package/manifests/tools/ralph-loop.yaml +0 -46
|
@@ -14,8 +14,21 @@ priority_hierarchy:
|
|
|
14
14
|
- superpowers # 子任务执行质量
|
|
15
15
|
- planning-with-files # 计划持久化
|
|
16
16
|
- karpathy # 编码行为
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
# `mattpocock` = 「按需召唤的招式」层的落位 (/grill-with-docs、/diagnosing-bugs、
|
|
18
|
+
# /to-spec、/to-tickets、/tdd、/improve-codebase-architecture 等),排在 karpathy 与
|
|
19
|
+
# parallel 之间。
|
|
20
|
+
#
|
|
21
|
+
# 它 NOT 属于方法论优先级句原文的 6 tier
|
|
22
|
+
# (gstack > GSD > superpowers > planning-with-files > andrej-karpathy-skills >
|
|
23
|
+
# 子任务并行机制) —— 那句话不是穷举式 tier 定义,招式层需要一个显式 rank 才能
|
|
24
|
+
# 参与 before-spawn 仲裁。
|
|
25
|
+
#
|
|
26
|
+
# 请勿当作「偏差」删除:删掉后这批招式 capability 会 fall through 到
|
|
27
|
+
# MAX_SAFE_INTEGER rank,排到 parallel 之下变成全局最低优先。而
|
|
28
|
+
# workflows/discuss/subtask/workflow.yaml 与 workflows/task/code/workflow.yaml
|
|
29
|
+
# 真在消费同 tier 并发。
|
|
30
|
+
- mattpocock # 招式 by-demand (rationale 见上方注释)
|
|
31
|
+
- parallel # subagent / Agent Teams 执行机制 (完成保证是正交 wrapper, 见 judgments/parallelism-gate.yaml completion-gate-wrapper.wraps)
|
|
19
32
|
|
|
20
33
|
rules:
|
|
21
34
|
- id: multi-capability-arbitration
|
|
@@ -24,9 +24,9 @@ trigger_phrases:
|
|
|
24
24
|
|
|
25
25
|
| sub | gate ref | mode | when fires |
|
|
26
26
|
| --- | -------- | ---- | ---------- |
|
|
27
|
-
| `strategic` | `judgments.
|
|
28
|
-
| `phase` | `judgments.
|
|
29
|
-
| `subtask` | `judgments.
|
|
27
|
+
| `strategic` | `judgments.strategic-gate.strategic-tier-delegate.fires` | parallel | new_project / new_milestone / new_feature / is_major_release |
|
|
28
|
+
| `phase` | `judgments.phase-gate.gsd-discuss-phase.fires` | parallel | open_decisions ≥ 2 / cross_phase_data_flow / scope_days > 1 / files_touched > 5 |
|
|
29
|
+
| `subtask` | `judgments.subtask-gate.brainstorming.fires` | parallel | approaches ≥ 2 / core_algorithm / has_api_contract / error_cost=high |
|
|
30
30
|
|
|
31
31
|
Engine runtime spawns 3 sub-workflow phases via `runMasterOrchestrator` per
|
|
32
32
|
T3.5.W0.1 (sister sub-workflow `runWorkflow` SDK pattern, parallel fan-out via
|
|
@@ -71,7 +71,7 @@ execution stages.
|
|
|
71
71
|
|
|
72
72
|
Output: a locked spec the execution stages (`/plan` → `/task` → `/verify`) consume without further user input.
|
|
73
73
|
|
|
74
|
-
<!-- harnessed-generated:v4.
|
|
74
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
75
75
|
|
|
76
76
|
## References
|
|
77
77
|
|
|
@@ -24,9 +24,9 @@ trigger_phrases:
|
|
|
24
24
|
|
|
25
25
|
| 子工作流 | gate ref | mode | 触发时机 |
|
|
26
26
|
| --- | -------- | ---- | ---------- |
|
|
27
|
-
| `strategic` | `judgments.
|
|
28
|
-
| `phase` | `judgments.
|
|
29
|
-
| `subtask` | `judgments.
|
|
27
|
+
| `strategic` | `judgments.strategic-gate.strategic-tier-delegate.fires` | parallel | new_project / new_milestone / new_feature / is_major_release |
|
|
28
|
+
| `phase` | `judgments.phase-gate.gsd-discuss-phase.fires` | parallel | open_decisions ≥ 2 / cross_phase_data_flow / scope_days > 1 / files_touched > 5 |
|
|
29
|
+
| `subtask` | `judgments.subtask-gate.brainstorming.fires` | parallel | approaches ≥ 2 / core_algorithm / has_api_contract / error_cost=high |
|
|
30
30
|
|
|
31
31
|
引擎运行时通过 `runMasterOrchestrator` 以
|
|
32
32
|
T3.5.W0.1(sister sub-workflow `runWorkflow` SDK pattern,并行 fan-out 通过
|
|
@@ -70,7 +70,7 @@ Sister `workflows/capabilities.yaml`:
|
|
|
70
70
|
|
|
71
71
|
产出:一份 locked spec,执行阶段(`/plan` → `/task` → `/verify`)无需再问用户即可消费。
|
|
72
72
|
|
|
73
|
-
<!-- harnessed-generated:v4.
|
|
73
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
74
74
|
|
|
75
75
|
## 参考资料
|
|
76
76
|
|
|
@@ -29,11 +29,24 @@ tools_available: [planning-with-files]
|
|
|
29
29
|
|
|
30
30
|
delegates_to:
|
|
31
31
|
- sub: strategic
|
|
32
|
-
gate
|
|
32
|
+
# Aggregate of strategic-gate's two triggers (office-hours ∪ plan-ceo-review),
|
|
33
|
+
# now homed in that file rather than mirrored in stage-routing.yaml. Coarse by
|
|
34
|
+
# design: /discuss-strategic re-gates the two independently inside the sub.
|
|
35
|
+
gate: judgments.strategic-gate.strategic-tier-delegate.fires
|
|
33
36
|
mode: parallel
|
|
34
37
|
- sub: phase
|
|
35
|
-
|
|
38
|
+
# Gates on the CANONICAL phase-tier trigger. It used to gate on a
|
|
39
|
+
# stage-routing.yaml copy of this predicate, which silently lost the
|
|
40
|
+
# `phase.files_touched > 5` scope arm when that arm was added here — the
|
|
41
|
+
# criterion existed but could not decide anything at master tier.
|
|
42
|
+
gate: judgments.phase-gate.gsd-discuss-phase.fires
|
|
43
|
+
# T2.1 D-5 — phase-gate's declared skips (single self-contained task, or a
|
|
44
|
+
# sub-day scope) veto the phase-tier discussion even though fires_when
|
|
45
|
+
# matched. This is also the first consumer of phase-gate.yaml's ❌ half,
|
|
46
|
+
# which had been dead configuration since Phase 2.3.
|
|
47
|
+
skip_gate: judgments.phase-gate.gsd-discuss-phase.skips
|
|
36
48
|
mode: parallel
|
|
37
49
|
- sub: subtask
|
|
38
|
-
|
|
50
|
+
# Canonical subtask-tier trigger (was a verbatim stage-routing copy).
|
|
51
|
+
gate: judgments.subtask-gate.brainstorming.fires
|
|
39
52
|
mode: parallel
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# workflows/judgments/parallelism-gate.yaml
|
|
2
2
|
# Parallelism 判据 — bundled subagent vs Agent Teams routing rules
|
|
3
|
-
# (4 triggers: subagent-default / main-session-fallback / agent-teams-upgrade /
|
|
3
|
+
# (4 triggers: subagent-default / main-session-fallback / agent-teams-upgrade / completion-gate-wrapper)
|
|
4
4
|
# Bundled Agent Teams lifecycle: 5 upgrade triggers + cleanup discipline
|
|
5
|
-
# Phase v2.0-2.3 Wave 0 T2.3.W0.2 ship per D-11 (parallelism-gate) + R20.10 (
|
|
5
|
+
# Phase v2.0-2.3 Wave 0 T2.3.W0.2 ship per D-11 (parallelism-gate) + R20.10 (完成保证正交 wrapper)
|
|
6
|
+
# 4.36.0 — trigger renamed ralph-loop-wrapper → completion-gate-wrapper (上游 plugin 依赖摘除;
|
|
7
|
+
# 保证由 harnessed `checkpoint complete` / `checkpoint fail` 自己提供)
|
|
6
8
|
|
|
7
9
|
schema_version: harnessed.judgment.v1
|
|
8
10
|
|
|
@@ -35,14 +37,17 @@ triggers:
|
|
|
35
37
|
capabilities:
|
|
36
38
|
- agent-teams-create
|
|
37
39
|
|
|
38
|
-
|
|
40
|
+
completion-gate-wrapper:
|
|
39
41
|
description: |
|
|
40
|
-
Orthogonal —
|
|
42
|
+
Orthogonal — 完成保证正交 wrapper, 套在 subagent / team / main session
|
|
41
43
|
外层保 completion-promise verbatim "COMPLETE"。任何执行单元均可套用,
|
|
42
|
-
并非互斥触发器 (per R20.10 + D-10)。
|
|
44
|
+
并非互斥触发器 (per R20.10 + D-10)。4.36.0 起由 harnessed 自己的
|
|
45
|
+
`harnessed checkpoint complete` / `checkpoint fail` 兑现 (fail-closed
|
|
46
|
+
evidence + TDD boundary + verbatim promise; BUDGET-EXHAUSTED /
|
|
47
|
+
NO-PROGRESS / BREAK-LOOP), 不再依赖上游 ralph-loop plugin。
|
|
43
48
|
wraps:
|
|
44
49
|
- subagent-default
|
|
45
50
|
- agent-teams-upgrade
|
|
46
51
|
- main-session-fallback
|
|
47
52
|
invokes:
|
|
48
|
-
- capability:
|
|
53
|
+
- capability: completion-gate
|
|
@@ -11,7 +11,11 @@ triggers:
|
|
|
11
11
|
GSD /gsd-discuss-phase — 新 phase 且 ≥2 个 open implementation decisions,
|
|
12
12
|
或跨 phase 数据流 / API contract / 依赖不清, 或 phase scope > 1 天 / > 5 文件,
|
|
13
13
|
或存在灰色地带 (多种合理实现都讲得通) 时激活。
|
|
14
|
-
|
|
14
|
+
# T2.1 D-2 follow-up — the `> 5 文件` half of the scope criterion. `files_touched`
|
|
15
|
+
# is derived by `harnessed facts` from `git diff --name-only` (worktree ∪ index)
|
|
16
|
+
# and is OPTIONAL: buildDefaultGateContext never seeds it, so an unknown count
|
|
17
|
+
# (no repo / clean tree) is an absent member = quiet false, not a fired gate.
|
|
18
|
+
fires_when: "phase.open_decisions >= 2 or phase.has_cross_phase_data_flow == true or phase.scope_days > 1 or phase.files_touched > 5"
|
|
15
19
|
skips_when: "phase.single_task == true or phase.scope_days < 1"
|
|
16
20
|
invokes:
|
|
17
21
|
- capability: gsd-discuss-phase
|
|
@@ -10,27 +10,22 @@
|
|
|
10
10
|
schema_version: harnessed.judgment.v1
|
|
11
11
|
|
|
12
12
|
triggers:
|
|
13
|
-
#
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
discuss
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
discuss-subtask-delegate:
|
|
30
|
-
description: /discuss master → /discuss-subtask 委派 fire per subtask-gate.fires。
|
|
31
|
-
fires_when: "subtask.approaches >= 2 or subtask.core_algorithm == true or subtask.has_api_contract == true or subtask.error_cost == 'high'"
|
|
32
|
-
invokes:
|
|
33
|
-
- capability: superpowers-brainstorming
|
|
13
|
+
# discuss-strategic-delegate MOVED to judgments/strategic-gate.yaml as
|
|
14
|
+
# `strategic-tier-delegate` — verbatim expression, zero behaviour change. It was
|
|
15
|
+
# not a copy but the UNION of that file's two triggers, so it could not simply be
|
|
16
|
+
# deleted in favour of one of them (either choice drops arms). Relocating it
|
|
17
|
+
# beside its two members is what makes a future drift visible: adding an arm to
|
|
18
|
+
# `office-hours` now sits one screenful from the union that must learn it too.
|
|
19
|
+
#
|
|
20
|
+
# discuss-phase-delegate / discuss-subtask-delegate REMOVED — they were verbatim
|
|
21
|
+
# copies of judgments/phase-gate.yaml `gsd-discuss-phase` and
|
|
22
|
+
# judgments/subtask-gate.yaml `brainstorming`, and the copies were what
|
|
23
|
+
# workflows/discuss/auto/workflow.yaml actually evaluated. The phase copy had
|
|
24
|
+
# already drifted: the `phase.files_touched > 5` scope arm was added to
|
|
25
|
+
# phase-gate.yaml but never to the copy, so the criterion could not change any
|
|
26
|
+
# master-tier decision. The master now gates directly on the canonical triggers
|
|
27
|
+
# (gate refs are cross-file — judgments.<file>.<trigger>.fires resolves any
|
|
28
|
+
# judgments/*.yaml). Guard: tests/workflow/judgment-expression-dedup.test.ts.
|
|
34
29
|
|
|
35
30
|
# /plan master → 2 sub serial
|
|
36
31
|
plan-architecture-delegate:
|
|
@@ -72,11 +67,11 @@ triggers:
|
|
|
72
67
|
invokes:
|
|
73
68
|
- capability: gstack-cso
|
|
74
69
|
|
|
75
|
-
verify-design-changes
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
# verify-design-changes REMOVED — verbatim copy of
|
|
71
|
+
# judgments/web-design-routing.yaml `design-review-post`, which T2.3 already
|
|
72
|
+
# made the canonical home (workflows/verify/design/workflow.yaml gates on it).
|
|
73
|
+
# workflows/verify/auto/workflow.yaml now delegates on the same canonical
|
|
74
|
+
# trigger; predicate is unchanged, so behaviour is identical.
|
|
80
75
|
|
|
81
76
|
verify-eval-review-aiphase:
|
|
82
77
|
description: /verify master → /verify-eval-review fire 当 has_ai_phase (AI phase eval 覆盖审计)。
|
|
@@ -23,3 +23,33 @@ triggers:
|
|
|
23
23
|
skips_when: "phase.scope_locked_in_history == true or phase.type in ['bug_fix', 'tech_debt']"
|
|
24
24
|
invokes:
|
|
25
25
|
- capability: gstack-plan-ceo-review
|
|
26
|
+
|
|
27
|
+
# Routing-shaped entry in a tier-judgment file — deliberate. The /discuss master
|
|
28
|
+
# asks a coarser question than either trigger above: "is the strategic tier in
|
|
29
|
+
# play at all?", i.e. the UNION of the two. It cannot gate on `office-hours`
|
|
30
|
+
# (that drops the `is_major_release` arm) nor on `plan-ceo-review` (that drops
|
|
31
|
+
# the new_milestone / new_feature arms), so the union needs a home — and its home
|
|
32
|
+
# must be HERE, beside its two members, where a new arm added to either one makes
|
|
33
|
+
# the omission from the union visible in the same screenful. Living in
|
|
34
|
+
# stage-routing.yaml is what let it rot unobserved (sister: the phase-tier copy
|
|
35
|
+
# that silently lost `files_touched > 5`).
|
|
36
|
+
#
|
|
37
|
+
# The delegation is coarse ON PURPOSE: /discuss-strategic re-gates each member
|
|
38
|
+
# independently inside the sub-workflow, so a context that fires only one arm
|
|
39
|
+
# runs only that one capability. This trigger decides whether the tier is
|
|
40
|
+
# entered, never which of the two runs.
|
|
41
|
+
#
|
|
42
|
+
# Endgame is not this entry: it is a schema that lets `gate:` take multiple refs
|
|
43
|
+
# OR'd together, which would delete the union expression instead of relocating
|
|
44
|
+
# it. That costs WorkflowSchemaV3 + gates.ts + masterOrchestrator.ts +
|
|
45
|
+
# scripts/check-workflow-schema.mjs (mirror) — a separate slice. Until then this
|
|
46
|
+
# is the cheapest form that keeps one expression with one home.
|
|
47
|
+
strategic-tier-delegate:
|
|
48
|
+
description: |
|
|
49
|
+
/discuss master → /discuss-strategic 委派 gate — 上面两条 trigger 的并集
|
|
50
|
+
(任一 office-hours OR plan-ceo-review 可能 fire → 战略层适用)。
|
|
51
|
+
sub-workflow 内部再对两条各自独立 gate。
|
|
52
|
+
fires_when: "phase.type in ['new_project', 'new_milestone', 'new_feature'] or phase.is_major_release == true"
|
|
53
|
+
invokes:
|
|
54
|
+
- capability: gstack-office-hours
|
|
55
|
+
- capability: gstack-plan-ceo-review
|
|
@@ -28,8 +28,9 @@ overrides:
|
|
|
28
28
|
- "brainstorm first"
|
|
29
29
|
- "let's brainstorm"
|
|
30
30
|
triggers:
|
|
31
|
+
# stage-routing.discuss-subtask-delegate removed — it was a copy of this
|
|
32
|
+
# trigger; workflows/discuss/auto/workflow.yaml now gates on the canonical one.
|
|
31
33
|
- judgments.subtask-gate.brainstorming.fires
|
|
32
|
-
- judgments.stage-routing.discuss-subtask-delegate.fires
|
|
33
34
|
|
|
34
35
|
- id: strategic-review
|
|
35
36
|
keywords:
|
|
@@ -42,7 +43,9 @@ overrides:
|
|
|
42
43
|
triggers:
|
|
43
44
|
- judgments.strategic-gate.office-hours.fires
|
|
44
45
|
- judgments.strategic-gate.plan-ceo-review.fires
|
|
45
|
-
|
|
46
|
+
# was stage-routing.discuss-strategic-delegate — same expression, relocated
|
|
47
|
+
# beside the two triggers it aggregates.
|
|
48
|
+
- judgments.strategic-gate.strategic-tier-delegate.fires
|
|
46
49
|
|
|
47
50
|
- id: arch-review
|
|
48
51
|
keywords:
|
|
@@ -60,8 +63,9 @@ overrides:
|
|
|
60
63
|
- "discuss-phase"
|
|
61
64
|
- "gsd-discuss-phase"
|
|
62
65
|
triggers:
|
|
66
|
+
# stage-routing.discuss-phase-delegate removed — it was a (drifted) copy of
|
|
67
|
+
# this trigger; workflows/discuss/auto/workflow.yaml now gates on the canonical one.
|
|
63
68
|
- judgments.phase-gate.gsd-discuss-phase.fires
|
|
64
|
-
- judgments.stage-routing.discuss-phase-delegate.fires
|
|
65
69
|
|
|
66
70
|
- id: paranoid-review
|
|
67
71
|
keywords:
|
|
@@ -24,9 +24,9 @@ triggers:
|
|
|
24
24
|
description: |
|
|
25
25
|
Exa MCP 覆盖默认 — 描述式查询 / 学术论文 / 批量抓多 URL /
|
|
26
26
|
用户明说"研究/深度调研" / Token 敏感 (Exa highlights 密度约 2× Tavily)。
|
|
27
|
-
Provider 说明 (4.32.
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
Provider 说明 (4.32.22): exa 恢复为 base 组件 (manifests/tools/exa-mcp.yaml,
|
|
28
|
+
翻案 4.32.21 删除); 需 EXA_API_KEY (settings.json env 块 / OS env);
|
|
29
|
+
未配置 → 本分支不可用, 落 tavily-mcp 默认分支 / 内置 WebSearch。
|
|
30
30
|
fires_when: "subtask.needs_web_search == true and subtask.search_type in ['descriptive', 'academic']"
|
|
31
31
|
invokes:
|
|
32
32
|
- capability: exa-mcp
|
|
@@ -4,10 +4,17 @@
|
|
|
4
4
|
#
|
|
5
5
|
# 三层职责矩阵 verbatim:
|
|
6
6
|
# 脑 (写测试 / 跑 CI) — @playwright/test (frontend/e2e/*.spec.ts)
|
|
7
|
-
# 手 (AI 实时操作) —
|
|
7
|
+
# 手 (AI 实时操作) — /browse 主导 (gstack headless Playwright);
|
|
8
|
+
# 未装 gstack 降级 playwright-cli (一行 Bash, token 最省)
|
|
8
9
|
# 筋骨 (Python 后端联动) — webapp-testing skill (tests/e2e/*.py)
|
|
9
10
|
# 非功能性诊断 (性能/a11y/内存) — chrome-devtools-mcp (必用)
|
|
10
11
|
#
|
|
12
|
+
# T2.3 — 本 file 的 4 trigger 之前是运行时孤儿 (零 gate ref → resolveJudgmentGate
|
|
13
|
+
# 纯 ref 驱动, 永不加载求值)。现由 workflows/verify/qa/workflow.yaml 的 4 条 lane
|
|
14
|
+
# phase 各接一个 gate。手层 trigger 由 playwright-cli-probe 改名 browse-probe:
|
|
15
|
+
# 浏览器探查偏好 /browse (token 高效, 可复用 cookies 与会话状态)。
|
|
16
|
+
# 这是路由偏好, NOT deny-list — 不禁用任何浏览器工具。
|
|
17
|
+
#
|
|
11
18
|
# expr-eval 2.0.2 case-sensitive: keyword `and` / `or` 全小写 (sister Phase 2.3 W0.2 bug)
|
|
12
19
|
|
|
13
20
|
schema_version: harnessed.judgment.v1
|
|
@@ -23,14 +30,19 @@ triggers:
|
|
|
23
30
|
invokes:
|
|
24
31
|
- capability: playwright-test
|
|
25
32
|
|
|
26
|
-
|
|
33
|
+
browse-probe:
|
|
27
34
|
description: |
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
35
|
+
浏览器探查 / 调试 / 一次性确认 (非提交 repo) — 主导 /browse。
|
|
36
|
+
探查产出的 selectors 再沉淀到正式 test (playwright-test-default lane)。
|
|
37
|
+
Provider 说明 (降级链, 同下方 chrome-devtools 二选一注记体例):
|
|
38
|
+
首选 browse (gstack user-skill, capabilities.yaml browse — headless Playwright,
|
|
39
|
+
token 高效, 可复用 cookies 与会话状态) → 未装 gstack 时本 capability 不可用,
|
|
40
|
+
降级 playwright-cli (npm-cli, 无 gstack 依赖, 仍在 tools_available 内) →
|
|
41
|
+
两者都缺时用 harness 平台内置浏览器工具。
|
|
42
|
+
路由偏好而非 deny-list: 只表达优先级, 不禁用任何浏览器工具。
|
|
43
|
+
fires_when: "subtask.test_type == 'probe' or subtask.needs_browser_automation == true"
|
|
32
44
|
invokes:
|
|
33
|
-
- capability:
|
|
45
|
+
- capability: browse
|
|
34
46
|
|
|
35
47
|
webapp-testing-python-backend:
|
|
36
48
|
description: |
|
|
@@ -45,6 +57,11 @@ triggers:
|
|
|
45
57
|
description: |
|
|
46
58
|
chrome-devtools-mcp — 非功能性诊断必须用 (NOT playwright/test/cli/webapp-testing)。
|
|
47
59
|
LCP / Core Web Vitals / ARIA / 堆快照。
|
|
60
|
+
Provider 说明 (4.32.22 终局): 二选一 — ecc (manifests/optional/ecc.yaml,
|
|
61
|
+
bonus tier; ECC 唯一默认 MCP connector) 或 optional 自装 manifest
|
|
62
|
+
(manifests/optional/chrome-devtools-mcp.yaml, mcp-stdio-add 兜底, 供不装
|
|
63
|
+
ecc 的用户; setup optional offer 可勾选)。双装同名双前缀歧义, doctor
|
|
64
|
+
`ecc` check 会 warn。两者都缺 → 本 capability 不可用。
|
|
48
65
|
fires_when: "subtask.test_type == 'perf-diagnostic'"
|
|
49
66
|
invokes:
|
|
50
67
|
- capability: chrome-devtools-mcp
|
|
@@ -67,11 +67,15 @@ Do NOT pipe to `harnessed run plan-architecture` — that is the CI/headless pat
|
|
|
67
67
|
that blocks the session inside Claude Code).
|
|
68
68
|
|
|
69
69
|
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
70
|
-
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
70
|
+
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
71
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-architecture --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
72
|
+
- if it blocks, run `harnessed checkpoint fail plan-architecture --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
73
|
+
- 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.
|
|
71
74
|
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.
|
|
72
|
-
4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete plan-architecture --summary "<one-line>"`.
|
|
75
|
+
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-architecture --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.
|
|
76
|
+
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-architecture --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.
|
|
73
77
|
|
|
74
|
-
<!-- harnessed-generated:v4.
|
|
78
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
75
79
|
|
|
76
80
|
## References
|
|
77
81
|
|
|
@@ -66,11 +66,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
|
|
|
66
66
|
Code 内部会阻塞 session)。
|
|
67
67
|
|
|
68
68
|
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
69
|
-
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
69
|
+
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
70
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-architecture --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
71
|
+
- 若被拦下,跑 `harnessed checkpoint fail plan-architecture --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
72
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
70
73
|
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
|
|
71
|
-
4. 命中 `<promise>COMPLETE</promise
|
|
74
|
+
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-architecture --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`),不是静默放行。
|
|
75
|
+
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-architecture --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
72
76
|
|
|
73
|
-
<!-- harnessed-generated:v4.
|
|
77
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
74
78
|
|
|
75
79
|
## 参考文档
|
|
76
80
|
|
|
@@ -68,22 +68,26 @@ Do NOT pipe to `harnessed run plan` — that is the CI/headless path (in-process
|
|
|
68
68
|
that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
|
|
69
69
|
|
|
70
70
|
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.
|
|
71
|
-
|
|
71
|
+
1b. Bash: `harnessed facts plan --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.
|
|
72
|
+
2. Bash: `harnessed gates plan --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.
|
|
72
73
|
3. Bash: `harnessed checkpoint start plan --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
|
|
73
|
-
4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team
|
|
74
|
+
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.
|
|
74
75
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
75
|
-
- **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.
|
|
76
|
+
- **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.
|
|
76
77
|
- **Else (leaf sub):**
|
|
77
78
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
78
|
-
b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
79
|
+
b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
80
|
+
- 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>`.
|
|
81
|
+
- 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.
|
|
82
|
+
- 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.
|
|
79
83
|
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.
|
|
80
|
-
d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`.
|
|
81
|
-
e. If the
|
|
84
|
+
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).
|
|
85
|
+
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.
|
|
82
86
|
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.
|
|
83
87
|
|
|
84
88
|
**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.
|
|
85
89
|
|
|
86
|
-
<!-- harnessed-generated:v4.
|
|
90
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
87
91
|
|
|
88
92
|
## References
|
|
89
93
|
|
|
@@ -67,22 +67,26 @@ Sister `workflows/capabilities.yaml`:
|
|
|
67
67
|
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
68
68
|
|
|
69
69
|
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清(AskUserQuestion)并锁决策;否则透明 skip。产出 locked spec。
|
|
70
|
-
|
|
70
|
+
1b. Bash: `harnessed facts plan --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
71
|
+
2. Bash: `harnessed gates plan --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。
|
|
71
72
|
3. Bash: `harnessed checkpoint start plan --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
72
|
-
4. 若 `parallelism.escalate_to_teams === true`:读 `~/.claude/rules/agent-teams.md`,然后把 fired subs 作为 Agent Team
|
|
73
|
+
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`)。
|
|
73
74
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
74
|
-
- **若该项 `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 重复本循环。
|
|
75
|
+
- **若该项 `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 重复本循环。
|
|
75
76
|
- **否则(leaf sub):**
|
|
76
77
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
77
|
-
b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
78
|
+
b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
79
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
80
|
+
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
81
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
78
82
|
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
79
|
-
d. 命中 `<promise>COMPLETE</promise
|
|
80
|
-
e. 若
|
|
83
|
+
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`,是可审计的覆盖而非静默放行)。
|
|
84
|
+
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
81
85
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
|
|
82
86
|
|
|
83
87
|
**若丢失上下文(compaction / resume):** 先跑 `harnessed status --recover` —— 它读 ledger 并打印「你在这里,下一步是什么」,让你从第一个 `pending` sub 续跑而非重启。若 ledger 为空,重跑 step 2-3。
|
|
84
88
|
|
|
85
|
-
<!-- harnessed-generated:v4.
|
|
89
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
86
90
|
|
|
87
91
|
## 参考文档
|
|
88
92
|
|
|
@@ -69,11 +69,15 @@ Do NOT pipe to `harnessed run plan-phase` — that is the CI/headless path (in-p
|
|
|
69
69
|
that blocks the session inside Claude Code).
|
|
70
70
|
|
|
71
71
|
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
72
|
-
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
72
|
+
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
73
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-phase --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
74
|
+
- if it blocks, run `harnessed checkpoint fail plan-phase --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
75
|
+
- 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.
|
|
73
76
|
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.
|
|
74
|
-
4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete plan-phase --summary "<one-line>"`.
|
|
77
|
+
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-phase --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.
|
|
78
|
+
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-phase --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.
|
|
75
79
|
|
|
76
|
-
<!-- harnessed-generated:v4.
|
|
80
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
77
81
|
|
|
78
82
|
## References
|
|
79
83
|
|