harnessed 4.44.0 → 4.45.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/dist/cli.mjs +7491 -6754
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/messages/en.json +2 -0
- package/messages/zh-Hans.json +2 -0
- package/package.json +1 -1
- package/workflows/SCHEMA.md +31 -0
- package/workflows/auto/SKILL.md +7 -9
- package/workflows/auto/SKILL.zh-Hans.md +7 -9
- package/workflows/capabilities.yaml +16 -0
- package/workflows/disciplines/language.yaml +9 -1
- package/workflows/discuss/auto/SKILL.md +1 -1
- package/workflows/discuss/auto/SKILL.zh-Hans.md +1 -1
- 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/host-primitives.yaml +348 -0
- package/workflows/host-primitives.zh-Hans.yaml +319 -0
- package/workflows/plan/architecture/SKILL.md +4 -5
- package/workflows/plan/architecture/SKILL.zh-Hans.md +4 -5
- package/workflows/plan/auto/SKILL.md +6 -7
- package/workflows/plan/auto/SKILL.zh-Hans.md +6 -7
- package/workflows/plan/phase/SKILL.md +4 -5
- package/workflows/plan/phase/SKILL.zh-Hans.md +4 -5
- package/workflows/research/SKILL.md +5 -6
- package/workflows/research/SKILL.zh-Hans.md +5 -6
- package/workflows/retro/SKILL.md +4 -5
- package/workflows/retro/SKILL.zh-Hans.md +4 -5
- package/workflows/role-prompts.yaml +15 -16
- package/workflows/role-prompts.zh-Hans.yaml +14 -15
- package/workflows/ship/auto/SKILL.md +6 -7
- package/workflows/ship/auto/SKILL.zh-Hans.md +6 -7
- package/workflows/ship/preflight/SKILL.md +4 -5
- package/workflows/ship/preflight/SKILL.zh-Hans.md +4 -5
- package/workflows/task/auto/SKILL.md +7 -8
- package/workflows/task/auto/SKILL.zh-Hans.md +7 -8
- package/workflows/task/clarify/SKILL.md +1 -1
- package/workflows/task/clarify/SKILL.zh-Hans.md +1 -1
- package/workflows/task/code/SKILL.md +4 -5
- package/workflows/task/code/SKILL.zh-Hans.md +4 -5
- package/workflows/task/deliver/SKILL.md +11 -16
- package/workflows/task/deliver/SKILL.zh-Hans.md +11 -15
- package/workflows/task/test/SKILL.md +4 -5
- package/workflows/task/test/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/auto/SKILL.md +9 -10
- package/workflows/verify/auto/SKILL.zh-Hans.md +9 -10
- package/workflows/verify/code-review/SKILL.md +6 -8
- package/workflows/verify/code-review/SKILL.zh-Hans.md +6 -8
- package/workflows/verify/design/SKILL.md +4 -5
- package/workflows/verify/design/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/eval-review/SKILL.md +4 -5
- package/workflows/verify/eval-review/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/multispec/SKILL.md +19 -23
- package/workflows/verify/multispec/SKILL.zh-Hans.md +18 -22
- package/workflows/verify/paranoid/SKILL.md +4 -5
- package/workflows/verify/paranoid/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/progress/SKILL.md +4 -5
- package/workflows/verify/progress/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/qa/SKILL.md +4 -5
- package/workflows/verify/qa/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/second-opinion/SKILL.md +4 -5
- package/workflows/verify/second-opinion/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/security/SKILL.md +4 -5
- package/workflows/verify/security/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/simplify/SKILL.md +4 -5
- package/workflows/verify/simplify/SKILL.zh-Hans.md +4 -5
- package/workflows/verify/validate-phase/SKILL.md +4 -5
- package/workflows/verify/validate-phase/SKILL.zh-Hans.md +4 -5
|
@@ -55,17 +55,16 @@ Sister `workflows/capabilities.yaml` 条目:
|
|
|
55
55
|
|
|
56
56
|
下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
|
|
57
57
|
freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
|
|
58
|
-
|
|
58
|
+
{{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
|
|
59
59
|
|
|
60
|
-
**不要** pipe 到 `harnessed run retro` —— 那是 CI/headless 路径(
|
|
61
|
-
Code 内部会阻塞 session)。
|
|
60
|
+
**不要** pipe 到 `harnessed run retro` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
62
61
|
|
|
63
62
|
1. Bash: `harnessed prompt retro --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
64
|
-
2. 用
|
|
63
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
65
64
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete retro --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
66
65
|
- 若被拦下,跑 `harnessed checkpoint fail retro --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
67
66
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
68
|
-
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
67
|
+
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
69
68
|
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
69
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail retro --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
71
70
|
|
|
@@ -188,7 +188,7 @@ prompts:
|
|
|
188
188
|
- "For each, list 2-4 candidate answers with one-line tradeoffs"
|
|
189
189
|
- "Identify cross-phase contracts (data flow / API shape / migration order)"
|
|
190
190
|
- "Flag decisions blocking start (must answer before plan) vs. deferrable"
|
|
191
|
-
- "Deferrable = safe to default only AFTER the user has one chance to override: the orchestrator relays the deferrable set in ONE batched
|
|
191
|
+
- "Deferrable = safe to default only AFTER the user has one chance to override: the orchestrator relays the deferrable set in ONE batched {{ host.ask_user }} with recommended defaults pre-selected — a deferrable item is NOT resolved without the user"
|
|
192
192
|
- "Deferrable only if the default is reversible AND does not change the nature of any requirement (testable assertion → structural identity, changed acceptance method, altered cross-phase contract shape); if it does, mark it blocking. 'Both candidates satisfy the requirement as written' is NOT sufficient to defer"
|
|
193
193
|
- "Red flags — all invalid excuses to skip the relay: 'small change, no confirmation needed' / 'the user would probably agree' / 'the recommendation is obvious, adopt the default' / 'asking interrupts the flow'. Decision points have no size exception — relay anyway"
|
|
194
194
|
- "Persist to `.planning/phases/<NN>-<slug>/findings.md` + `knowledge.md` for hand-off (NN = two-digit, one above the highest existing phase dir; slug = kebab-case short name)"
|
|
@@ -373,10 +373,10 @@ prompts:
|
|
|
373
373
|
- "On loop entry, give the agent the full spec + acceptance criteria + completion promise"
|
|
374
374
|
- "If agent emits 'COMPLETE' verbatim, mark progress.md done via `/plan`"
|
|
375
375
|
- "On BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP from `harnessed checkpoint fail`, emit warning + halt; do NOT silent-continue"
|
|
376
|
-
- "If teammate communication needed / context overflow → escalate to
|
|
377
|
-
- "
|
|
376
|
+
- "If {{ host.teammate }} communication needed / context overflow → escalate to {{ host.team }}"
|
|
377
|
+
- "{{ host.teams_cleanup_note.checklist }}"
|
|
378
378
|
severity: "complete / max-iter-exceeded / escalated-to-teams"
|
|
379
|
-
description: "Drive subtask through the completion gate with a verbatim COMPLETE promise; escalate to
|
|
379
|
+
description: "Drive subtask through the completion gate with a verbatim COMPLETE promise; escalate to {{ host.team }} when needed."
|
|
380
380
|
|
|
381
381
|
# ============================================================================
|
|
382
382
|
# verify-* (8 subs)
|
|
@@ -521,24 +521,23 @@ prompts:
|
|
|
521
521
|
|
|
522
522
|
verify-multispec:
|
|
523
523
|
primary_cap: "agent-teams-create"
|
|
524
|
-
specialist: "Multi-specialist
|
|
524
|
+
specialist: "Multi-specialist {{ host.team.singular }} orchestrator (Pattern C)"
|
|
525
525
|
responsibility: |
|
|
526
|
-
Critical release / large refactor only. Spawn 4 background
|
|
527
|
-
(code-review + gstack-review + gstack-cso + gstack-qa)
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
arbitrates final report. Stop every teammate before finishing.
|
|
526
|
+
Critical release / large refactor only. Spawn 4 background {{ host.teammate.plural }}
|
|
527
|
+
(code-review + gstack-review + gstack-cso + gstack-qa) {{ host.multispec_spawn_note.responsibility }} let them
|
|
528
|
+
cross-question findings via {{ host.send_message }} (NOT fire-and-forget), lead
|
|
529
|
+
arbitrates final report. Stop every {{ host.teammate }} before finishing.
|
|
531
530
|
checklist:
|
|
532
531
|
- "Token-cost gate: estimate team_cost vs 2 × subagent_cost; only escalate when team wins"
|
|
533
|
-
- "Spawn 4 background
|
|
534
|
-
- "Each teammate's brief is self-contained (no shared session context to lean on)"
|
|
535
|
-
- "
|
|
536
|
-
- "Round-trip findings: each teammate sends top-3 findings; others rate (real / false-positive / nit)"
|
|
532
|
+
- "Spawn 4 background {{ host.teammate.plural }} {{ host.multispec_spawn_note.checklist }}: code-review / gstack-review / gstack-cso / gstack-qa"
|
|
533
|
+
- "Each {{ host.teammate }}'s brief is self-contained (no shared session context to lean on)"
|
|
534
|
+
- "{{ host.delivery_contract_note.checklist }}"
|
|
535
|
+
- "Round-trip findings: each {{ host.teammate }} sends top-3 findings; others rate (real / false-positive / nit)"
|
|
537
536
|
- "Lead arbitrates conflicts; produces final report ordered CRITICAL → HIGH → MEDIUM"
|
|
538
|
-
- "
|
|
537
|
+
- "{{ host.teams_cleanup_note.multispec_checklist }}"
|
|
539
538
|
- "If the gate doesn't fire (regular PR), DO NOT escalate — fall back to single-agent fan-out"
|
|
540
539
|
severity: "ship-blocker / ship-with-action / informational"
|
|
541
|
-
description: "Pattern C 4-specialist
|
|
540
|
+
description: "Pattern C 4-specialist {{ host.team.singular }} — critical-release multi-dimensional review with {{ host.send_message }} cross-questioning."
|
|
542
541
|
|
|
543
542
|
# ============================================================================
|
|
544
543
|
# ship-* (1 sub)
|
|
@@ -174,7 +174,7 @@ prompts:
|
|
|
174
174
|
- "对每个问题,列 2-4 个候选答案并附一行 tradeoff"
|
|
175
175
|
- "识别跨 phase 契约(数据流 / API 形态 / 迁移顺序)"
|
|
176
176
|
- "标出阻塞启动的决策(规划前必须答)vs. 可延后的"
|
|
177
|
-
- "deferrable = 仅在用户有一次 override 机会之后才可采用默认值:orchestrator 必须把 deferrable 集以单轮批量
|
|
177
|
+
- "deferrable = 仅在用户有一次 override 机会之后才可采用默认值:orchestrator 必须把 deferrable 集以单轮批量 {{ host.ask_user }} 转达给用户(推荐默认值预选)—— deferrable 项不允许在用户不知情时被 resolve"
|
|
178
178
|
- "仅当默认值可逆且不会改变任何需求的本质(可测试断言 → 结构恒真、验收方法变更、跨 phase contract 形态改变)时才可标 deferrable;若会改变,升格为 blocking。『两个候选都满足现有需求原文』不足以 defer"
|
|
179
179
|
- "Red flags —— 以下全是跳过 relay 的无效借口:『改动很小,不用确认』/『用户大概率会同意』/『推荐答案很明显,直接采用默认』/『问一下会打断节奏』。决策点没有大小豁免 —— 一律 relay"
|
|
180
180
|
- "持久化到 `.planning/phases/<NN>-<slug>/findings.md` + `knowledge.md` 以便交接(NN = 两位数,取现有最大 phase 目录号 + 1;slug = kebab 短名)"
|
|
@@ -350,10 +350,10 @@ prompts:
|
|
|
350
350
|
- "进入循环时,把完整 spec + 验收标准 + completion promise 交给 agent"
|
|
351
351
|
- "若 agent 逐字吐出 'COMPLETE',经 `/plan` 标记 progress.md 完成"
|
|
352
352
|
- "`harnessed checkpoint fail` 打出 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP 时,发警告 + 停止;不要静默继续"
|
|
353
|
-
- "若需要 teammate 通信 / context 溢出 → 升级到
|
|
354
|
-
- "
|
|
353
|
+
- "若需要 {{ host.teammate }} 通信 / context 溢出 → 升级到 {{ host.team }}"
|
|
354
|
+
- "{{ host.teams_cleanup_note.checklist }}"
|
|
355
355
|
severity: "complete / max-iter-exceeded / escalated-to-teams"
|
|
356
|
-
description: "用逐字 COMPLETE 承诺把子任务过完成门;需要时升级到
|
|
356
|
+
description: "用逐字 COMPLETE 承诺把子任务过完成门;需要时升级到 {{ host.team }}。"
|
|
357
357
|
|
|
358
358
|
# ============================================================================
|
|
359
359
|
# verify-* (8 subs)
|
|
@@ -496,23 +496,22 @@ prompts:
|
|
|
496
496
|
|
|
497
497
|
verify-multispec:
|
|
498
498
|
primary_cap: "agent-teams-create"
|
|
499
|
-
specialist: "多 specialist
|
|
499
|
+
specialist: "多 specialist {{ host.team.singular }} 编排器(Pattern C)"
|
|
500
500
|
responsibility: |
|
|
501
|
-
仅限关键发布 / 大型重构。spawn 4 个后台 teammate
|
|
502
|
-
(code-review + gstack-review + gstack-cso + gstack-qa)
|
|
503
|
-
|
|
504
|
-
(不是 fire-and-forget),lead 裁决最终报告。收尾前必须停掉每个 teammate。
|
|
501
|
+
仅限关键发布 / 大型重构。spawn 4 个后台 {{ host.teammate.plural }}
|
|
502
|
+
(code-review + gstack-review + gstack-cso + gstack-qa){{ host.multispec_spawn_note.responsibility }} 让它们经 {{ host.send_message }} 交叉质询发现
|
|
503
|
+
(不是 fire-and-forget),lead 裁决最终报告。收尾前必须停掉每个 {{ host.teammate }}。
|
|
505
504
|
checklist:
|
|
506
505
|
- "Token 成本关卡:估算 team_cost vs 2 × subagent_cost;只在 team 划算时升级"
|
|
507
|
-
- "spawn 4 个后台 teammate
|
|
508
|
-
- "每个 teammate 的 brief 自包含(没有共享 session 上下文可依赖)"
|
|
509
|
-
- "
|
|
510
|
-
- "往返发现:每个 teammate 发 top-3 发现;其他人评级(真 / 误报 / 吹毛求疵)"
|
|
506
|
+
- "spawn 4 个后台 {{ host.teammate.plural }}{{ host.multispec_spawn_note.checklist }}:code-review / gstack-review / gstack-cso / gstack-qa"
|
|
507
|
+
- "每个 {{ host.teammate }} 的 brief 自包含(没有共享 session 上下文可依赖)"
|
|
508
|
+
- "{{ host.delivery_contract_note.checklist }}"
|
|
509
|
+
- "往返发现:每个 {{ host.teammate }} 发 top-3 发现;其他人评级(真 / 误报 / 吹毛求疵)"
|
|
511
510
|
- "Lead 裁决冲突;产出按 CRITICAL → HIGH → MEDIUM 排序的最终报告"
|
|
512
|
-
- "
|
|
511
|
+
- "{{ host.teams_cleanup_note.multispec_checklist }}"
|
|
513
512
|
- "若关卡未触发(常规 PR),不要升级 —— 回退到单 agent fan-out"
|
|
514
513
|
severity: "ship-blocker / ship-with-action / informational"
|
|
515
|
-
description: "Pattern C 4-specialist
|
|
514
|
+
description: "Pattern C 4-specialist {{ host.team.singular }} —— 关键发布的多维度审查,带 {{ host.send_message }} 交叉质询。"
|
|
516
515
|
|
|
517
516
|
# ============================================================================
|
|
518
517
|
# ship-* (1 sub)
|
|
@@ -56,25 +56,24 @@ The numbered sequence below **is** the state machine — execute it step by step
|
|
|
56
56
|
Do NOT improvise an equivalent flow from the Overview above: freelancing bypasses the engine
|
|
57
57
|
(no per-sub ledger, no evidence guard, no recovery). harnessed is the orchestration brain
|
|
58
58
|
(`harnessed gates` says which subs fire, `harnessed prompt` gives each spawn-ready prompt,
|
|
59
|
-
`harnessed checkpoint` records the ledger); YOU spawn with
|
|
59
|
+
`harnessed checkpoint` records the ledger); YOU spawn with {{ host.native }} {{ host.spawn_subagent.plural }}.
|
|
60
60
|
|
|
61
|
-
Do NOT pipe to `harnessed run ship` — that is the CI/headless path (
|
|
62
|
-
that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
|
|
61
|
+
Do NOT pipe to `harnessed run ship` — that is the CI/headless path ({{ host.harnessed_run_warning_note.orchestrator_tail }}
|
|
63
62
|
|
|
64
|
-
1. If the clarification criteria fire for "$ARGUMENTS" (≥2 approaches / core algorithm / API contract / high error cost), clarify interactively in THIS session first (
|
|
63
|
+
1. If the clarification criteria fire for "$ARGUMENTS" (≥2 approaches / core algorithm / API contract / high error cost), clarify interactively in THIS session first ({{ host.ask_user }}) and lock decisions; otherwise transparent-skip. Produce a locked spec.
|
|
65
64
|
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
65
|
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.
|
|
67
66
|
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.
|
|
68
|
-
|
|
67
|
+
{{ host.teams_step_note.skill }}
|
|
69
68
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
70
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 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.
|
|
71
70
|
- **Else (leaf sub):**
|
|
72
71
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
73
|
-
b. Spawn a
|
|
72
|
+
b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
74
73
|
- 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
74
|
- 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
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.
|
|
77
|
-
c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via
|
|
76
|
+
c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
78
77
|
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
78
|
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.
|
|
80
79
|
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.
|
|
@@ -54,25 +54,24 @@ preflight 通过后,主控将 PR + deploy 委派给 gstack `/ship`(组合复
|
|
|
54
54
|
下面这套编号序列**就是** state machine —— 逐步用 Bash 执行。**不要**从上方 Overview 自行演绎一套
|
|
55
55
|
等价流程:freestyle 会旁路引擎(无 per-sub ledger、无 evidence guard、无 recovery)。harnessed 是
|
|
56
56
|
编排大脑(`harnessed gates` 决定哪些 sub fire,`harnessed prompt` 给出每个 spawn-ready prompt,
|
|
57
|
-
`harnessed checkpoint` 记录 ledger);**你**(主 session)用
|
|
57
|
+
`harnessed checkpoint` 记录 ledger);**你**(主 session)用 {{ host.native }} {{ host.spawn_subagent.zh_tool }}做 spawn。
|
|
58
58
|
|
|
59
|
-
**不要** pipe 到 `harnessed run ship` —— 那是 CI/headless 路径(
|
|
60
|
-
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
59
|
+
**不要** pipe 到 `harnessed run ship` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.orchestrator_tail }}
|
|
61
60
|
|
|
62
|
-
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清(
|
|
61
|
+
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清({{ host.ask_user }})并锁决策;否则透明 skip。产出 locked spec。
|
|
63
62
|
1b. Bash: `harnessed facts ship --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
64
63
|
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。
|
|
65
64
|
3. Bash: `harnessed checkpoint start ship --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
66
|
-
|
|
65
|
+
{{ host.teams_step_note.skill }}
|
|
67
66
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
68
67
|
- **若该项 `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 重复本循环。
|
|
69
68
|
- **否则(leaf sub):**
|
|
70
69
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
71
|
-
b. 用
|
|
70
|
+
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
72
71
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
73
72
|
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
74
73
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
75
|
-
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
74
|
+
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
76
75
|
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
76
|
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
78
77
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
|
|
@@ -48,17 +48,16 @@ pushed (with explicit user approval).
|
|
|
48
48
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
49
49
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
50
50
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
51
|
-
|
|
51
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
52
52
|
|
|
53
|
-
Do NOT pipe to `harnessed run ship-preflight` — that is the CI/headless path (
|
|
54
|
-
that blocks the session inside Claude Code).
|
|
53
|
+
Do NOT pipe to `harnessed run ship-preflight` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
55
54
|
|
|
56
55
|
1. Bash: `harnessed prompt ship-preflight --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
57
|
-
2. Spawn a
|
|
56
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
58
57
|
- 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
58
|
- 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
59
|
- respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
|
|
61
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
60
|
+
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
62
61
|
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
62
|
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.
|
|
64
63
|
|
|
@@ -45,17 +45,16 @@ trigger_phrases:
|
|
|
45
45
|
|
|
46
46
|
下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
|
|
47
47
|
freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
|
|
48
|
-
|
|
48
|
+
{{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
|
|
49
49
|
|
|
50
|
-
**不要** pipe 到 `harnessed run ship-preflight` —— 那是 CI/headless 路径(
|
|
51
|
-
Code 内部会阻塞 session)。
|
|
50
|
+
**不要** pipe 到 `harnessed run ship-preflight` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
52
51
|
|
|
53
52
|
1. Bash: `harnessed prompt ship-preflight --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
54
|
-
2. 用
|
|
53
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
55
54
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete ship-preflight --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
56
55
|
- 若被拦下,跑 `harnessed checkpoint fail ship-preflight --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
57
56
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
58
|
-
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
57
|
+
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
59
58
|
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
59
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail ship-preflight --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
61
60
|
|
|
@@ -39,7 +39,7 @@ mode delegate carries explicit `order`。Each subtask 入口走一次此 master
|
|
|
39
39
|
|
|
40
40
|
完成闸门是正交 wrapper, 套在 deliver sub 的 01-deliver phase 外层保 completion-promise
|
|
41
41
|
verbatim "COMPLETE" (R20.10)。任何执行单元 (subagent / team / 主 session) 都可外层套它
|
|
42
|
-
保 completion-promise (bundled subagent vs
|
|
42
|
+
保 completion-promise (bundled subagent vs {{ host.team.attributive }} routing — orthogonal wrapper rule).
|
|
43
43
|
|
|
44
44
|
它是 harnessed 自有的 CLI,不是上游 plugin (ADR 0039,4.36.0 摘除 `/ralph-loop` 依赖):
|
|
45
45
|
`harnessed checkpoint complete <sub> --result-file <path>` 对产物 / TDD boundary / verbatim
|
|
@@ -72,25 +72,24 @@ The numbered sequence below **is** the state machine — execute it step by step
|
|
|
72
72
|
Do NOT improvise an equivalent flow from the Overview above: freelancing bypasses the engine
|
|
73
73
|
(no per-sub ledger, no evidence guard, no recovery). harnessed is the orchestration brain
|
|
74
74
|
(`harnessed gates` says which subs fire, `harnessed prompt` gives each spawn-ready prompt,
|
|
75
|
-
`harnessed checkpoint` records the ledger); YOU spawn with
|
|
75
|
+
`harnessed checkpoint` records the ledger); YOU spawn with {{ host.native }} {{ host.spawn_subagent.plural }}.
|
|
76
76
|
|
|
77
|
-
Do NOT pipe to `harnessed run task` — that is the CI/headless path (
|
|
78
|
-
that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
|
|
77
|
+
Do NOT pipe to `harnessed run task` — that is the CI/headless path ({{ host.harnessed_run_warning_note.orchestrator_tail }}
|
|
79
78
|
|
|
80
|
-
1. If the clarification criteria fire for "$ARGUMENTS" (≥2 approaches / core algorithm / API contract / high error cost), clarify interactively in THIS session first (
|
|
79
|
+
1. If the clarification criteria fire for "$ARGUMENTS" (≥2 approaches / core algorithm / API contract / high error cost), clarify interactively in THIS session first ({{ host.ask_user }}) and lock decisions; otherwise transparent-skip. Produce a locked spec.
|
|
81
80
|
1b. Bash: `harnessed facts task --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.
|
|
82
81
|
2. Bash: `harnessed gates task --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.
|
|
83
82
|
3. Bash: `harnessed checkpoint start task --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
|
|
84
|
-
|
|
83
|
+
{{ host.teams_step_note.skill }}
|
|
85
84
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
86
85
|
- **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.
|
|
87
86
|
- **Else (leaf sub):**
|
|
88
87
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
89
|
-
b. Spawn a
|
|
88
|
+
b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
90
89
|
- 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>`.
|
|
91
90
|
- 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.
|
|
92
91
|
- 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.
|
|
93
|
-
c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via
|
|
92
|
+
c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
94
93
|
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).
|
|
95
94
|
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.
|
|
96
95
|
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.
|
|
@@ -39,7 +39,7 @@ mode delegate 必须携带显式 `order`。每个 subtask 入口走一次此主
|
|
|
39
39
|
|
|
40
40
|
完成闸门是正交 wrapper, 套在 deliver sub 的 01-deliver phase 外层保 completion-promise
|
|
41
41
|
verbatim "COMPLETE" (R20.10)。任何执行单元 (subagent / team / 主 session) 都可外层套它
|
|
42
|
-
保 completion-promise (bundled subagent vs
|
|
42
|
+
保 completion-promise (bundled subagent vs {{ host.team.attributive }} routing — orthogonal wrapper rule).
|
|
43
43
|
|
|
44
44
|
它是 harnessed 自有的 CLI,不是上游 plugin (ADR 0039,4.36.0 摘除 `/ralph-loop` 依赖):
|
|
45
45
|
`harnessed checkpoint complete <sub> --result-file <path>` 对产物 / TDD boundary / verbatim
|
|
@@ -71,25 +71,24 @@ Sister `workflows/capabilities.yaml`:
|
|
|
71
71
|
下面这套编号序列**就是** state machine —— 逐步用 Bash 执行。**不要**从上方 Overview 自行演绎一套
|
|
72
72
|
等价流程:freestyle 会旁路引擎(无 per-sub ledger、无 evidence guard、无 recovery)。harnessed 是
|
|
73
73
|
编排大脑(`harnessed gates` 决定哪些 sub fire,`harnessed prompt` 给出每个 spawn-ready prompt,
|
|
74
|
-
`harnessed checkpoint` 记录 ledger);**你**(主 session)用
|
|
74
|
+
`harnessed checkpoint` 记录 ledger);**你**(主 session)用 {{ host.native }} {{ host.spawn_subagent.zh_tool }}做 spawn。
|
|
75
75
|
|
|
76
|
-
**不要** pipe 到 `harnessed run task` —— 那是 CI/headless 路径(
|
|
77
|
-
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
76
|
+
**不要** pipe 到 `harnessed run task` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.orchestrator_tail }}
|
|
78
77
|
|
|
79
|
-
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清(
|
|
78
|
+
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清({{ host.ask_user }})并锁决策;否则透明 skip。产出 locked spec。
|
|
80
79
|
1b. Bash: `harnessed facts task --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
81
80
|
2. Bash: `harnessed gates task --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。
|
|
82
81
|
3. Bash: `harnessed checkpoint start task --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
83
|
-
|
|
82
|
+
{{ host.teams_step_note.skill }}
|
|
84
83
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
85
84
|
- **若该项 `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 重复本循环。
|
|
86
85
|
- **否则(leaf sub):**
|
|
87
86
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
88
|
-
b. 用
|
|
87
|
+
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
89
88
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
90
89
|
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
91
90
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
92
|
-
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
91
|
+
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
93
92
|
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`,是可审计的覆盖而非静默放行)。
|
|
94
93
|
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
95
94
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
|
|
@@ -66,7 +66,7 @@ execution stages.
|
|
|
66
66
|
- **Strategic** — new feature / milestone / unclear business scope → gstack `/office-hours` + `/plan-ceo-review`
|
|
67
67
|
- **Phase** — ≥2 open implementation decisions / unclear cross-phase API contract → GSD `/gsd-discuss-phase`
|
|
68
68
|
- **Subtask** — ≥2 distinct approaches / core algorithm / API contract design / high error cost → superpowers brainstorming
|
|
69
|
-
2. For each layer that fires, hold the dialogue with the user (use
|
|
69
|
+
2. For each layer that fires, hold the dialogue with the user (use {{ host.ask_user }} for option-style decisions) and lock every open decision.
|
|
70
70
|
3. Transparent-skip layers that don't fire — state which were skipped and why.
|
|
71
71
|
4. Persist the locked decisions to `.planning/` via planning-with-files (`findings.md` / `task_plan.md`).
|
|
72
72
|
|
|
@@ -63,7 +63,7 @@ Phase 01-brainstorm 在 `phase.spec_ambiguous == true` 时条件性 fire `grill-
|
|
|
63
63
|
- **战略层** —— 新功能 / 新 milestone / 商业 scope 不清 → gstack `/office-hours` + `/plan-ceo-review`
|
|
64
64
|
- **Phase 层** —— ≥2 个 open implementation decision / 跨 phase API contract 不清 → GSD `/gsd-discuss-phase`
|
|
65
65
|
- **子任务层** —— ≥2 个不同方案 / 核心算法 / API contract 设计 / 高错误成本 → superpowers brainstorming
|
|
66
|
-
2. 对每个 fire 的层与用户对话(option 型决策用
|
|
66
|
+
2. 对每个 fire 的层与用户对话(option 型决策用 {{ host.ask_user }}),锁定每个 open decision。
|
|
67
67
|
3. 不 fire 的层透明 skip —— 说明哪些被 skip 及原因。
|
|
68
68
|
4. 把 locked 决策持久化到 `.planning/`(planning-with-files 的 `findings.md` / `task_plan.md`)。
|
|
69
69
|
|
|
@@ -75,17 +75,16 @@ marketplace).
|
|
|
75
75
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
76
76
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
77
77
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
78
|
-
|
|
78
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
79
79
|
|
|
80
|
-
Do NOT pipe to `harnessed run task-code` — that is the CI/headless path (
|
|
81
|
-
that blocks the session inside Claude Code).
|
|
80
|
+
Do NOT pipe to `harnessed run task-code` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
82
81
|
|
|
83
82
|
1. Bash: `harnessed prompt task-code --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
84
|
-
2. Spawn a
|
|
83
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
85
84
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete task-code --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
86
85
|
- if it blocks, run `harnessed checkpoint fail task-code --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
87
86
|
- 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.
|
|
88
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
87
|
+
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
89
88
|
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete task-code --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.
|
|
90
89
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail task-code --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.
|
|
91
90
|
|
|
@@ -73,17 +73,16 @@ codegraph MCP 工具(`codegraph_explore`),替代 grep/glob/逐文件 Read
|
|
|
73
73
|
|
|
74
74
|
下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
|
|
75
75
|
freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
|
|
76
|
-
|
|
76
|
+
{{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
|
|
77
77
|
|
|
78
|
-
**不要** pipe 到 `harnessed run task-code` —— 那是 CI/headless 路径(
|
|
79
|
-
Code 内部会阻塞 session)。
|
|
78
|
+
**不要** pipe 到 `harnessed run task-code` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
80
79
|
|
|
81
80
|
1. Bash: `harnessed prompt task-code --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
82
|
-
2. 用
|
|
81
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
83
82
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete task-code --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
84
83
|
- 若被拦下,跑 `harnessed checkpoint fail task-code --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
85
84
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
86
|
-
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
85
|
+
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
87
86
|
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete task-code --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`),不是静默放行。
|
|
88
87
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail task-code --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
89
88
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: task-deliver
|
|
3
3
|
description: |
|
|
4
4
|
task-deliver workflow v3 — Stage ③.d 子任务交付 sub-workflow (harnessed 自有 completion-gate
|
|
5
|
-
+
|
|
5
|
+
+ {{ host.team.attributive }} conditional escalation + R20.10 explicit max_iterations_exceeded
|
|
6
6
|
fallback)。2-phase composition: 01-deliver (completion-gate with completion_promise
|
|
7
7
|
verbatim "COMPLETE" + parallelism judgments.parallelism-gate.completion-gate-wrapper.fires +
|
|
8
8
|
fallback emit_warning_and_halt exit_code 1) → 02-progress-mark (Claude Code plugin
|
|
@@ -26,8 +26,7 @@ trigger_phrases:
|
|
|
26
26
|
|
|
27
27
|
2-phase sub-workflow mapping the user's CLAUDE.md Stage ③.d 子任务交付 discipline
|
|
28
28
|
onto the harnessed runtime, fully `harnessed.workflow.v3` schema (Phase v3.0-3.4 W0
|
|
29
|
-
T3.4.W0.9 — D-09 L0 Discipline Substrate + D-10 completion gate + D-11
|
|
30
|
-
Teams 升级 5 触发 OR-chain + R20.10 explicit max_iterations_exceeded handler).
|
|
29
|
+
T3.4.W0.9 — D-09 L0 Discipline Substrate + D-10 completion gate + D-11 {{ host.team.wrapped }} 升级 5 触发 OR-chain + R20.10 explicit max_iterations_exceeded handler).
|
|
31
30
|
|
|
32
31
|
| phase | id | upstream | model | capability / args / parallelism / fallback |
|
|
33
32
|
| ----- | -- | -------- | ----- | ------------------------------------------ |
|
|
@@ -67,19 +66,16 @@ main-session-fallback 任 1 mode 外层 (NOT 互斥触发器, 而是 `wraps:` or
|
|
|
67
66
|
in parallelism-gate.yaml). Runtime engine 评估 wrapping mode 后 spawn 相应
|
|
68
67
|
execution unit + 套 completion check。
|
|
69
68
|
|
|
70
|
-
###
|
|
69
|
+
### {{ host.team.attributive }} conditional escalation (D-11 + agent-teams.md 5 OR-chain)
|
|
71
70
|
|
|
72
71
|
5 升级触发 (per capabilities.yaml `agent-teams-create.fires_when` + agent-teams.md):
|
|
73
|
-
1. `teammate_send_message_needed == true` — teammate 间
|
|
72
|
+
1. `teammate_send_message_needed == true` — {{ host.teammate }} 间 {{ host.send_message }} 互通 (NOT fire-and-forget)
|
|
74
73
|
2. `subagent_context_overflow == true` — subagent 撞 context 上限
|
|
75
|
-
3. `shared_task_list == true` — 多 teammate 共享 task list 自协调
|
|
74
|
+
3. `shared_task_list == true` — 多 {{ host.teammate }} 共享 task list 自协调
|
|
76
75
|
4. `opposing_hypothesis_debate == true` — 对立假设辩论
|
|
77
76
|
5. `fullstack_three_way == true` — 全栈三路协同
|
|
78
77
|
|
|
79
|
-
|
|
80
|
-
per agent-teams.md 防呆清单 (lead 按名请求每个 teammate shut down; CC 2.1.178+ 无 teardown
|
|
81
|
-
工具,团目录 session 退出时自动清理 —— 剩下的纪律是别把 teammate 落在运行态) — engine-level
|
|
82
|
-
wiring, NOT yaml schema scope。
|
|
78
|
+
{{ host.teams_cleanup_note.deliver }}
|
|
83
79
|
|
|
84
80
|
### R20.10 explicit max_iterations_exceeded handler (NOT silent abort)
|
|
85
81
|
|
|
@@ -109,17 +105,16 @@ Claude Code plugin marketplace).
|
|
|
109
105
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
110
106
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
111
107
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
112
|
-
|
|
108
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
113
109
|
|
|
114
|
-
Do NOT pipe to `harnessed run task-deliver` — that is the CI/headless path (
|
|
115
|
-
that blocks the session inside Claude Code).
|
|
110
|
+
Do NOT pipe to `harnessed run task-deliver` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
116
111
|
|
|
117
112
|
1. Bash: `harnessed prompt task-deliver --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
118
|
-
2. Spawn a
|
|
113
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
119
114
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete task-deliver --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
120
115
|
- if it blocks, run `harnessed checkpoint fail task-deliver --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
121
116
|
- 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.
|
|
122
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
117
|
+
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
123
118
|
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete task-deliver --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.
|
|
124
119
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail task-deliver --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.
|
|
125
120
|
|
|
@@ -129,7 +124,7 @@ that blocks the session inside Claude Code).
|
|
|
129
124
|
|
|
130
125
|
- D-09 — L0 Discipline Substrate always-on (6 disciplines)
|
|
131
126
|
- D-10 — 完成保证真接 SDK wrapper (NOT mock reference; v0.2.0 ship)
|
|
132
|
-
- D-11 —
|
|
127
|
+
- D-11 — {{ host.team.attributive }} 升级 5 触发 OR-chain per bundled parallelism-gate rules
|
|
133
128
|
- R20.10 — max_iterations_exceeded explicit emit_warning_and_halt
|
|
134
129
|
(acceptance c "NOT silent abort"); completion gate 正交 wrapper wraps 3 mode
|
|
135
130
|
- D-02 — SKILL.md `name:` bare slash cmd (`task-deliver` NOT `task/deliver`) per ADR 0030
|