harnessed 5.0.11 → 5.0.13
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/CHANGELOG.md +25 -0
- package/README-en.md +1 -0
- package/README-zh.md +1 -0
- package/README.md +1 -0
- package/bin/harnessed-check-docs.mjs +15 -0
- package/bin/harnessed-update-reminder-worker.mjs +2598 -134
- package/bin/harnessed-update-reminder.mjs +636 -61
- package/dist/cli.mjs +1597 -546
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/messages/en.json +15 -1
- package/messages/zh-Hans.json +15 -1
- package/package.json +1 -1
- package/workflows/auto/SKILL.md +10 -18
- package/workflows/auto/SKILL.zh-Hans.md +8 -18
- package/workflows/discuss/auto/SKILL.md +4 -7
- package/workflows/discuss/auto/SKILL.zh-Hans.md +2 -7
- package/workflows/discuss/phase/SKILL.md +4 -7
- package/workflows/discuss/phase/SKILL.zh-Hans.md +2 -7
- package/workflows/discuss/strategic/SKILL.md +4 -8
- package/workflows/discuss/strategic/SKILL.zh-Hans.md +2 -8
- package/workflows/discuss/subtask/SKILL.md +4 -7
- package/workflows/discuss/subtask/SKILL.zh-Hans.md +2 -7
- package/workflows/harnessed-update/SKILL.md +9 -8
- package/workflows/harnessed-update/SKILL.zh-Hans.md +7 -8
- package/workflows/host-primitives.yaml +8 -8
- package/workflows/host-primitives.zh-Hans.yaml +8 -8
- package/workflows/plan/ai-integration/SKILL.md +7 -7
- package/workflows/plan/ai-integration/SKILL.zh-Hans.md +7 -7
- package/workflows/plan/architecture/SKILL.md +7 -13
- package/workflows/plan/architecture/SKILL.zh-Hans.md +7 -13
- package/workflows/plan/auto/SKILL.md +8 -14
- package/workflows/plan/auto/SKILL.zh-Hans.md +8 -14
- package/workflows/plan/phase/SKILL.md +7 -13
- package/workflows/plan/phase/SKILL.zh-Hans.md +7 -13
- package/workflows/plan/secure/SKILL.md +7 -7
- package/workflows/plan/secure/SKILL.zh-Hans.md +7 -7
- package/workflows/plan/spec/SKILL.md +7 -7
- package/workflows/plan/spec/SKILL.zh-Hans.md +7 -7
- package/workflows/plan/ui/SKILL.md +7 -7
- package/workflows/plan/ui/SKILL.zh-Hans.md +7 -7
- package/workflows/research/SKILL.md +7 -7
- package/workflows/research/SKILL.zh-Hans.md +7 -7
- package/workflows/retro/SKILL.md +8 -15
- package/workflows/retro/SKILL.zh-Hans.md +7 -15
- package/workflows/ship/auto/SKILL.md +8 -14
- package/workflows/ship/auto/SKILL.zh-Hans.md +8 -14
- package/workflows/ship/preflight/SKILL.md +7 -9
- package/workflows/ship/preflight/SKILL.zh-Hans.md +7 -9
- package/workflows/task/auto/SKILL.md +8 -15
- package/workflows/task/auto/SKILL.zh-Hans.md +8 -15
- package/workflows/task/clarify/SKILL.md +2 -10
- package/workflows/task/clarify/SKILL.zh-Hans.md +2 -10
- package/workflows/task/code/SKILL.md +7 -15
- package/workflows/task/code/SKILL.zh-Hans.md +7 -15
- package/workflows/task/deliver/SKILL.md +7 -17
- package/workflows/task/deliver/SKILL.zh-Hans.md +7 -17
- package/workflows/task/test/SKILL.md +7 -14
- package/workflows/task/test/SKILL.zh-Hans.md +7 -14
- package/workflows/verify/auto/SKILL.md +9 -14
- package/workflows/verify/auto/SKILL.zh-Hans.md +9 -14
- package/workflows/verify/code-review/SKILL.md +8 -13
- package/workflows/verify/code-review/SKILL.zh-Hans.md +8 -13
- package/workflows/verify/design/SKILL.md +8 -12
- package/workflows/verify/design/SKILL.zh-Hans.md +7 -12
- package/workflows/verify/eval-review/SKILL.md +8 -12
- package/workflows/verify/eval-review/SKILL.zh-Hans.md +7 -12
- package/workflows/verify/multispec/SKILL.md +8 -15
- package/workflows/verify/multispec/SKILL.zh-Hans.md +7 -15
- package/workflows/verify/paranoid/SKILL.md +7 -14
- package/workflows/verify/paranoid/SKILL.zh-Hans.md +7 -14
- package/workflows/verify/progress/SKILL.md +8 -13
- package/workflows/verify/progress/SKILL.zh-Hans.md +8 -13
- package/workflows/verify/qa/SKILL.md +7 -13
- package/workflows/verify/qa/SKILL.zh-Hans.md +7 -13
- package/workflows/verify/second-opinion/SKILL.md +8 -12
- package/workflows/verify/second-opinion/SKILL.zh-Hans.md +7 -12
- package/workflows/verify/security/SKILL.md +8 -12
- package/workflows/verify/security/SKILL.zh-Hans.md +7 -12
- package/workflows/verify/simplify/SKILL.md +8 -12
- package/workflows/verify/simplify/SKILL.zh-Hans.md +7 -12
- package/workflows/verify/validate-phase/SKILL.md +8 -12
- package/workflows/verify/validate-phase/SKILL.zh-Hans.md +7 -12
|
@@ -214,15 +214,15 @@ primitives:
|
|
|
214
214
|
# `default` 别名指向 `.skill`(30 处,command 面只有 1 处)。
|
|
215
215
|
teams_step_note:
|
|
216
216
|
default: &teams_step_skill
|
|
217
|
-
claude: '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`)。'
|
|
217
|
+
claude: '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`)。 每个 sub 的完成信号来自**结果文件**,而不是通知:`harnessed prompt <sub>` 会打印该 sub 的结果文件路径,`harnessed checkpoint complete <sub> --result-file <path> --wait <秒>` 就是对该文件的有界等待 —— 通知只用于提前唤醒,永远不是完成凭据。'
|
|
218
218
|
# 删掉了「读 ~/.claude/rules/agent-teams.md」—— codex 上该文件不存在;
|
|
219
219
|
# F7b 已定调:codex 变体不引用外部文件,改为内联要点。
|
|
220
|
-
codex: '4. 若 `parallelism.escalate_to_teams === true`:对每个 fired sub 用 `spawn_agent(message: <该 sub 的 `harnessed prompt <sub>` prompt>)` spawn 一个 agent —— 该工具只有 `agent_type` 与 `message` 两个参数,`agent_type` 指的是 `~/.codex/agents/` 下的 agent role 而不是任务标签,所以把 sub 名写进 message。用 `send_input(target, items)` 协调;`wait_agent` 阻塞等待其中一个结束,`list_agents` 列出运行中的集合。某个 sub 完成后用 `close_agent` 关闭它。每个 sub 仍按下方 checkpoint(`complete` / `fail`)。TODO(未验证):codex agent 的生命周期 —— 是否 session-scoped、退出时是否自动回收、能否嵌套 spawn。实测之前不得依赖。'
|
|
220
|
+
codex: '4. 若 `parallelism.escalate_to_teams === true`:对每个 fired sub 用 `spawn_agent(message: <该 sub 的 `harnessed prompt <sub>` prompt>)` spawn 一个 agent —— 该工具只有 `agent_type` 与 `message` 两个参数,`agent_type` 指的是 `~/.codex/agents/` 下的 agent role 而不是任务标签,所以把 sub 名写进 message。用 `send_input(target, items)` 协调;`wait_agent` 阻塞等待其中一个结束,`list_agents` 列出运行中的集合。某个 sub 完成后用 `close_agent` 关闭它。每个 sub 仍按下方 checkpoint(`complete` / `fail`)。 每个 agent 的完成信号来自**结果文件**,而不是该 agent 的最终消息:`harnessed prompt <sub>` 会打印结果文件路径,`harnessed checkpoint complete <sub> --result-file <path> --wait <秒>` 是对该文件的有界等待 —— `wait_agent` 或到达通知只用于提前唤醒,永远不是完成凭据。 TODO(未验证):codex agent 的生命周期 —— 是否 session-scoped、退出时是否自动回收、能否嵌套 spawn。实测之前不得依赖。'
|
|
221
221
|
skill: *teams_step_skill
|
|
222
222
|
# en-only 面,值同 en 文件(仅为 key parity 存在)。
|
|
223
223
|
command:
|
|
224
|
-
claude: '4. If `parallelism.escalate_to_teams === true`: this stage needs multiple subagents to coordinate (SendMessage / shared contract). 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>)`; the team forms implicitly on the FIRST spawn with this session as lead (`team_name` 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") — shutdown is a REQUEST, so re-ask rather than assume, and shut every teammate down before you finish (a teammate you never stopped keeps burning tokens and can hang the host). The team directory is removed automatically at session exit; there is no teardown tool. Still checkpoint each sub (`complete` / `fail`) as below.'
|
|
225
|
-
codex: '4. If `parallelism.escalate_to_teams === true`: this stage needs multiple agents to coordinate. Spawn one agent per fired sub with `spawn_agent(message: <that sub''s `harnessed prompt <sub>` prompt>)` — the tool takes only `agent_type` and `message`, and `agent_type` names an agent role under `~/.codex/agents/` rather than labelling the task, so identify the sub inside the message. Coordinate with `send_input(target, items)`; `wait_agent` blocks until one finishes and `list_agents` enumerates the running set. Close each finished agent with `close_agent`, and close every agent you spawned before you finish (an agent you never closed keeps burning tokens). Still checkpoint each sub (`complete` / `fail`) as below. TODO(未验证): codex agent lifecycle — session scope, automatic reclamation on exit, nesting. Not asserted here.'
|
|
224
|
+
claude: '4. If `parallelism.escalate_to_teams === true`: this stage needs multiple subagents to coordinate (SendMessage / shared contract). 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>)`; the team forms implicitly on the FIRST spawn with this session as lead (`team_name` 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") — shutdown is a REQUEST, so re-ask rather than assume, and shut every teammate down before you finish (a teammate you never stopped keeps burning tokens and can hang the host). The team directory is removed automatically at session exit; there is no teardown tool. Still checkpoint each sub (`complete` / `fail`) as below. Completion for each spawned sub is signalled by its RESULT FILE, not by a notification: `harnessed prompt <sub>` prints the result-file path of that sub, and `harnessed checkpoint complete <sub> --result-file <path> --wait <seconds>` is the bounded wait on it — a notification only wakes you up early, it is never the completion proof.'
|
|
225
|
+
codex: '4. If `parallelism.escalate_to_teams === true`: this stage needs multiple agents to coordinate. Spawn one agent per fired sub with `spawn_agent(message: <that sub''s `harnessed prompt <sub>` prompt>)` — the tool takes only `agent_type` and `message`, and `agent_type` names an agent role under `~/.codex/agents/` rather than labelling the task, so identify the sub inside the message. Coordinate with `send_input(target, items)`; `wait_agent` blocks until one finishes and `list_agents` enumerates the running set. Close each finished agent with `close_agent`, and close every agent you spawned before you finish (an agent you never closed keeps burning tokens). Still checkpoint each sub (`complete` / `fail`) as below. Completion for each spawned agent is signalled by its RESULT FILE, not by the final message of that agent: `harnessed prompt <sub>` prints the result-file path, and `harnessed checkpoint complete <sub> --result-file <path> --wait <seconds>` is the bounded wait on it — `wait_agent` or an arrival notification only wakes you up early, it is never the completion proof. TODO(未验证): codex agent lifecycle — session scope, automatic reclamation on exit, nesting. Not asserted here.'
|
|
226
226
|
|
|
227
227
|
# 两条 bullet 原文各带 **3 个前导空格**。block scalar 会吃掉公共缩进,
|
|
228
228
|
# 所以这里用双引号 + \n。
|
|
@@ -233,11 +233,11 @@ primitives:
|
|
|
233
233
|
|
|
234
234
|
delivery_contract_note:
|
|
235
235
|
default:
|
|
236
|
-
claude: "交付契约:必须用**阻塞式** Agent/Task 调用 —— 只有阻塞调用会把 subagent 的最终文本作为 tool result 返回给你。named/background teammate 的最终消息会被平台**丢弃**;若必须那样跑,要求 agent 把发现写入文件(你再读回)或 SendMessage 回主 session —— 否则 COMPLETE promise 和研究发现永远到不了你手里。"
|
|
237
|
-
codex: "交付契约:要求 agent 把发现写入文件(你再读回)或用 `send_input` 回传本 session;读之前先调 `wait_agent`。TODO(未验证):codex 是否把 spawn 出来的 agent 的最终文本回传给调用方 —— 实测之前不得依赖,所以无论如何都要走文件或 `send_input`,保证 COMPLETE promise 和研究发现到得了你手里。"
|
|
236
|
+
claude: "交付契约:必须用**阻塞式** Agent/Task 调用 —— 只有阻塞调用会把 subagent 的最终文本作为 tool result 返回给你。named/background teammate 的最终消息会被平台**丢弃**;若必须那样跑,要求 agent 把发现写入文件(你再读回)或 SendMessage 回主 session —— 否则 COMPLETE promise 和研究发现永远到不了你手里。 因此完成凭据是结果文件(`harnessed prompt <sub>` 会打印该 sub 的路径),而不是 teammate 的最后一条消息。"
|
|
237
|
+
codex: "交付契约:要求 agent 把发现写入文件(你再读回)或用 `send_input` 回传本 session;读之前先调 `wait_agent`。 完成凭据是结果文件(`harnessed prompt <sub>` 会打印该路径),而不是该 agent 的最终消息。 TODO(未验证):codex 是否把 spawn 出来的 agent 的最终文本回传给调用方 —— 实测之前不得依赖,所以无论如何都要走文件或 `send_input`,保证 COMPLETE promise 和研究发现到得了你手里。"
|
|
238
238
|
checklist:
|
|
239
|
-
claude: "交付契约:named/background teammate 的**最终消息**会被平台丢弃 —— 每条发现必须经 SendMessage 发给 lead
|
|
240
|
-
codex: "交付契约:每条发现必须经 `send_input` 发给 lead
|
|
239
|
+
claude: "交付契约:named/background teammate 的**最终消息**会被平台丢弃 —— 每条发现必须经 SendMessage 发给 lead 或写入结果文件由 lead 读回;完成凭据是那个结果文件,绝不依赖 teammate 的最后一条输出"
|
|
240
|
+
codex: "交付契约:每条发现必须经 `send_input` 发给 lead 或写入结果文件由 lead 读回;读之前先调 `wait_agent`。完成凭据是那个结果文件,不是该 agent 的最终消息。TODO(未验证):codex 是否把 agent 的最终消息回传给 lead —— 不得依赖"
|
|
241
241
|
|
|
242
242
|
# `default` 别名指向 `.checklist` —— 同一纪律里最短、最通用的说法。
|
|
243
243
|
# 其余三个是站点专属措辞,各自必须还原自己那份原文字节。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-ai-integration
|
|
3
|
-
description:
|
|
3
|
+
description: "Optional: produce the GSD AI-SPEC contract before plan-phase when the phase builds an AI system."
|
|
4
4
|
trigger_phrases: ["plan ai integration", "gsd ai integration phase"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -27,13 +27,13 @@ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subag
|
|
|
27
27
|
|
|
28
28
|
Do NOT pipe to `harnessed run plan-ai-integration` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
29
29
|
|
|
30
|
-
1. Bash: `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
31
|
-
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
32
|
-
-
|
|
30
|
+
1. Bash: `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
31
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`. The sub writes its own final result into `result_file` — the path that prompt names — so the FILE is the completion signal: do NOT wait for the sub's chat message, because a background or re-parented agent's message may never arrive. Then drive delivery with harnessed's own completion gate:
|
|
32
|
+
- the gate is `harnessed checkpoint complete plan-ai-integration --result-file <result_file> --wait 60` — one call waits at most 60 seconds, so run the SAME command again when the sub needs longer; it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
33
33
|
- if it blocks, run `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
34
34
|
- 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.
|
|
35
|
-
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.
|
|
36
|
-
4.
|
|
35
|
+
3. If the sub’s output contains `STATUS: NEEDS_CLARIFICATION` + a question list (read it from `result_file` — the chat message may never arrive): STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
36
|
+
4. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete plan-ai-integration --result-file <result_file> --wait 60 --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 file carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--wait 60` bounds ONE call to 60 seconds — run the SAME command again when the sub needs longer, never an unbounded wait. `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. A `result-wait-timeout` exit means the sub has not signalled YET — repeat the same command; `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
37
37
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-ai-integration --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.
|
|
38
38
|
|
|
39
|
-
<!-- harnessed-generated:v4.
|
|
39
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-ai-integration
|
|
3
|
-
description:
|
|
3
|
+
description: 可选:阶段涉及 AI 系统时,在 plan-phase 前产出 GSD AI-SPEC 契约。
|
|
4
4
|
trigger_phrases: ["plan ai integration", "gsd ai integration phase"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -26,13 +26,13 @@ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 sp
|
|
|
26
26
|
|
|
27
27
|
**不要** pipe 到 `harnessed run plan-ai-integration` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
28
28
|
|
|
29
|
-
1. Bash: `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
30
|
-
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
31
|
-
-
|
|
29
|
+
1. Bash: `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
30
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
31
|
+
- 闸门是 `harnessed checkpoint complete plan-ai-integration --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
32
32
|
- 若被拦下,跑 `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
33
33
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
34
|
-
3.
|
|
35
|
-
4.
|
|
34
|
+
3. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
35
|
+
4. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete plan-ai-integration --result-file <result_file> --wait 60 --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果文件含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--wait 60` 只约束**单次**调用为 60 秒 —— sub 需要更久就重复**同一条**命令,绝不无限等待。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`result-wait-timeout` 退出码表示 sub 尚未发出完成信号 —— 重复同一条命令;`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
36
36
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
37
37
|
|
|
38
|
-
<!-- harnessed-generated:v4.
|
|
38
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-architecture
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
bundled plan-stage cadence: mandatory before complex-architecture phases)。schema_version:
|
|
6
|
-
harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
|
|
7
|
-
[plan-eng-review] + 1 phase (01-plan-eng-review) + gate literal expr
|
|
8
|
-
`phase.is_complex_architecture == true`。Triggered by harnessed CLI `harnessed
|
|
9
|
-
plan-architecture --module <name>` or slash command `/plan-architecture` after
|
|
10
|
-
`harnessed setup`.
|
|
4
|
+
Run the gstack /plan-eng-review architecture review before planning a phase with complex architecture.
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "plan architecture"
|
|
13
7
|
- "架构审查"
|
|
@@ -65,16 +59,16 @@ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subag
|
|
|
65
59
|
|
|
66
60
|
Do NOT pipe to `harnessed run plan-architecture` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
67
61
|
|
|
68
|
-
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
69
|
-
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
70
|
-
-
|
|
62
|
+
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
63
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`. The sub writes its own final result into `result_file` — the path that prompt names — so the FILE is the completion signal: do NOT wait for the sub's chat message, because a background or re-parented agent's message may never arrive. Then drive delivery with harnessed's own completion gate:
|
|
64
|
+
- the gate is `harnessed checkpoint complete plan-architecture --result-file <result_file> --wait 60` — one call waits at most 60 seconds, so run the SAME command again when the sub needs longer; it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
71
65
|
- if it blocks, run `harnessed checkpoint fail plan-architecture --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
72
66
|
- 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
|
-
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.
|
|
74
|
-
4.
|
|
67
|
+
3. If the sub’s output contains `STATUS: NEEDS_CLARIFICATION` + a question list (read it from `result_file` — the chat message may never arrive): STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
68
|
+
4. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete plan-architecture --result-file <result_file> --wait 60 --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 file carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--wait 60` bounds ONE call to 60 seconds — run the SAME command again when the sub needs longer, never an unbounded wait. `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. A `result-wait-timeout` exit means the sub has not signalled YET — repeat the same command; `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
75
69
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-architecture --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
|
|
76
70
|
|
|
77
|
-
<!-- harnessed-generated:v4.
|
|
71
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
78
72
|
|
|
79
73
|
## References
|
|
80
74
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-architecture
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
打包的 plan-stage 节奏:复杂架构阶段前必须执行)。schema_version:
|
|
6
|
-
harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
|
|
7
|
-
[plan-eng-review] + 1 phase (01-plan-eng-review) + gate literal expr
|
|
8
|
-
`phase.is_complex_architecture == true`。Triggered by harnessed CLI `harnessed
|
|
9
|
-
plan-architecture --module <name>` or slash command `/plan-architecture` after
|
|
10
|
-
`harnessed setup`.
|
|
4
|
+
复杂架构阶段进入规划前,跑 gstack /plan-eng-review 架构审查。
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "plan architecture"
|
|
13
7
|
- "架构审查"
|
|
@@ -64,16 +58,16 @@ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 sp
|
|
|
64
58
|
|
|
65
59
|
**不要** pipe 到 `harnessed run plan-architecture` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
66
60
|
|
|
67
|
-
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
68
|
-
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
69
|
-
-
|
|
61
|
+
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
62
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
63
|
+
- 闸门是 `harnessed checkpoint complete plan-architecture --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
70
64
|
- 若被拦下,跑 `harnessed checkpoint fail plan-architecture --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
71
65
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
72
|
-
3.
|
|
73
|
-
4.
|
|
66
|
+
3. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
67
|
+
4. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete plan-architecture --result-file <result_file> --wait 60 --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果文件含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--wait 60` 只约束**单次**调用为 60 秒 —— sub 需要更久就重复**同一条**命令,绝不无限等待。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`result-wait-timeout` 退出码表示 sub 尚未发出完成信号 —— 重复同一条命令;`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
74
68
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-architecture --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
75
69
|
|
|
76
|
-
<!-- harnessed-generated:v4.
|
|
70
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
77
71
|
|
|
78
72
|
## 参考文档
|
|
79
73
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
复杂架构 gstack /plan-eng-review 锁定架构后再 GSD /gsd-plan-phase + planning-with-files 持久化
|
|
6
|
-
task_plan.md。schema_version: harnessed.workflow.v3 with delegates_to (2 sub: architecture
|
|
7
|
-
serial order 1 + phase serial order 2) + disciplines_applied (6 default) + tools_available
|
|
8
|
-
(planning-with-files + plan-eng-review + gsd-plan-phase)。
|
|
9
|
-
Triggered by slash command `/plan`
|
|
10
|
-
(bare per ADR 0030 namespace policy D-02 LOCK) after `harnessed setup`.
|
|
4
|
+
Turn a settled discussion into an executable plan — lock the architecture for complex work first, then persist it to task_plan.md.
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "plan"
|
|
13
7
|
- "计划阶段"
|
|
@@ -68,25 +62,25 @@ Do NOT pipe to `harnessed run plan` — that is the CI/headless path ({{ host.ha
|
|
|
68
62
|
|
|
69
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.
|
|
70
64
|
1b. Bash: `harnessed facts plan --out .harnessed-facts.json` → it lists ONLY the facts this stage’s gates actually read: deterministic ones already filled (change size / files touched / stage, from git), judgement calls left `null` with a one-line hint of what to judge. Edit the file and replace each `null` in `facts` with your honest answer from the locked spec — leave one null only if you genuinely cannot judge it (it then falls back to the built-in default). Do NOT skip this step and do NOT invent facts the command did not ask for.
|
|
71
|
-
2. Bash: `harnessed gates plan --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → parse the JSON `{fire, skip, parallelism}`. This is the plan SoT (no spawn). Keep the verbatim JSON.
|
|
65
|
+
2. Bash: `harnessed gates plan --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → parse the JSON `{fire: [{sub, order, mode, is_master}], skip: [{sub, reason}], parallelism: {escalate_to_teams, teams_active, transport, result_contract, bounded_wait}}`. `escalate_to_teams: false` means the run cannot form a team — drive the fired subs as a plain subagent fan-out (parallel where `order` allows) instead. `teams_active` says whether a team is actually running, `transport` names the transport this plan uses, `result_contract` is `result-file` and `bounded_wait` is `true`: every sub signals completion through its result file, never through a chat message. This is the plan SoT (no spawn). Keep the verbatim JSON.
|
|
72
66
|
3. Bash: `harnessed checkpoint start plan --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
|
|
73
67
|
{{ host.teams_step_note.skill }}
|
|
74
68
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
75
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.
|
|
76
70
|
- **Else (leaf sub):**
|
|
77
|
-
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
78
|
-
b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
79
|
-
-
|
|
71
|
+
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
72
|
+
b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`. The sub writes its own final result into `result_file` — the path that prompt names — so the FILE is the completion signal: do NOT wait for the sub's chat message, because a background or re-parented agent's message may never arrive. Then drive delivery with harnessed's own completion gate:
|
|
73
|
+
- the gate is `harnessed checkpoint complete <sub> --result-file <result_file> --wait 60` — one call waits at most 60 seconds, so run the SAME command again when the sub needs longer; it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
80
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.
|
|
81
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.
|
|
82
|
-
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.
|
|
83
|
-
d.
|
|
76
|
+
c. If the sub’s output contains `STATUS: NEEDS_CLARIFICATION` + questions (read it from `result_file` — the chat message may never arrive): STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
77
|
+
d. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete <sub> --result-file <result_file> --wait 60 --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED) and 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 file carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--wait 60` bounds ONE call to 60 seconds — run the SAME command again when the sub needs longer, never an unbounded wait. `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. A `result-wait-timeout` exit means the sub has not signalled YET — repeat the same command; on any other 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).
|
|
84
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.
|
|
85
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.
|
|
86
80
|
|
|
87
81
|
**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.
|
|
88
82
|
|
|
89
|
-
<!-- harnessed-generated:v4.
|
|
83
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
90
84
|
|
|
91
85
|
## References
|
|
92
86
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
复杂架构 gstack /plan-eng-review 锁定架构后再 GSD /gsd-plan-phase + planning-with-files 持久化
|
|
6
|
-
task_plan.md。schema_version: harnessed.workflow.v3 with delegates_to (2 sub: architecture
|
|
7
|
-
serial order 1 + phase serial order 2) + disciplines_applied (6 default) + tools_available
|
|
8
|
-
(planning-with-files + plan-eng-review + gsd-plan-phase)。
|
|
9
|
-
Triggered by slash command `/plan`
|
|
10
|
-
(bare per ADR 0030 namespace policy D-02 LOCK) after `harnessed setup`.
|
|
4
|
+
把澄清结论落成可执行计划:复杂架构先锁架构,再持久化为 task_plan.md。
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "plan"
|
|
13
7
|
- "计划阶段"
|
|
@@ -67,25 +61,25 @@ Sister `workflows/capabilities.yaml`:
|
|
|
67
61
|
|
|
68
62
|
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清({{ host.ask_user }})并锁决策;否则透明 skip。产出 locked spec。
|
|
69
63
|
1b. Bash: `harnessed facts plan --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
70
|
-
2. Bash: `harnessed gates plan --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}
|
|
64
|
+
2. Bash: `harnessed gates plan --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire: [{sub, order, mode, is_master}], skip: [{sub, reason}], parallelism: {escalate_to_teams, teams_active, transport, result_contract, bounded_wait}}`。`escalate_to_teams: false` 表示本次运行成不了团 —— 按 subagent fan-out 驱动 fired subs(`order` 允许处并发),不要成团。`teams_active` 说明此刻是否真的有团在跑,`transport` 给出本 plan 使用的传输,`result_contract` 是 `result-file`、`bounded_wait` 是 `true`:每个 sub 的完成信号是结果文件,不是聊天消息。这是 plan SoT(不 spawn)。保留 verbatim JSON。
|
|
71
65
|
3. Bash: `harnessed checkpoint start plan --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
72
66
|
{{ host.teams_step_note.skill }}
|
|
73
67
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
74
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 重复本循环。
|
|
75
69
|
- **否则(leaf sub):**
|
|
76
|
-
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
77
|
-
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
78
|
-
-
|
|
70
|
+
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
71
|
+
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
72
|
+
- 闸门是 `harnessed checkpoint complete <sub> --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
79
73
|
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
80
74
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
81
|
-
c.
|
|
82
|
-
d.
|
|
75
|
+
c. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
76
|
+
d. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete <sub> --result-file <result_file> --wait 60 --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果文件含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--wait 60` 只约束**单次**调用为 60 秒 —— sub 需要更久就重复**同一条**命令,绝不无限等待。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`result-wait-timeout` 退出码表示 sub 尚未发出完成信号 —— 重复同一条命令;其它非零退出码即表示该 sub **未** done —— 重 spawn 补齐,或仅在刻意覆盖时传 `--force`(记录 `evidence_status=overridden`,是可审计的覆盖而非静默放行)。
|
|
83
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
84
78
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
|
|
85
79
|
|
|
86
80
|
**若丢失上下文(compaction / resume):** 先跑 `harnessed status --recover` —— 它读 ledger 并打印「你在这里,下一步是什么」,让你从第一个 `pending` sub 续跑而非重启。若 ledger 为空,重跑 step 2-3。
|
|
87
81
|
|
|
88
|
-
<!-- harnessed-generated:v4.
|
|
82
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
89
83
|
|
|
90
84
|
## 参考文档
|
|
91
85
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-phase
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
Wave C plan-checker + planning-with-files Claude Code plugin /plan 持久化 task_plan.md +
|
|
6
|
-
progress.md (bundled Plan-stage cadence: GSD + planning-with-files)。Stage ② 铁律:
|
|
7
|
-
dual capability (GSD orchestration + planning-with-files plugin)。schema_version:
|
|
8
|
-
harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available [gsd-plan-phase,
|
|
9
|
-
planning-with-files] + 2 phases (01-gsd-plan + 02-persist)。Triggered by headless CLI
|
|
10
|
-
`harnessed run plan-phase` or slash command `/plan-phase` after `harnessed setup`.
|
|
4
|
+
Build the phase plan with GSD /gsd-plan-phase, then persist it to task_plan.md and progress.md.
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "plan phase"
|
|
13
7
|
- "计划层 phase"
|
|
@@ -67,16 +61,16 @@ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subag
|
|
|
67
61
|
|
|
68
62
|
Do NOT pipe to `harnessed run plan-phase` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
69
63
|
|
|
70
|
-
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
71
|
-
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
72
|
-
-
|
|
64
|
+
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
65
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`. The sub writes its own final result into `result_file` — the path that prompt names — so the FILE is the completion signal: do NOT wait for the sub's chat message, because a background or re-parented agent's message may never arrive. Then drive delivery with harnessed's own completion gate:
|
|
66
|
+
- the gate is `harnessed checkpoint complete plan-phase --result-file <result_file> --wait 60` — one call waits at most 60 seconds, so run the SAME command again when the sub needs longer; it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
73
67
|
- if it blocks, run `harnessed checkpoint fail plan-phase --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
74
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.
|
|
75
|
-
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.
|
|
76
|
-
4.
|
|
69
|
+
3. If the sub’s output contains `STATUS: NEEDS_CLARIFICATION` + a question list (read it from `result_file` — the chat message may never arrive): STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
70
|
+
4. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete plan-phase --result-file <result_file> --wait 60 --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 file carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--wait 60` bounds ONE call to 60 seconds — run the SAME command again when the sub needs longer, never an unbounded wait. `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. A `result-wait-timeout` exit means the sub has not signalled YET — repeat the same command; `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
77
71
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-phase --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
|
|
78
72
|
|
|
79
|
-
<!-- harnessed-generated:v4.
|
|
73
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
80
74
|
|
|
81
75
|
## References
|
|
82
76
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-phase
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
Wave C plan-checker + planning-with-files Claude Code plugin /plan 持久化 task_plan.md +
|
|
6
|
-
progress.md(打包的 Plan-stage 节奏:GSD + planning-with-files)。Stage ② 铁律:
|
|
7
|
-
dual capability (GSD orchestration + planning-with-files plugin)。schema_version:
|
|
8
|
-
harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available [gsd-plan-phase,
|
|
9
|
-
planning-with-files] + 2 phases (01-gsd-plan + 02-persist)。Triggered by headless CLI
|
|
10
|
-
`harnessed run plan-phase` or slash command `/plan-phase` after `harnessed setup`.
|
|
4
|
+
用 GSD /gsd-plan-phase 生成阶段计划,再持久化为 task_plan.md 与 progress.md。
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "plan phase"
|
|
13
7
|
- "计划层 phase"
|
|
@@ -66,16 +60,16 @@ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 sp
|
|
|
66
60
|
|
|
67
61
|
**不要** pipe 到 `harnessed run plan-phase` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
68
62
|
|
|
69
|
-
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
70
|
-
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
71
|
-
-
|
|
63
|
+
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
64
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
65
|
+
- 闸门是 `harnessed checkpoint complete plan-phase --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
72
66
|
- 若被拦下,跑 `harnessed checkpoint fail plan-phase --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
73
67
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
74
|
-
3.
|
|
75
|
-
4.
|
|
68
|
+
3. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
69
|
+
4. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete plan-phase --result-file <result_file> --wait 60 --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果文件含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--wait 60` 只约束**单次**调用为 60 秒 —— sub 需要更久就重复**同一条**命令,绝不无限等待。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`result-wait-timeout` 退出码表示 sub 尚未发出完成信号 —— 重复同一条命令;`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
76
70
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-phase --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
77
71
|
|
|
78
|
-
<!-- harnessed-generated:v4.
|
|
72
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
79
73
|
|
|
80
74
|
## 参考文档
|
|
81
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-secure
|
|
3
|
-
description:
|
|
3
|
+
description: "Optional: produce the GSD threat-model contract before plan-phase when the change touches auth or secrets."
|
|
4
4
|
trigger_phrases: ["plan secure", "gsd secure phase"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -27,13 +27,13 @@ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subag
|
|
|
27
27
|
|
|
28
28
|
Do NOT pipe to `harnessed run plan-secure` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
29
29
|
|
|
30
|
-
1. Bash: `harnessed prompt plan-secure --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
31
|
-
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
32
|
-
-
|
|
30
|
+
1. Bash: `harnessed prompt plan-secure --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
31
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`. The sub writes its own final result into `result_file` — the path that prompt names — so the FILE is the completion signal: do NOT wait for the sub's chat message, because a background or re-parented agent's message may never arrive. Then drive delivery with harnessed's own completion gate:
|
|
32
|
+
- the gate is `harnessed checkpoint complete plan-secure --result-file <result_file> --wait 60` — one call waits at most 60 seconds, so run the SAME command again when the sub needs longer; it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
33
33
|
- if it blocks, run `harnessed checkpoint fail plan-secure --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
34
34
|
- 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.
|
|
35
|
-
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.
|
|
36
|
-
4.
|
|
35
|
+
3. If the sub’s output contains `STATUS: NEEDS_CLARIFICATION` + a question list (read it from `result_file` — the chat message may never arrive): STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
36
|
+
4. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete plan-secure --result-file <result_file> --wait 60 --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 file carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--wait 60` bounds ONE call to 60 seconds — run the SAME command again when the sub needs longer, never an unbounded wait. `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. A `result-wait-timeout` exit means the sub has not signalled YET — repeat the same command; `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
37
37
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-secure --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.
|
|
38
38
|
|
|
39
|
-
<!-- harnessed-generated:v4.
|
|
39
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-secure
|
|
3
|
-
description:
|
|
3
|
+
description: 可选:改动涉及鉴权或密钥时,在 plan-phase 前产出 GSD 威胁模型契约。
|
|
4
4
|
trigger_phrases: ["plan secure", "gsd secure phase"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -26,13 +26,13 @@ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 sp
|
|
|
26
26
|
|
|
27
27
|
**不要** pipe 到 `harnessed run plan-secure` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
28
28
|
|
|
29
|
-
1. Bash: `harnessed prompt plan-secure --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
30
|
-
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
31
|
-
-
|
|
29
|
+
1. Bash: `harnessed prompt plan-secure --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
30
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
31
|
+
- 闸门是 `harnessed checkpoint complete plan-secure --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
32
32
|
- 若被拦下,跑 `harnessed checkpoint fail plan-secure --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
33
33
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
34
|
-
3.
|
|
35
|
-
4.
|
|
34
|
+
3. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
35
|
+
4. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete plan-secure --result-file <result_file> --wait 60 --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果文件含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--wait 60` 只约束**单次**调用为 60 秒 —— sub 需要更久就重复**同一条**命令,绝不无限等待。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`result-wait-timeout` 退出码表示 sub 尚未发出完成信号 —— 重复同一条命令;`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
36
36
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-secure --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
37
37
|
|
|
38
|
-
<!-- harnessed-generated:v4.
|
|
38
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-spec
|
|
3
|
-
description:
|
|
3
|
+
description: "Optional: produce the GSD design contract before plan-phase when the phase requires a spec."
|
|
4
4
|
trigger_phrases: ["plan spec", "gsd spec phase"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -27,13 +27,13 @@ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subag
|
|
|
27
27
|
|
|
28
28
|
Do NOT pipe to `harnessed run plan-spec` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
29
29
|
|
|
30
|
-
1. Bash: `harnessed prompt plan-spec --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
31
|
-
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
32
|
-
-
|
|
30
|
+
1. Bash: `harnessed prompt plan-spec --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
31
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`. The sub writes its own final result into `result_file` — the path that prompt names — so the FILE is the completion signal: do NOT wait for the sub's chat message, because a background or re-parented agent's message may never arrive. Then drive delivery with harnessed's own completion gate:
|
|
32
|
+
- the gate is `harnessed checkpoint complete plan-spec --result-file <result_file> --wait 60` — one call waits at most 60 seconds, so run the SAME command again when the sub needs longer; it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
33
33
|
- if it blocks, run `harnessed checkpoint fail plan-spec --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
34
34
|
- 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.
|
|
35
|
-
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.
|
|
36
|
-
4.
|
|
35
|
+
3. If the sub’s output contains `STATUS: NEEDS_CLARIFICATION` + a question list (read it from `result_file` — the chat message may never arrive): STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
|
|
36
|
+
4. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete plan-spec --result-file <result_file> --wait 60 --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 file carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--wait 60` bounds ONE call to 60 seconds — run the SAME command again when the sub needs longer, never an unbounded wait. `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. A `result-wait-timeout` exit means the sub has not signalled YET — repeat the same command; `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
37
37
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-spec --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.
|
|
38
38
|
|
|
39
|
-
<!-- harnessed-generated:v4.
|
|
39
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan-spec
|
|
3
|
-
description:
|
|
3
|
+
description: 可选:阶段需要规格说明时,在 plan-phase 前产出 GSD 设计契约。
|
|
4
4
|
trigger_phrases: ["plan spec", "gsd spec phase"]
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -26,13 +26,13 @@ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 sp
|
|
|
26
26
|
|
|
27
27
|
**不要** pipe 到 `harnessed run plan-spec` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
28
28
|
|
|
29
|
-
1. Bash: `harnessed prompt plan-spec --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
30
|
-
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
31
|
-
-
|
|
29
|
+
1. Bash: `harnessed prompt plan-spec --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
30
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
31
|
+
- 闸门是 `harnessed checkpoint complete plan-spec --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
32
32
|
- 若被拦下,跑 `harnessed checkpoint fail plan-spec --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
33
33
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
34
|
-
3.
|
|
35
|
-
4.
|
|
34
|
+
3. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
35
|
+
4. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete plan-spec --result-file <result_file> --wait 60 --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果文件含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--wait 60` 只约束**单次**调用为 60 秒 —— sub 需要更久就重复**同一条**命令,绝不无限等待。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`result-wait-timeout` 退出码表示 sub 尚未发出完成信号 —— 重复同一条命令;`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
36
36
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-spec --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
37
37
|
|
|
38
|
-
<!-- harnessed-generated:v4.
|
|
38
|
+
<!-- harnessed-generated:v4.13.0 -->
|