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
|
@@ -68,11 +68,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
|
|
|
68
68
|
Code 内部会阻塞 session)。
|
|
69
69
|
|
|
70
70
|
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
71
|
-
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
71
|
+
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
72
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-phase --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
73
|
+
- 若被拦下,跑 `harnessed checkpoint fail plan-phase --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
74
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
72
75
|
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
|
|
73
|
-
4. 命中 `<promise>COMPLETE</promise
|
|
76
|
+
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-phase --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`),不是静默放行。
|
|
77
|
+
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-phase --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
74
78
|
|
|
75
|
-
<!-- harnessed-generated:v4.
|
|
79
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
76
80
|
|
|
77
81
|
## 参考文档
|
|
78
82
|
|
|
@@ -10,14 +10,24 @@ schema_version: harnessed.workflow.v3
|
|
|
10
10
|
Multi-source research workflow shipped with harnessed v2.0 (Stage ① Discuss);
|
|
11
11
|
`workflow.yaml` schema bumped to `harnessed.workflow.v3` in Phase v3.0-3.4 W1.1
|
|
12
12
|
(T3.4.W1.1 — D-09 L0 Discipline Substrate + D-05 tools_available cross-validate);
|
|
13
|
-
|
|
13
|
+
T2.3 split `01-fan-out` into 5 gated source lanes — each lane is now gated by one
|
|
14
|
+
`workflows/judgments/web-search-routing.yaml` trigger (those 5 triggers used to be runtime
|
|
15
|
+
orphans: zero gate ref, so the file was never loaded or evaluated). `02-synth` unchanged.
|
|
14
16
|
|
|
15
|
-
## Phases (
|
|
17
|
+
## Phases (6)
|
|
16
18
|
|
|
17
|
-
| # | Phase | Upstream | Capability | Model | Description |
|
|
18
|
-
|
|
19
|
-
| 01 | `01-fan-out` | web-search | (route-by-subtask) | sonnet |
|
|
20
|
-
| 02 | `
|
|
19
|
+
| # | Phase | Upstream | Capability | Model | Gate | Description |
|
|
20
|
+
|---|-------|----------|-----------|-------|------|-------------|
|
|
21
|
+
| 01 | `01-fan-out-tavily-keyword` | web-search | (route-by-subtask) | sonnet | `judgments.web-search-routing.tavily-mcp-default.fires` | 默认 lane — Tavily MCP 关键词 / 库 API / 新闻时效 / 生产 RAG |
|
|
22
|
+
| 02 | `01-fan-out-exa-descriptive` | web-search | (route-by-subtask) | sonnet | `judgments.web-search-routing.exa-mcp-descriptive-academic.fires` | Exa MCP 覆盖默认 — 描述式查询 / 学术论文 (需 `EXA_API_KEY`, 缺则落默认 lane) |
|
|
23
|
+
| 03 | `01-fan-out-tavily-crawl` | web-search | (route-by-subtask) | sonnet | `judgments.web-search-routing.tavily-crawl-map-site.fires` | Tavily 必用 — 抓整站 / 站点结构 (crawl / map), Exa 无对等工具 |
|
|
24
|
+
| 04 | `01-fan-out-ctx7-lib-docs` | ctx7 | (route-by-subtask) | sonnet | `judgments.web-search-routing.ctx7-lib-docs.fires` | ctx7 CLI — 库 / API / 框架 / SDK / CLI 工具文档 (prefer over web search) |
|
|
25
|
+
| 05 | `01-fan-out-webfetch-url` | web-search | (route-by-subtask) | haiku | `judgments.web-search-routing.webfetch-single-url.fires` | 永远规则 — 单次轻量查询 (一个明确 URL) 直接 WebFetch, 不走 MCP / CLI |
|
|
26
|
+
| 06 | `02-synth` | gsd | `gsd-discuss-phase` | opus | (无 gate — 无论命中哪条 lane 都要 aggregate) | GSD discuss-phase aggregate + dedup + reconcile |
|
|
27
|
+
|
|
28
|
+
Lanes are mutually exclusive (`subtask.search_type` is single-valued); the default
|
|
29
|
+
gateContext (`search_type == 'keyword'`) fires only the Tavily lane, which is behaviourally
|
|
30
|
+
identical to the pre-T2.3 unconditional single `01-fan-out`.
|
|
21
31
|
|
|
22
32
|
## Capability refs
|
|
23
33
|
|
|
@@ -52,8 +62,13 @@ Do NOT pipe to `harnessed run research` — that is the CI/headless path (in-pro
|
|
|
52
62
|
that blocks the session inside Claude Code).
|
|
53
63
|
|
|
54
64
|
1. Bash: `harnessed prompt research --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
55
|
-
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
65
|
+
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
66
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete research --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
67
|
+
- if it blocks, run `harnessed checkpoint fail research --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
68
|
+
- 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
|
+
- delivery contract: use a BLOCKING Agent/Task call — only a blocking call returns the subagent's final text as your tool result. A named/background teammate's final message is DISCARDED by the platform; if you must run it that way, instruct the agent to write its findings to a file (and read it back) or SendMessage them to the main session — otherwise the COMPLETE promise and the findings never reach you.
|
|
56
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.
|
|
57
|
-
4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete research --summary "<one-line>"`.
|
|
71
|
+
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete research --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 research --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.
|
|
58
73
|
|
|
59
|
-
<!-- harnessed-generated:v4.
|
|
74
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
@@ -10,14 +10,23 @@ schema_version: harnessed.workflow.v3
|
|
|
10
10
|
harnessed v2.0 随附的多源调研工作流(Stage ① Discuss);
|
|
11
11
|
`workflow.yaml` schema 在 Phase v3.0-3.4 W1.1 中 bump 至 `harnessed.workflow.v3`
|
|
12
12
|
(T3.4.W1.1 — D-09 L0 Discipline Substrate + D-05 tools_available 交叉验证);
|
|
13
|
-
|
|
13
|
+
T2.3 把 `01-fan-out` 拆成 5 条 gated source lane —— 每条 lane 各由
|
|
14
|
+
`workflows/judgments/web-search-routing.yaml` 的一个 trigger gate(那 5 个 trigger 此前是
|
|
15
|
+
运行时孤儿:零 gate ref,文件永不加载求值)。`02-synth` 未变。
|
|
14
16
|
|
|
15
|
-
## 阶段 (
|
|
17
|
+
## 阶段 (6)
|
|
16
18
|
|
|
17
|
-
| # | Phase | Upstream | Capability | Model | Description |
|
|
18
|
-
|
|
19
|
-
| 01 | `01-fan-out` | web-search | (route-by-subtask) | sonnet |
|
|
20
|
-
| 02 | `
|
|
19
|
+
| # | Phase | Upstream | Capability | Model | Gate | Description |
|
|
20
|
+
|---|-------|----------|-----------|-------|------|-------------|
|
|
21
|
+
| 01 | `01-fan-out-tavily-keyword` | web-search | (route-by-subtask) | sonnet | `judgments.web-search-routing.tavily-mcp-default.fires` | 默认 lane —— Tavily MCP 关键词 / 库 API / 新闻时效 / 生产 RAG |
|
|
22
|
+
| 02 | `01-fan-out-exa-descriptive` | web-search | (route-by-subtask) | sonnet | `judgments.web-search-routing.exa-mcp-descriptive-academic.fires` | Exa MCP 覆盖默认 —— 描述式查询 / 学术论文(需 `EXA_API_KEY`,缺则落默认 lane) |
|
|
23
|
+
| 03 | `01-fan-out-tavily-crawl` | web-search | (route-by-subtask) | sonnet | `judgments.web-search-routing.tavily-crawl-map-site.fires` | Tavily 必用 —— 抓整站 / 站点结构 (crawl / map),Exa 无对等工具 |
|
|
24
|
+
| 04 | `01-fan-out-ctx7-lib-docs` | ctx7 | (route-by-subtask) | sonnet | `judgments.web-search-routing.ctx7-lib-docs.fires` | ctx7 CLI —— 库 / API / 框架 / SDK / CLI 工具文档(优先于 web search) |
|
|
25
|
+
| 05 | `01-fan-out-webfetch-url` | web-search | (route-by-subtask) | haiku | `judgments.web-search-routing.webfetch-single-url.fires` | 永远规则 —— 单次轻量查询(一个明确 URL)直接 WebFetch,不走 MCP / CLI |
|
|
26
|
+
| 06 | `02-synth` | gsd | `gsd-discuss-phase` | opus | (无 gate —— 无论命中哪条 lane 都要 aggregate) | GSD discuss-phase 聚合 + 去重 + 对账 |
|
|
27
|
+
|
|
28
|
+
lane 之间互斥(`subtask.search_type` 单值);默认 gateContext(`search_type == 'keyword'`)
|
|
29
|
+
只 fire Tavily lane,与 T2.3 之前"`01-fan-out` 无条件跑一次"行为等价。
|
|
21
30
|
|
|
22
31
|
## Capability refs
|
|
23
32
|
|
|
@@ -51,8 +60,13 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
|
|
|
51
60
|
Code 内部会阻塞 session)。
|
|
52
61
|
|
|
53
62
|
1. Bash: `harnessed prompt research --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
54
|
-
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
63
|
+
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
64
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete research --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
65
|
+
- 若被拦下,跑 `harnessed checkpoint fail research --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
66
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
67
|
+
- 交付契约:必须用**阻塞式** Agent/Task 调用 —— 只有阻塞调用会把 subagent 的最终文本作为 tool result 返回给你。named/background teammate 的最终消息会被平台**丢弃**;若必须那样跑,要求 agent 把发现写入文件(你再读回)或 SendMessage 回主 session —— 否则 COMPLETE promise 和研究发现永远到不了你手里。
|
|
55
68
|
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
|
|
56
|
-
4. 命中 `<promise>COMPLETE</promise
|
|
69
|
+
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete research --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`),不是静默放行。
|
|
70
|
+
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail research --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
57
71
|
|
|
58
|
-
<!-- harnessed-generated:v4.
|
|
72
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
# KEEP phases verbatim (01-fan-out + 02-synth) — phases 内容 reuse v2 SHIPPED
|
|
14
14
|
# (per PLAN L455 "phases 内容 reuse v2")
|
|
15
15
|
#
|
|
16
|
+
# T2.3 delta: 01-fan-out 拆成 5 条 gated source lane (见 phases 内注记) —
|
|
17
|
+
# web-search-routing.yaml 5 trigger 从运行时孤儿变成真 gate。
|
|
18
|
+
#
|
|
16
19
|
# Sister refs:
|
|
17
20
|
# - .planning/phase-v3.0-3.2/PLAN.md L450-457 (T3.4.W1.1 spec verbatim)
|
|
18
21
|
# - .planning/phase-v3.0-3.2/RESEARCH-workflows.md § Area 2 Standalone research v3 example
|
|
@@ -33,15 +36,52 @@ disciplines_applied: [karpathy, output-style, language, operational, priority, p
|
|
|
33
36
|
tools_available: [tavily-mcp, exa-mcp, ctx7, gsd-discuss-phase]
|
|
34
37
|
|
|
35
38
|
phases:
|
|
36
|
-
# 01-fan-out
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
+
# T2.3 — 01-fan-out 的 generic "按 capability route 触发 source" 注记终于落地:
|
|
40
|
+
# 5 条 source lane 各由 workflows/judgments/web-search-routing.yaml 的一个 trigger
|
|
41
|
+
# gate。之前那 5 个 trigger 是运行时孤儿 (零 gate ref → resolveJudgmentGate 纯 ref
|
|
42
|
+
# 驱动, 文件永不加载求值), ADR-0032:81 描述过这步接线但从未落地。
|
|
43
|
+
# lane 之间互斥 (search_type 单值); 默认 gateContext = keyword → 只 fire tavily lane,
|
|
44
|
+
# 与改动前"01-fan-out 无条件跑一次"行为等价。
|
|
45
|
+
# 全部沿用 defaults.ralph_max_iterations.research.01-fan-out 预算 (同一 fan-out 阶段)。
|
|
46
|
+
|
|
47
|
+
# lane 1 (默认) — Tavily MCP 关键词 / 库 API / 新闻时效 / 生产 RAG
|
|
48
|
+
- id: 01-fan-out-tavily-keyword
|
|
39
49
|
upstream: web-search
|
|
40
50
|
model: sonnet
|
|
51
|
+
gate: judgments.web-search-routing.tavily-mcp-default.fires
|
|
41
52
|
max_iterations: '{{ defaults.ralph_max_iterations.research.01-fan-out }}'
|
|
42
53
|
parallelism: judgments.parallelism-gate.subagent-default.fires
|
|
43
54
|
|
|
55
|
+
# lane 2 — Exa MCP 覆盖默认: 描述式查询 / 学术论文 (需 EXA_API_KEY, 缺则落 lane 1)
|
|
56
|
+
- id: 01-fan-out-exa-descriptive
|
|
57
|
+
upstream: web-search
|
|
58
|
+
model: sonnet
|
|
59
|
+
gate: judgments.web-search-routing.exa-mcp-descriptive-academic.fires
|
|
60
|
+
max_iterations: '{{ defaults.ralph_max_iterations.research.01-fan-out }}'
|
|
61
|
+
|
|
62
|
+
# lane 3 — Tavily 必用: 抓整站 / 站点结构 (crawl / map), Exa 无对等工具
|
|
63
|
+
- id: 01-fan-out-tavily-crawl
|
|
64
|
+
upstream: web-search
|
|
65
|
+
model: sonnet
|
|
66
|
+
gate: judgments.web-search-routing.tavily-crawl-map-site.fires
|
|
67
|
+
max_iterations: '{{ defaults.ralph_max_iterations.research.01-fan-out }}'
|
|
68
|
+
|
|
69
|
+
# lane 4 — ctx7 CLI: 库 / API / 框架 / SDK / CLI 工具文档 (prefer over web search)
|
|
70
|
+
- id: 01-fan-out-ctx7-lib-docs
|
|
71
|
+
upstream: ctx7
|
|
72
|
+
model: sonnet
|
|
73
|
+
gate: judgments.web-search-routing.ctx7-lib-docs.fires
|
|
74
|
+
max_iterations: '{{ defaults.ralph_max_iterations.research.01-fan-out }}'
|
|
75
|
+
|
|
76
|
+
# lane 5 (永远规则) — 单次轻量查询 (一个明确 URL) 直接 WebFetch, 不走 MCP / CLI
|
|
77
|
+
- id: 01-fan-out-webfetch-url
|
|
78
|
+
upstream: web-search
|
|
79
|
+
model: haiku
|
|
80
|
+
gate: judgments.web-search-routing.webfetch-single-url.fires
|
|
81
|
+
max_iterations: '{{ defaults.ralph_max_iterations.research.01-fan-out }}'
|
|
82
|
+
|
|
44
83
|
# 02-synth: GSD discuss synth aggregate — 多源结果 dedup + reconcile + GSD discuss-phase format
|
|
84
|
+
# (无 gate — 无论命中哪条 lane 都要 aggregate)
|
|
45
85
|
- id: 02-synth
|
|
46
86
|
upstream: gsd
|
|
47
87
|
capability: '{{ capabilities.gsd-discuss-phase.cmd }}'
|
package/workflows/retro/SKILL.md
CHANGED
|
@@ -62,11 +62,15 @@ Do NOT pipe to `harnessed run retro` — that is the CI/headless path (in-proces
|
|
|
62
62
|
that blocks the session inside Claude Code).
|
|
63
63
|
|
|
64
64
|
1. Bash: `harnessed prompt retro --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
65
|
-
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
65
|
+
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
66
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete retro --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
67
|
+
- if it blocks, run `harnessed checkpoint fail retro --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
68
|
+
- 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.
|
|
66
69
|
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.
|
|
67
|
-
4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete retro --summary "<one-line>"`.
|
|
70
|
+
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete retro --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.
|
|
71
|
+
5. If the complete gate blocked: Bash `harnessed checkpoint fail retro --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.
|
|
68
72
|
|
|
69
|
-
<!-- harnessed-generated:v4.
|
|
73
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
70
74
|
|
|
71
75
|
## References
|
|
72
76
|
|
|
@@ -61,11 +61,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
|
|
|
61
61
|
Code 内部会阻塞 session)。
|
|
62
62
|
|
|
63
63
|
1. Bash: `harnessed prompt retro --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
64
|
-
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
64
|
+
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
65
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete retro --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
66
|
+
- 若被拦下,跑 `harnessed checkpoint fail retro --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
67
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
65
68
|
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
|
|
66
|
-
4. 命中 `<promise>COMPLETE</promise
|
|
69
|
+
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete retro --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`),不是静默放行。
|
|
70
|
+
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail retro --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
67
71
|
|
|
68
|
-
<!-- harnessed-generated:v4.
|
|
72
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
69
73
|
|
|
70
74
|
## 参考文档
|
|
71
75
|
|
|
@@ -80,12 +80,12 @@ prompts:
|
|
|
80
80
|
specialist: "Stage 3 task dispatcher"
|
|
81
81
|
responsibility: |
|
|
82
82
|
Per-subtask serial chain: `/task-clarify` (conditional brainstorming) →
|
|
83
|
-
`/task-code` (karpathy 4
|
|
84
|
-
`/task-test` (TDD strongly suggested gate) → `/task-deliver` (
|
|
85
|
-
COMPLETE
|
|
83
|
+
`/task-code` (karpathy 4 principles + conditional mattpocock moves) →
|
|
84
|
+
`/task-test` (TDD strongly suggested gate) → `/task-deliver` (completion
|
|
85
|
+
gate: verbatim COMPLETE). Re-enter for each subtask.
|
|
86
86
|
checklist: []
|
|
87
87
|
severity: "per-subtask 4-step serial gate"
|
|
88
|
-
description: "Stage 3 Task master — per-subtask clarify→code→test→deliver chain (
|
|
88
|
+
description: "Stage 3 Task master — per-subtask clarify→code→test→deliver chain (completion gate at deliver)."
|
|
89
89
|
|
|
90
90
|
verify:
|
|
91
91
|
primary_cap: ""
|
|
@@ -308,7 +308,7 @@ prompts:
|
|
|
308
308
|
primary_cap: "planning-with-files"
|
|
309
309
|
specialist: "Karpathy-discipline implementer"
|
|
310
310
|
responsibility: |
|
|
311
|
-
Implement a single subtask under karpathy 4
|
|
311
|
+
Implement a single subtask under the karpathy 4 principles (Think Before Coding /
|
|
312
312
|
Simplicity First / Surgical Changes / Goal-Driven Execution) with
|
|
313
313
|
≤200 LOC per file. Conditionally invoke `/improve-codebase-architecture`
|
|
314
314
|
for periodic health audits, `/diagnosing-bugs` for unknown bug root
|
|
@@ -331,7 +331,7 @@ prompts:
|
|
|
331
331
|
- "improve-arch: name candidates using CONTEXT.md domain vocabulary (e.g. 'the Order intake module', not 'FooBarHandler'); if a candidate contradicts an existing ADR, only surface it when the friction is real enough to revisit the ADR"
|
|
332
332
|
- "improve-arch: present candidates as a before/after report and let the user pick which to explore before designing interfaces"
|
|
333
333
|
severity: "needs-fix / done / blocked"
|
|
334
|
-
description: "Implement a subtask under karpathy 4
|
|
334
|
+
description: "Implement a subtask under the karpathy 4 principles (Think Before Coding, Simplicity First, Surgical Changes, Goal-Driven); ≤200 LOC per file. improve-codebase-architecture for shallow-module deepening audits."
|
|
335
335
|
|
|
336
336
|
task-test:
|
|
337
337
|
primary_cap: "tdd"
|
|
@@ -349,28 +349,34 @@ prompts:
|
|
|
349
349
|
- "Negative cases matter: at least 1 test per error / edge / boundary"
|
|
350
350
|
- "Test name = expected behavior, not 'test1', not 'should work'"
|
|
351
351
|
- "On unexpected failure: stop adding tests; route to `/diagnosing-bugs` for root cause"
|
|
352
|
+
# TDD skip-declaration protocol — machine-enforced via workflows/task/test/workflow.yaml artifacts_expected
|
|
353
|
+
- "Write `tdd-evidence.md` before completing: EITHER the red→green record (the failing test, then the pass) OR, when the tdd-gate skips (crud / ui_polish / docs_only), an explicit `SKIPPED — <reason>` declaration. No declaration and no test run = `harnessed checkpoint complete task-test` is BLOCKED (fail-closed evidence guard, exit 1)"
|
|
352
354
|
severity: "red / green / refactored / blocked"
|
|
353
355
|
description: "Enforce red-green-refactor TDD for core logic; `/diagnosing-bugs` handoff on test failures."
|
|
354
356
|
|
|
355
357
|
task-deliver:
|
|
356
|
-
primary_cap: "
|
|
357
|
-
specialist: "Completion-promise enforcer (
|
|
358
|
+
primary_cap: "completion-gate"
|
|
359
|
+
specialist: "Completion-promise enforcer (verbatim COMPLETE)"
|
|
358
360
|
responsibility: |
|
|
359
|
-
|
|
360
|
-
and `max_iterations: <N>`. The subtask
|
|
361
|
-
|
|
362
|
-
|
|
361
|
+
Drive the subtask under harnessed's own completion gate with
|
|
362
|
+
`completion_promise: "COMPLETE"` and `max_iterations: <N>`. The subtask
|
|
363
|
+
is considered done ONLY when `harnessed checkpoint complete <sub>
|
|
364
|
+
--result-file <path>` accepts it — it is fail-closed on the declared
|
|
365
|
+
evidence artifacts, the TDD boundary, and the verbatim string
|
|
366
|
+
`COMPLETE`; not heuristic, not LLM-as-judge. On a failed attempt run
|
|
367
|
+
`harnessed checkpoint fail <sub> --failing-tests <n>`; when it prints
|
|
368
|
+
BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP, emit explicit warning +
|
|
363
369
|
halt (NOT silent abort). Then mark progress.md complete.
|
|
364
370
|
checklist:
|
|
365
371
|
- "Confirm subtask acceptance criteria are explicit and verifiable BEFORE looping"
|
|
366
372
|
- "Set `max_iterations` based on subtask size; default 20"
|
|
367
373
|
- "On loop entry, give the agent the full spec + acceptance criteria + completion promise"
|
|
368
374
|
- "If agent emits 'COMPLETE' verbatim, mark progress.md done via `/plan`"
|
|
369
|
-
- "
|
|
375
|
+
- "On BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP from `harnessed checkpoint fail`, emit warning + halt; do NOT silent-continue"
|
|
370
376
|
- "If teammate communication needed / context overflow → escalate to Agent Teams"
|
|
371
|
-
- "Cleanup:
|
|
377
|
+
- "Cleanup: ask each teammate to shut down by name — that request IS the teardown (CC 2.1.178+ has no delete tool); the team's shared dirs are removed automatically at session exit, and a teammate that ignores the request is only guaranteed stopped when the session ends"
|
|
372
378
|
severity: "complete / max-iter-exceeded / escalated-to-teams"
|
|
373
|
-
description: "
|
|
379
|
+
description: "Drive subtask through the completion gate with a verbatim COMPLETE promise; escalate to Agent Teams when needed."
|
|
374
380
|
|
|
375
381
|
# ============================================================================
|
|
376
382
|
# verify-* (8 subs)
|
|
@@ -517,18 +523,19 @@ prompts:
|
|
|
517
523
|
primary_cap: "agent-teams-create"
|
|
518
524
|
specialist: "Multi-specialist Agent Team orchestrator (Pattern C)"
|
|
519
525
|
responsibility: |
|
|
520
|
-
Critical release / large refactor only. Spawn 4 teammates
|
|
521
|
-
(code-review + gstack-review + gstack-cso + gstack-qa)
|
|
522
|
-
|
|
523
|
-
|
|
526
|
+
Critical release / large refactor only. Spawn 4 background teammates
|
|
527
|
+
(code-review + gstack-review + gstack-cso + gstack-qa) — the team forms
|
|
528
|
+
implicitly on the first spawn, there is no create step — let them
|
|
529
|
+
cross-question findings via SendMessage (NOT fire-and-forget), lead
|
|
530
|
+
arbitrates final report. Stop every teammate before finishing.
|
|
524
531
|
checklist:
|
|
525
532
|
- "Token-cost gate: estimate team_cost vs 2 × subagent_cost; only escalate when team wins"
|
|
526
|
-
- "
|
|
533
|
+
- "Spawn 4 background teammates (the first spawn forms the team; `team_name` is ignored): code-review / gstack-review / gstack-cso / gstack-qa"
|
|
527
534
|
- "Each teammate's brief is self-contained (no shared session context to lean on)"
|
|
528
535
|
- "Delivery contract: a named/background teammate's FINAL message is discarded by the platform — every finding must arrive via SendMessage to the lead or be written to a file the lead reads back; never rely on the teammate's last output"
|
|
529
536
|
- "Round-trip findings: each teammate sends top-3 findings; others rate (real / false-positive / nit)"
|
|
530
537
|
- "Lead arbitrates conflicts; produces final report ordered CRITICAL → HIGH → MEDIUM"
|
|
531
|
-
- "Cleanup MANDATORY:
|
|
538
|
+
- "Cleanup MANDATORY: ask each of the 4 teammates to shut down by name and confirm it stopped — that request IS the teardown (no delete tool exists); the team dirs are removed automatically at session exit, and a teammate that ignores the request is only guaranteed stopped when the session ends"
|
|
532
539
|
- "If the gate doesn't fire (regular PR), DO NOT escalate — fall back to single-agent fan-out"
|
|
533
540
|
severity: "ship-blocker / ship-with-action / informational"
|
|
534
541
|
description: "Pattern C 4-specialist Agent Team — critical-release multi-dimensional review with SendMessage cross-questioning."
|
|
@@ -69,11 +69,11 @@ prompts:
|
|
|
69
69
|
responsibility: |
|
|
70
70
|
逐子任务串行链:`/task-clarify`(视情况 brainstorming)→
|
|
71
71
|
`/task-code`(karpathy 4 心法 + mattpocock 视情况招式)→
|
|
72
|
-
`/task-test`(强烈建议的 TDD 关卡)→ `/task-deliver`(
|
|
73
|
-
COMPLETE
|
|
72
|
+
`/task-test`(强烈建议的 TDD 关卡)→ `/task-deliver`(完成门:
|
|
73
|
+
逐字 COMPLETE)。每个子任务重新进入一遍。
|
|
74
74
|
checklist: []
|
|
75
75
|
severity: "逐子任务 4 步串行关卡"
|
|
76
|
-
description: "Stage 3 Task master — 逐子任务 clarify→code→test→deliver 链(deliver
|
|
76
|
+
description: "Stage 3 Task master — 逐子任务 clarify→code→test→deliver 链(deliver 处走完成门)。"
|
|
77
77
|
|
|
78
78
|
verify:
|
|
79
79
|
primary_cap: ""
|
|
@@ -328,27 +328,32 @@ prompts:
|
|
|
328
328
|
- "负面用例很重要:每个 error / edge / boundary 至少 1 个测试"
|
|
329
329
|
- "测试名 = 预期行为,不是 'test1',不是 'should work'"
|
|
330
330
|
- "遇到意外失败:停止加测试;转 `/diagnosing-bugs` 找根因"
|
|
331
|
+
# TDD 跳过声明协议 (sister CLAUDE.md) — machine-enforced via workflows/task/test/workflow.yaml artifacts_expected
|
|
332
|
+
- "完成前写 `tdd-evidence.md`:要么留红→绿证据(先失败的测试,再通过),要么在 tdd-gate 跳过时(crud / ui_polish / docs_only)写显式 `SKIPPED — <理由>` 声明。既无声明又没跑测试 = `harnessed checkpoint complete task-test` 会被 BLOCKED(fail-closed evidence guard,exit 1)"
|
|
331
333
|
severity: "red / green / refactored / blocked"
|
|
332
334
|
description: "为核心逻辑执行 red-green-refactor TDD;测试失败时交接 `/diagnosing-bugs`。"
|
|
333
335
|
|
|
334
336
|
task-deliver:
|
|
335
|
-
primary_cap: "
|
|
336
|
-
specialist: "Completion-promise 执行者(
|
|
337
|
+
primary_cap: "completion-gate"
|
|
338
|
+
specialist: "Completion-promise 执行者(逐字 COMPLETE)"
|
|
337
339
|
responsibility: |
|
|
338
340
|
用 `completion_promise: "COMPLETE"` 和 `max_iterations: <N>` 把子任务
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
341
|
+
交给 harnessed 自己的完成门驱动。只有当 `harnessed checkpoint complete
|
|
342
|
+
<sub> --result-file <path>` 放行时,子任务才算完成 —— 它对声明的证据
|
|
343
|
+
artifacts、TDD boundary、逐字字符串 `COMPLETE` 三者 fail-closed;不靠
|
|
344
|
+
启发式,不靠 LLM-as-judge。失败的一轮跑 `harnessed checkpoint fail <sub>
|
|
345
|
+
--failing-tests <n>`;当它打印 BUDGET-EXHAUSTED / NO-PROGRESS /
|
|
346
|
+
BREAK-LOOP 时,显式发警告 + 停止(不是静默放弃)。然后标记 progress.md 完成。
|
|
342
347
|
checklist:
|
|
343
348
|
- "进入循环前,确认子任务验收标准是显式且可验证的"
|
|
344
349
|
- "按子任务大小设 `max_iterations`;默认 20"
|
|
345
350
|
- "进入循环时,把完整 spec + 验收标准 + completion promise 交给 agent"
|
|
346
351
|
- "若 agent 逐字吐出 'COMPLETE',经 `/plan` 标记 progress.md 完成"
|
|
347
|
-
- "
|
|
352
|
+
- "`harnessed checkpoint fail` 打出 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP 时,发警告 + 停止;不要静默继续"
|
|
348
353
|
- "若需要 teammate 通信 / context 溢出 → 升级到 Agent Teams"
|
|
349
|
-
- "
|
|
354
|
+
- "清理:按名请求每个 teammate shut down —— 这个请求**就是**清场手段(CC 2.1.178+ 已无 delete 工具);团目录在 session 退出时自动删除,而无视请求的 teammate 只保证在 session 结束时停止"
|
|
350
355
|
severity: "complete / max-iter-exceeded / escalated-to-teams"
|
|
351
|
-
description: "用逐字 COMPLETE
|
|
356
|
+
description: "用逐字 COMPLETE 承诺把子任务过完成门;需要时升级到 Agent Teams。"
|
|
352
357
|
|
|
353
358
|
# ============================================================================
|
|
354
359
|
# verify-* (8 subs)
|
|
@@ -493,18 +498,18 @@ prompts:
|
|
|
493
498
|
primary_cap: "agent-teams-create"
|
|
494
499
|
specialist: "多 specialist Agent Team 编排器(Pattern C)"
|
|
495
500
|
responsibility: |
|
|
496
|
-
仅限关键发布 /
|
|
497
|
-
(code-review + gstack-review + gstack-cso + gstack-qa)
|
|
498
|
-
|
|
499
|
-
|
|
501
|
+
仅限关键发布 / 大型重构。spawn 4 个后台 teammate
|
|
502
|
+
(code-review + gstack-review + gstack-cso + gstack-qa)—— 团在第一个
|
|
503
|
+
spawn 时隐式形成,没有建团步骤 —— 让它们经 SendMessage 交叉质询发现
|
|
504
|
+
(不是 fire-and-forget),lead 裁决最终报告。收尾前必须停掉每个 teammate。
|
|
500
505
|
checklist:
|
|
501
506
|
- "Token 成本关卡:估算 team_cost vs 2 × subagent_cost;只在 team 划算时升级"
|
|
502
|
-
- "
|
|
507
|
+
- "spawn 4 个后台 teammate(第一个 spawn 即成团;`team_name` 被忽略):code-review / gstack-review / gstack-cso / gstack-qa"
|
|
503
508
|
- "每个 teammate 的 brief 自包含(没有共享 session 上下文可依赖)"
|
|
504
509
|
- "交付契约:named/background teammate 的**最终消息**会被平台丢弃 —— 每条发现必须经 SendMessage 发给 lead 或写入文件由 lead 读回;绝不依赖 teammate 的最后一条输出"
|
|
505
510
|
- "往返发现:每个 teammate 发 top-3 发现;其他人评级(真 / 误报 / 吹毛求疵)"
|
|
506
511
|
- "Lead 裁决冲突;产出按 CRITICAL → HIGH → MEDIUM 排序的最终报告"
|
|
507
|
-
- "
|
|
512
|
+
- "清理强制:按名请求 4 个 teammate 各自 shut down 并确认真的停了 —— 这个请求**就是**清场手段(已无 delete 工具);团目录在 session 退出时自动删除,而无视请求的 teammate 只保证在 session 结束时停止"
|
|
508
513
|
- "若关卡未触发(常规 PR),不要升级 —— 回退到单 agent fan-out"
|
|
509
514
|
severity: "ship-blocker / ship-with-action / informational"
|
|
510
515
|
description: "Pattern C 4-specialist Agent Team —— 关键发布的多维度审查,带 SendMessage 交叉质询。"
|
|
@@ -62,19 +62,23 @@ Do NOT pipe to `harnessed run ship` — that is the CI/headless path (in-process
|
|
|
62
62
|
that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
|
|
63
63
|
|
|
64
64
|
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.
|
|
65
|
-
|
|
65
|
+
1b. Bash: `harnessed facts ship --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.
|
|
66
|
+
2. Bash: `harnessed gates ship --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.
|
|
66
67
|
3. Bash: `harnessed checkpoint start ship --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
|
|
67
|
-
4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team
|
|
68
|
+
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.
|
|
68
69
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
69
|
-
- **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.
|
|
70
|
+
- **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.
|
|
70
71
|
- **Else (leaf sub):**
|
|
71
72
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
72
|
-
b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
73
|
+
b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
74
|
+
- 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>`.
|
|
75
|
+
- 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.
|
|
76
|
+
- 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
77
|
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.
|
|
74
|
-
d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`.
|
|
75
|
-
e. If the
|
|
78
|
+
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).
|
|
79
|
+
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.
|
|
76
80
|
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.
|
|
77
81
|
|
|
78
82
|
**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.
|
|
79
83
|
|
|
80
|
-
<!-- harnessed-generated:v4.
|
|
84
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
@@ -60,19 +60,23 @@ preflight 通过后,主控将 PR + deploy 委派给 gstack `/ship`(组合复
|
|
|
60
60
|
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
61
61
|
|
|
62
62
|
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清(AskUserQuestion)并锁决策;否则透明 skip。产出 locked spec。
|
|
63
|
-
|
|
63
|
+
1b. Bash: `harnessed facts ship --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
64
|
+
2. Bash: `harnessed gates ship --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。
|
|
64
65
|
3. Bash: `harnessed checkpoint start ship --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
65
|
-
4. 若 `parallelism.escalate_to_teams === true`:读 `~/.claude/rules/agent-teams.md`,然后把 fired subs 作为 Agent Team
|
|
66
|
+
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`)。
|
|
66
67
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
67
|
-
- **若该项 `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 重复本循环。
|
|
68
|
+
- **若该项 `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 重复本循环。
|
|
68
69
|
- **否则(leaf sub):**
|
|
69
70
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
70
|
-
b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
71
|
+
b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
72
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
73
|
+
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
74
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
71
75
|
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
72
|
-
d. 命中 `<promise>COMPLETE</promise
|
|
73
|
-
e. 若
|
|
76
|
+
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`,是可审计的覆盖而非静默放行)。
|
|
77
|
+
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
74
78
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
|
|
75
79
|
|
|
76
80
|
**若丢失上下文(compaction / resume):** 先跑 `harnessed status --recover` —— 它读 ledger 并打印「你在这里,下一步是什么」,让你从第一个 `pending` sub 续跑而非重启。若 ledger 为空,重跑 step 2-3。
|
|
77
81
|
|
|
78
|
-
<!-- harnessed-generated:v4.
|
|
82
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
@@ -54,8 +54,12 @@ Do NOT pipe to `harnessed run ship-preflight` — that is the CI/headless path (
|
|
|
54
54
|
that blocks the session inside Claude Code).
|
|
55
55
|
|
|
56
56
|
1. Bash: `harnessed prompt ship-preflight --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
57
|
-
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt`
|
|
57
|
+
2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
58
|
+
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete ship-preflight --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
59
|
+
- if it blocks, run `harnessed checkpoint fail ship-preflight --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
60
|
+
- 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.
|
|
58
61
|
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.
|
|
59
|
-
4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete ship-preflight --summary "<one-line>"`.
|
|
62
|
+
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete ship-preflight --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.
|
|
63
|
+
5. If the complete gate blocked: Bash `harnessed checkpoint fail ship-preflight --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.
|
|
60
64
|
|
|
61
|
-
<!-- harnessed-generated:v4.
|
|
65
|
+
<!-- harnessed-generated:v4.12.0 -->
|
|
@@ -51,8 +51,12 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
|
|
|
51
51
|
Code 内部会阻塞 session)。
|
|
52
52
|
|
|
53
53
|
1. Bash: `harnessed prompt ship-preflight --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
54
|
-
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn
|
|
54
|
+
2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
55
|
+
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete ship-preflight --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
56
|
+
- 若被拦下,跑 `harnessed checkpoint fail ship-preflight --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
57
|
+
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
55
58
|
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
|
|
56
|
-
4. 命中 `<promise>COMPLETE</promise
|
|
59
|
+
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete ship-preflight --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`),不是静默放行。
|
|
60
|
+
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail ship-preflight --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
57
61
|
|
|
58
|
-
<!-- harnessed-generated:v4.
|
|
62
|
+
<!-- harnessed-generated:v4.12.0 -->
|