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
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
# harnessed 宿主原语表 —— `{{ host.* }}` 查表的 zh-Hans 侧(v16.0 Phase 65)。
|
|
2
|
+
#
|
|
3
|
+
# 与 host-primitives.yaml 逐项对等:primitive / variant / host 三层 key 集合必须
|
|
4
|
+
# 完全一致(scripts/check-yaml-i18n-parity.mjs + tests/cli/hostPrimitives.test.ts),
|
|
5
|
+
# 只有值可以按 locale 不同。
|
|
6
|
+
#
|
|
7
|
+
# 占位符语法是纯 ASCII,两个文件里逐字相同:
|
|
8
|
+
#
|
|
9
|
+
# {{ host.<primitive> }} ≡ {{ host.<primitive>.default }}
|
|
10
|
+
# {{ host.<primitive>.<variant> }}
|
|
11
|
+
#
|
|
12
|
+
# 注意:工具名 / API 名属专有名词,不翻译(项目语言规范)。所以 `SendMessage`、
|
|
13
|
+
# `spawn_agent`、`Task / Agent` 这些 cell 在两个文件里本就相同 —— 这是设计,不是漂移。
|
|
14
|
+
# 中文语境需要的是量词 / 名词侧的本地化,走 `zh_tool` 这类变体,而不是改 default。
|
|
15
|
+
#
|
|
16
|
+
# 每个 primitive 必须有 `default` 变体(裸占位符契约,由
|
|
17
|
+
# tests/cli/hostPrimitives.test.ts 断言)。没有天然 default 的,`default` 用
|
|
18
|
+
# YAML 锚点**别名**指向使用面最广的那个变体 —— 调用点仍应显式写变体名。
|
|
19
|
+
#
|
|
20
|
+
# codex 列取值来源(Phase 65 findings F4):工具名与参数取自上游
|
|
21
|
+
# `codex-rs/core/src/tools/handlers/multi_agents_spec.rs`(codex-cli 0.155.1,
|
|
22
|
+
# `multi_agent` stable/true → v1 生效):
|
|
23
|
+
# spawn_agent(agent_type, message) / send_input(target, items, interrupt) /
|
|
24
|
+
# wait_agent / list_agents / close_agent / resume_agent
|
|
25
|
+
# codex agent 的**生命周期**(是否 session-scoped、退出是否自动回收、能否嵌套)
|
|
26
|
+
# **未实测** —— 凡需要该事实的 cell 一律写 TODO(未验证),不作断言。没有真实测量
|
|
27
|
+
# 之前不要「补全」这些 TODO。
|
|
28
|
+
#
|
|
29
|
+
# 逐字纪律:下面每个 `claude` 值都用字符串包含比对过真实产物(25/25 通过)。
|
|
30
|
+
# 任何改动后必须重验 —— 校验脚本与用法见
|
|
31
|
+
# .planning/phases/65-host-primitive-content/inventory.md §「金标自检」。
|
|
32
|
+
# **绝不**从 builder 源码(那是带转义的 JS 模板字面量)或文档里转抄 claude 值,
|
|
33
|
+
# 一律从真实文件 `sed -n` 抠出来。
|
|
34
|
+
|
|
35
|
+
version: 1
|
|
36
|
+
|
|
37
|
+
primitives:
|
|
38
|
+
# ── A 类:token 级 ──────────────────────────────────────────────────────────
|
|
39
|
+
|
|
40
|
+
# 「启动一个受委派的 agent」在各宿主的叫法。
|
|
41
|
+
spawn_subagent:
|
|
42
|
+
default:
|
|
43
|
+
claude: "Task / Agent tool"
|
|
44
|
+
codex: "spawn_agent tool"
|
|
45
|
+
# 中文行文变体:工具名保留英文,名词本地化。
|
|
46
|
+
zh_tool:
|
|
47
|
+
claude: "Task / Agent 工具"
|
|
48
|
+
codex: "spawn_agent 工具"
|
|
49
|
+
# en 侧 `orchestratorEn` 用复数;zh 行文无复数形态,与 zh_tool 同值。
|
|
50
|
+
plural:
|
|
51
|
+
claude: "Task / Agent 工具"
|
|
52
|
+
codex: "spawn_agent 工具"
|
|
53
|
+
# 调用形(非工具名形),站点在 src/cli/lib/generateCommands.ts 的 ORCHESTRATOR
|
|
54
|
+
# 正文。该面是 **en-only**(命令正文模板恒为英文,渲染时强制读 en 基文件),
|
|
55
|
+
# 本 cell 仅为 key parity 存在、zh 渲染不引用,故值与 en 文件相同。
|
|
56
|
+
call_plural:
|
|
57
|
+
claude: "Task calls"
|
|
58
|
+
codex: "spawn_agent calls"
|
|
59
|
+
# 与 `zh_tool` 同词,但该调用点的**源文件**在工具名与「工具」之间折行
|
|
60
|
+
# (verify/code-review/SKILL*.md 正文)。把换行放进 **cell** 里,正文就能写成
|
|
61
|
+
# 一个不折行的占位符,而 claude 渲染仍逐字节还原原来的两行。反过来重排正文
|
|
62
|
+
# 会把换行移进 claude 产物,字节金标会(正确地)判红。
|
|
63
|
+
zh_tool_wrapped:
|
|
64
|
+
claude: |-
|
|
65
|
+
Task / Agent
|
|
66
|
+
工具
|
|
67
|
+
codex: "spawn_agent 工具"
|
|
68
|
+
|
|
69
|
+
# 「向运行中的 agent 发消息」在各宿主的叫法。
|
|
70
|
+
send_message:
|
|
71
|
+
default:
|
|
72
|
+
claude: "SendMessage"
|
|
73
|
+
codex: "send_input"
|
|
74
|
+
|
|
75
|
+
# 编队名词。codex v1 无品牌化编队概念 —— 按 F4,编队方式就是多次 spawn_agent,
|
|
76
|
+
# 所以 codex cell 是描述性短语而非工具名。若某句替换后读起来别扭,那句应改判
|
|
77
|
+
# 为 C 类整段变体,而不是硬套本 token。
|
|
78
|
+
team:
|
|
79
|
+
default:
|
|
80
|
+
claude: "Agent Teams"
|
|
81
|
+
codex: "多 agent 编队(多次 `spawn_agent`)"
|
|
82
|
+
# **定语 / 标题位** —— 「bundled <X> routing」「### <X> 条件性升级」「D-11 <X> 升级」。
|
|
83
|
+
# `default` 的 codex 值是带解释性括注的名词短语:**独立名词位**(「升级到 Agent Teams」)
|
|
84
|
+
# 读着对,放进定语位就不通。本变体只有 codex 列与 `default` 不同,claude 列逐字相同,
|
|
85
|
+
# 因此对字节金标零影响。独立名词位仍用 `default`。
|
|
86
|
+
attributive:
|
|
87
|
+
claude: "Agent Teams"
|
|
88
|
+
codex: "多 agent 编队"
|
|
89
|
+
# **单数形** —— 「4-specialist Agent Team Pattern C」。同属定语位,故 codex 列与
|
|
90
|
+
# `attributive` 相同(中文本就无复数形态)。
|
|
91
|
+
singular:
|
|
92
|
+
claude: "Agent Team"
|
|
93
|
+
codex: "多 agent 编队"
|
|
94
|
+
# 与 `attributive` 同词,但**源文件**在两个词之间折行(task/deliver/SKILL.md
|
|
95
|
+
# Overview:`D-11 Agent` / `Teams 升级 …`)。理由同 spawn_subagent.zh_tool_wrapped
|
|
96
|
+
# —— 换行放进 cell,正文写成一个不折行的占位符。该站点亦属定语位,故 codex 取
|
|
97
|
+
# `attributive` 的值。zh 正文该处未折行,本变体只为 key parity 存在,zh 渲染不引用。
|
|
98
|
+
wrapped:
|
|
99
|
+
claude: |-
|
|
100
|
+
Agent
|
|
101
|
+
Teams
|
|
102
|
+
codex: "多 agent 编队"
|
|
103
|
+
|
|
104
|
+
# 形容词前缀,与 spawn_subagent 相邻或隔词组合。单独成 primitive 是为了让两者
|
|
105
|
+
# 拼回去逐字节等于原文。
|
|
106
|
+
native:
|
|
107
|
+
default:
|
|
108
|
+
claude: "CC-native"
|
|
109
|
+
codex: "codex-native"
|
|
110
|
+
|
|
111
|
+
name:
|
|
112
|
+
default:
|
|
113
|
+
claude: "Claude Code"
|
|
114
|
+
codex: "Codex"
|
|
115
|
+
# 裸 agent 名(行文里的「<X> loads it when triggers match」),不是产品全名。
|
|
116
|
+
# 专有名词不翻译,故两 locale 同值;codex 的产品名与 agent 名本就同一个词。
|
|
117
|
+
short:
|
|
118
|
+
claude: "Claude"
|
|
119
|
+
codex: "Codex"
|
|
120
|
+
|
|
121
|
+
# 中文行文里原文也写 teammate(专有名词),故 claude 侧两 locale 同值,
|
|
122
|
+
# 且 zh 无复数形态。
|
|
123
|
+
teammate:
|
|
124
|
+
default:
|
|
125
|
+
claude: "teammate"
|
|
126
|
+
codex: "agent"
|
|
127
|
+
plural:
|
|
128
|
+
claude: "teammate"
|
|
129
|
+
codex: "agent"
|
|
130
|
+
|
|
131
|
+
# codex 侧工具确在上游(codex-rs/core/src/tools/handlers/
|
|
132
|
+
# request_user_input{,_spec}.rs),但**是否默认启用未实测** —— caveat 只在下方
|
|
133
|
+
# host_map_notes 出现一次,绝不内联进 74 处正文。
|
|
134
|
+
ask_user:
|
|
135
|
+
default:
|
|
136
|
+
claude: "AskUserQuestion"
|
|
137
|
+
codex: "request_user_input"
|
|
138
|
+
|
|
139
|
+
skills_dir:
|
|
140
|
+
default:
|
|
141
|
+
claude: "~/.claude/skills"
|
|
142
|
+
codex: "~/.agents/skills"
|
|
143
|
+
|
|
144
|
+
# ── C 类:整段 ─────────────────────────────────────────────────────────────
|
|
145
|
+
#
|
|
146
|
+
# 之所以整段入表,是因为 claude 措辞陈述了一条 **CC 专属事实**。逐 token 替换
|
|
147
|
+
# 会让整句把该事实伪装成 codex 的事实。所以 codex 列的做法是**删除**该宿主专属
|
|
148
|
+
# 断言,而不是为一个从未实测过的宿主重新断言一遍。
|
|
149
|
+
|
|
150
|
+
# 三种形状,三个消费方 —— 别把调用点接到错的那个上。
|
|
151
|
+
#
|
|
152
|
+
# *_tail → SKILL 交付面(scripts/rewrite-skill-invoke-sections.mjs)。
|
|
153
|
+
# 句子里要写出工作流名(`harnessed run auto`),而渲染期**没有任何环节**
|
|
154
|
+
# 替换名字:renderHostPrimitives 只是查表做纯字符串 splice,没有模板上下文。
|
|
155
|
+
# 所以由**知道名字的** builder 输出字面前缀
|
|
156
|
+
# **不要** pipe 到 `harnessed run <真实名字>` —— 那是 CI/headless 路径(
|
|
157
|
+
# 占位符只供给尾段。切分点取 claude 与 codex 措辞的最后一个共同字节
|
|
158
|
+
# (`(` 之后立即分叉)。
|
|
159
|
+
#
|
|
160
|
+
# orchestrator / execution → 切分前的整句形态,保留作为「前缀 + 尾段拼回来是什么」
|
|
161
|
+
# 的可读参照。它们带字面 `<name>`,没有渲染器会解析,因此**没有活的 SKILL
|
|
162
|
+
# 站点**。不要靠改措辞来「修」这一点 —— 要看的是两个 tail。
|
|
163
|
+
#
|
|
164
|
+
# command_* → src/cli/lib/generateCommands.ts(**en-only 交付面**)。该生成器在
|
|
165
|
+
# TypeScript 里跑、手上有工作流名,能自己替换 `<name>`,所以那两个保持整句。
|
|
166
|
+
#
|
|
167
|
+
# `default` 别名指向 `.execution_tail` —— 使用面最广的**活**变体(每 locale 19 次渲染,
|
|
168
|
+
# orchestrator tail 只有 5 次)。
|
|
169
|
+
harnessed_run_warning_note:
|
|
170
|
+
default: &harnessed_run_execution_tail
|
|
171
|
+
claude: |-
|
|
172
|
+
in-process SDK spawn,在 Claude
|
|
173
|
+
Code 内部会阻塞 session)。
|
|
174
|
+
# 两个 tail 的 codex 值相同:codex 列**删除**了 CC 专属断言
|
|
175
|
+
# (「绕过 Agent Teams」/「在 Claude Code 内部挂死」)而非重新断言,两种措辞因此收敛成一种。
|
|
176
|
+
codex: &harnessed_run_codex_tail |-
|
|
177
|
+
in-process SDK spawn,
|
|
178
|
+
会阻塞本 session)。
|
|
179
|
+
execution_tail: *harnessed_run_execution_tail
|
|
180
|
+
orchestrator_tail:
|
|
181
|
+
claude: |-
|
|
182
|
+
in-process SDK spawn,会阻塞
|
|
183
|
+
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
184
|
+
codex: *harnessed_run_codex_tail
|
|
185
|
+
execution:
|
|
186
|
+
claude: |-
|
|
187
|
+
**不要** pipe 到 `harnessed run <name>` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
|
|
188
|
+
Code 内部会阻塞 session)。
|
|
189
|
+
codex: |-
|
|
190
|
+
**不要** pipe 到 `harnessed run <name>` —— 那是 CI/headless 路径(in-process SDK spawn,
|
|
191
|
+
会阻塞本 session)。
|
|
192
|
+
orchestrator:
|
|
193
|
+
claude: |-
|
|
194
|
+
**不要** pipe 到 `harnessed run <name>` —— 那是 CI/headless 路径(in-process SDK spawn,会阻塞
|
|
195
|
+
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
196
|
+
codex: |-
|
|
197
|
+
**不要** pipe 到 `harnessed run <name>` —— 那是 CI/headless 路径(in-process SDK spawn,
|
|
198
|
+
会阻塞本 session)。
|
|
199
|
+
# 两个 `command_*` 变体属 src/cli/lib/generateCommands.ts(**en-only 交付面**)。
|
|
200
|
+
# 它们在本文件中仅为满足 key parity 而存在,值与 en 文件相同,zh 渲染永不引用。
|
|
201
|
+
command_orchestrator:
|
|
202
|
+
claude: "Do NOT pipe to `harnessed run <name>` — that is the CI/headless path (SDK spawn, blocks the session, no Agent Teams, no clarification round-trip)."
|
|
203
|
+
codex: "Do NOT pipe to `harnessed run <name>` — that is the CI/headless path (SDK spawn, blocks the session, no clarification round-trip)."
|
|
204
|
+
command_execution:
|
|
205
|
+
claude: "Do NOT pipe to `harnessed run <name>` — that is the CI/headless path (SDK spawn)."
|
|
206
|
+
codex: "Do NOT pipe to `harnessed run <name>` — that is the CI/headless path (SDK spawn)."
|
|
207
|
+
|
|
208
|
+
# `default` 别名指向 `.skill`(30 处,command 面只有 1 处)。
|
|
209
|
+
teams_step_note:
|
|
210
|
+
default: &teams_step_skill
|
|
211
|
+
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`)。'
|
|
212
|
+
# 删掉了「读 ~/.claude/rules/agent-teams.md」—— codex 上该文件不存在;
|
|
213
|
+
# F7b 已定调:codex 变体不引用外部文件,改为内联要点。
|
|
214
|
+
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。实测之前不得依赖。'
|
|
215
|
+
skill: *teams_step_skill
|
|
216
|
+
# en-only 面,值同 en 文件(仅为 key parity 存在)。
|
|
217
|
+
command:
|
|
218
|
+
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.'
|
|
219
|
+
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.'
|
|
220
|
+
|
|
221
|
+
# 两条 bullet 原文各带 **3 个前导空格**。block scalar 会吃掉公共缩进,
|
|
222
|
+
# 所以这里用双引号 + \n。
|
|
223
|
+
teams_teardown_note:
|
|
224
|
+
default:
|
|
225
|
+
claude: " - **收尾前必须关闭每个 teammate —— finally 强制契约,非尽力而为**:无论是否每个 sub 都到达 COMPLETE、max_iterations 是否耗尽、或你是否认为工作已完成,收尾前都要**按名**请求每个 teammate 关闭,并确认它真的停了。关闭是**请求**:teammate 会先做完当前 tool call,也可能带理由拒绝 —— 所以要复查重发,不要假定。团目录在 session 退出时**自动**删除(没有 teardown 工具),但你没停掉的 teammate 会持续烧 token 并可能挂起宿主(headless 尤甚 —— issue #7:挂 11 小时,工作已完成但进程从不退出)。\n - **headless 绝不 spawn team**:headless session(`claude -p`)下 `harnessed gates` 已返回 `escalate_to_teams: false`(Agent Teams 是 session-scoped —— `/resume` 即丢,与 `-p` 不兼容)。即使你认为能并行,headless 下也**不要** spawn teammate 或背景 `Agent` —— 改为在 session 内顺序驱动 fired subs。"
|
|
226
|
+
codex: " - **收尾前必须关闭每个 agent —— finally 强制契约,非尽力而为**:无论是否每个 sub 都到达 COMPLETE、max_iterations 是否耗尽、或你是否认为工作已完成,收尾前都要对每个 spawn 出来的 agent 调 `close_agent` 并确认它真的停了。没停掉的 agent 会持续烧 token 并可能挂起宿主(headless 尤甚 —— issue #7:挂 11 小时,工作已完成但进程从不退出)。TODO(未验证):codex 是否在 session 退出时回收运行中的 agent —— 本条刻意不作断言,所以要显式关闭。\n - **headless 顺序执行**:headless 下 `harnessed gates` 已返回 `escalate_to_teams: false`。即使你认为能并行,headless 下也**不要** spawn agent —— 改为在 session 内顺序驱动 fired subs。"
|
|
227
|
+
|
|
228
|
+
delivery_contract_note:
|
|
229
|
+
default:
|
|
230
|
+
claude: "交付契约:必须用**阻塞式** Agent/Task 调用 —— 只有阻塞调用会把 subagent 的最终文本作为 tool result 返回给你。named/background teammate 的最终消息会被平台**丢弃**;若必须那样跑,要求 agent 把发现写入文件(你再读回)或 SendMessage 回主 session —— 否则 COMPLETE promise 和研究发现永远到不了你手里。"
|
|
231
|
+
codex: "交付契约:要求 agent 把发现写入文件(你再读回)或用 `send_input` 回传本 session;读之前先调 `wait_agent`。TODO(未验证):codex 是否把 spawn 出来的 agent 的最终文本回传给调用方 —— 实测之前不得依赖,所以无论如何都要走文件或 `send_input`,保证 COMPLETE promise 和研究发现到得了你手里。"
|
|
232
|
+
checklist:
|
|
233
|
+
claude: "交付契约:named/background teammate 的**最终消息**会被平台丢弃 —— 每条发现必须经 SendMessage 发给 lead 或写入文件由 lead 读回;绝不依赖 teammate 的最后一条输出"
|
|
234
|
+
codex: "交付契约:每条发现必须经 `send_input` 发给 lead 或写入文件由 lead 读回;读之前先调 `wait_agent`。TODO(未验证):codex 是否把 agent 的最终消息回传给 lead —— 不得依赖"
|
|
235
|
+
|
|
236
|
+
# `default` 别名指向 `.checklist` —— 同一纪律里最短、最通用的说法。
|
|
237
|
+
# 其余三个是站点专属措辞,各自必须还原自己那份原文字节。
|
|
238
|
+
teams_cleanup_note:
|
|
239
|
+
default: &teams_cleanup_checklist
|
|
240
|
+
claude: "清理:按名请求每个 teammate shut down —— 这个请求**就是**清场手段(CC 2.1.178+ 已无 delete 工具);团目录在 session 退出时自动删除,而无视请求的 teammate 只保证在 session 结束时停止"
|
|
241
|
+
codex: "清理:对每个 spawn 出来的 agent 调 `close_agent` 并确认它停了。TODO(未验证):codex 是否在 session 退出时回收 agent —— 显式关闭,不要依赖它"
|
|
242
|
+
checklist: *teams_cleanup_checklist
|
|
243
|
+
# C 类**短语**(不是 token 替换)。「按名请求 teammate shut down」是 Claude Code 的
|
|
244
|
+
# 清场**惯用法** —— CC 2.1.178+ 没有 delete 工具,这个请求本身就是清场手段。只换名词
|
|
245
|
+
# 会让 codex 读到一条**错误指令**:codex 用 `close_agent` 停 agent,没有任何东西响应
|
|
246
|
+
# 「按名请求关闭」。刻意写短 —— 两个站点之一是 frontmatter `description`,过长会稀释
|
|
247
|
+
# 触发判据。
|
|
248
|
+
shutdown_phrase:
|
|
249
|
+
claude: "按名请求每个 teammate shut down"
|
|
250
|
+
codex: "对每个 agent 调 `close_agent`"
|
|
251
|
+
multispec_checklist:
|
|
252
|
+
claude: "清理强制:按名请求 4 个 teammate 各自 shut down 并确认真的停了 —— 这个请求**就是**清场手段(已无 delete 工具);团目录在 session 退出时自动删除,而无视请求的 teammate 只保证在 session 结束时停止"
|
|
253
|
+
codex: "清理强制:对 4 个 agent 各自调 `close_agent` 并确认真的停了。TODO(未验证):codex 是否在 session 退出时回收 agent —— 显式关闭,不要依赖它"
|
|
254
|
+
# 注意:zh SKILL 正文用的是**全角**标点(,();),与生成器渲染的 zh 段(半角)
|
|
255
|
+
# 不同。改这两个值时必须逐文件确认字符,不能跨文件复制。
|
|
256
|
+
deliver:
|
|
257
|
+
claude: |-
|
|
258
|
+
任 1 触发 → 升级 subagent fan-out → Agent Teams Pattern A/B/C。清理是强制的,
|
|
259
|
+
遵循 agent-teams.md 防呆清单(lead 按名请求每个 teammate shut down;CC 2.1.178+ 已无
|
|
260
|
+
teardown 工具,团目录在 session 退出时自动清理——剩下的纪律是别把 teammate 落在运行态)
|
|
261
|
+
——属于 engine 级别的连接,NOT yaml schema 的职责范围。
|
|
262
|
+
codex: |-
|
|
263
|
+
任 1 触发 → 升级 subagent fan-out → 多 agent 编队 Pattern A/B/C。清理是强制的
|
|
264
|
+
(对每个 spawn 出来的 agent 调 `close_agent` 并确认它停了——别把 agent 落在运行态)
|
|
265
|
+
——属于 engine 级别的连接,NOT yaml schema 的职责范围。
|
|
266
|
+
TODO(未验证):codex 是否在 session 退出时回收运行中的 agent。
|
|
267
|
+
multispec:
|
|
268
|
+
claude: |-
|
|
269
|
+
必跑「按名请求每个 teammate shut down」(bundled Agent Teams cleanup discipline——团目录在
|
|
270
|
+
session 退出时自动清理,无独立 teardown 工具,剩下的纪律是别把 teammate 落在运行态)。
|
|
271
|
+
codex: |-
|
|
272
|
+
必跑「对每个 agent 调 `close_agent` 并确认它停了」(cleanup discipline——别把 agent
|
|
273
|
+
落在运行态)。TODO(未验证):codex 的 session 退出回收行为。
|
|
274
|
+
|
|
275
|
+
multispec_spawn_note:
|
|
276
|
+
default:
|
|
277
|
+
claude: |-
|
|
278
|
+
`Agent(name, run_in_background=true)` spawn 4 个后台 teammate(code-review + gstack-review +
|
|
279
|
+
gstack-cso + gstack-qa),团在**第一个** spawn 时隐式形成(CC 2.1.178+ 无建团步骤、无建团
|
|
280
|
+
工具);teammate 互相 SendMessage 质询 findings 是否真问题(NOT fire-and-forget)
|
|
281
|
+
codex: |-
|
|
282
|
+
`spawn_agent(message: <brief>)` ×4 spawn 4 个 agent(code-review + gstack-review +
|
|
283
|
+
gstack-cso + gstack-qa),没有建团步骤,也没有任务标签参数(`agent_type` 指的是
|
|
284
|
+
`~/.codex/agents/` 下的 agent role 而不是任务名),所以把 specialist 视角写进 brief;
|
|
285
|
+
agent 之间用 `send_input` 互相质询 findings 是否真问题(NOT fire-and-forget)
|
|
286
|
+
# ── role-prompts.yaml `verify-multispec` 的两个站点(Phase 65 收尾)──────
|
|
287
|
+
# 两处陈述的是**同一条 Claude Code 专有事实**:团在第一个 spawn 时形成,且
|
|
288
|
+
# `team_name` 被接受后忽略。codex 的 multi_agent v1 两个概念都没有 —— 没有团
|
|
289
|
+
# 句柄,`spawn_agent(agent_type, message)` 也不收团参数 —— 所以 token 级替换会让
|
|
290
|
+
# codex 产物断言一个那边不存在的编队语义。两个 codex 列因此只陈述上游工具 spec
|
|
291
|
+
# 能看到的事(6 个工具里没有建团工具),对 agent 生命周期一字不提(未实测)。
|
|
292
|
+
#
|
|
293
|
+
# `responsibility` **带换行**:源 block scalar 在该从句内部折行,换行放进 cell,
|
|
294
|
+
# 正文就能写成一个不折行的占位符(理由同 spawn_subagent.zh_tool_wrapped)。
|
|
295
|
+
responsibility:
|
|
296
|
+
claude: |-
|
|
297
|
+
—— 团在第一个
|
|
298
|
+
spawn 时隐式形成,没有建团步骤 ——
|
|
299
|
+
codex: "—— 没有建团步骤:四次 `spawn_agent` 调用就是全部的编队方式 ——"
|
|
300
|
+
checklist:
|
|
301
|
+
claude: "(第一个 spawn 即成团;`team_name` 被忽略)"
|
|
302
|
+
codex: "(每个 agent 一次 `spawn_agent(agent_type, message)` 调用;`agent_type` 是 agent role 不是任务标签,specialist 名写进 message;没有建团步骤,也没有团句柄)"
|
|
303
|
+
|
|
304
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
305
|
+
# 映射小节注记(Phase 65 R4)。
|
|
306
|
+
#
|
|
307
|
+
# **不属于** `primitives:` —— `loadHostPrimitives` 只读 `primitives`,所以这里的
|
|
308
|
+
# 内容不影响占位符渲染,也不受 parity / `default` 契约约束。
|
|
309
|
+
# 这些行由 T10 输出进**仅 codex** 的映射小节
|
|
310
|
+
# (`<!-- harnessed:host-map:start -->` … `<!-- harnessed:host-map:end -->`)。
|
|
311
|
+
# claude 产物从本 key 拿到**零字节**。
|
|
312
|
+
#
|
|
313
|
+
# 用途:对整份产物成立、且必须**只说一次**的 caveat,不要摊到每个相关正文站点。
|
|
314
|
+
# ─────────────────────────────────────────────────────────────────────────────
|
|
315
|
+
host_map_notes:
|
|
316
|
+
codex:
|
|
317
|
+
- "`request_user_input` —— TODO(未验证):该工具在上游确实存在(`codex-rs/core/src/tools/handlers/request_user_input{,_spec}.rs`),但**本机是否默认启用未实测**。`codex features list` 里的 `default_mode_request_user_input` 是某个模式的 flag,不是该工具自身的开关。若澄清 round-trip 不可用,**不要猜** —— 停下并输出 `STATUS: NEEDS_CLARIFICATION` + 问题列表。"
|
|
318
|
+
- "Claude Code plugin 类组件 —— 本产物部分正文会提到以 Claude Code plugin 形式分发的上游组件(如 `planning-with-files`,调用形式 `/plan`)。那是该组件**真实的分发渠道名称**,不是「codex 上也有、只是叫法不同」的东西,所以措辞按原样保留。**在本宿主上这些组件并未安装**:harnessed 会在能力解析阶段按 capability 逐条告警。遇到这类步骤请视为**不可用**并记录 skip,不要自行找等价物替代。"
|
|
319
|
+
- "codex agent 生命周期 —— 是否 session-scoped、session 退出是否自动回收、能否嵌套 spawn,**三者全部未实测**。本产物不对它们作任何断言。请对每个 spawn 出来的 agent **显式**调 `close_agent`,不要依赖任何你没有亲自观察过的清理行为。"
|
|
@@ -61,17 +61,16 @@ trigger `is-complex-architecture` 重构 ref。
|
|
|
61
61
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
62
62
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
63
63
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
64
|
-
|
|
64
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
65
65
|
|
|
66
|
-
Do NOT pipe to `harnessed run plan-architecture` — that is the CI/headless path (
|
|
67
|
-
that blocks the session inside Claude Code).
|
|
66
|
+
Do NOT pipe to `harnessed run plan-architecture` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
68
67
|
|
|
69
68
|
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
70
|
-
2. Spawn a
|
|
69
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
71
70
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-architecture --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
72
71
|
- if it blocks, run `harnessed checkpoint fail plan-architecture --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
73
72
|
- 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.
|
|
74
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
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.
|
|
75
74
|
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-architecture --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
76
75
|
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.
|
|
77
76
|
|
|
@@ -60,17 +60,16 @@ trigger `is-complex-architecture` 重构 ref。
|
|
|
60
60
|
|
|
61
61
|
下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
|
|
62
62
|
freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
|
|
63
|
-
|
|
63
|
+
{{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
|
|
64
64
|
|
|
65
|
-
**不要** pipe 到 `harnessed run plan-architecture` —— 那是 CI/headless 路径(
|
|
66
|
-
Code 内部会阻塞 session)。
|
|
65
|
+
**不要** pipe 到 `harnessed run plan-architecture` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
67
66
|
|
|
68
67
|
1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
69
|
-
2. 用
|
|
68
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
70
69
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-architecture --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
71
70
|
- 若被拦下,跑 `harnessed checkpoint fail plan-architecture --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
72
71
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
73
|
-
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
72
|
+
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
74
73
|
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-architecture --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
75
74
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-architecture --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
76
75
|
|
|
@@ -62,25 +62,24 @@ The numbered sequence below **is** the state machine — execute it step by step
|
|
|
62
62
|
Do NOT improvise an equivalent flow from the Overview above: freelancing bypasses the engine
|
|
63
63
|
(no per-sub ledger, no evidence guard, no recovery). harnessed is the orchestration brain
|
|
64
64
|
(`harnessed gates` says which subs fire, `harnessed prompt` gives each spawn-ready prompt,
|
|
65
|
-
`harnessed checkpoint` records the ledger); YOU spawn with
|
|
65
|
+
`harnessed checkpoint` records the ledger); YOU spawn with {{ host.native }} {{ host.spawn_subagent.plural }}.
|
|
66
66
|
|
|
67
|
-
Do NOT pipe to `harnessed run plan` — that is the CI/headless path (
|
|
68
|
-
that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
|
|
67
|
+
Do NOT pipe to `harnessed run plan` — that is the CI/headless path ({{ host.harnessed_run_warning_note.orchestrator_tail }}
|
|
69
68
|
|
|
70
|
-
1. If the clarification criteria fire for "$ARGUMENTS" (≥2 approaches / core algorithm / API contract / high error cost), clarify interactively in THIS session first (
|
|
69
|
+
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.
|
|
71
70
|
1b. Bash: `harnessed facts plan --out .harnessed-facts.json` → it lists ONLY the facts this stage’s gates actually read: deterministic ones already filled (change size / files touched / stage, from git), judgement calls left `null` with a one-line hint of what to judge. Edit the file and replace each `null` in `facts` with your honest answer from the locked spec — leave one null only if you genuinely cannot judge it (it then falls back to the built-in default). Do NOT skip this step and do NOT invent facts the command did not ask for.
|
|
72
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.
|
|
73
72
|
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.
|
|
74
|
-
|
|
73
|
+
{{ host.teams_step_note.skill }}
|
|
75
74
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
76
75
|
- **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed 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.
|
|
77
76
|
- **Else (leaf sub):**
|
|
78
77
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
79
|
-
b. Spawn a
|
|
78
|
+
b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
80
79
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete <sub> --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
81
80
|
- if it blocks, run `harnessed checkpoint fail <sub> --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
82
81
|
- respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
|
|
83
|
-
c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via
|
|
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.
|
|
84
83
|
d. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete <sub> --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. On a non-zero exit the sub is NOT done — re-spawn to close the gap, or pass `--force` only to deliberately override (records `evidence_status=overridden`, an audited override rather than a silent pass).
|
|
85
84
|
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.
|
|
86
85
|
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.
|
|
@@ -61,25 +61,24 @@ Sister `workflows/capabilities.yaml`:
|
|
|
61
61
|
下面这套编号序列**就是** state machine —— 逐步用 Bash 执行。**不要**从上方 Overview 自行演绎一套
|
|
62
62
|
等价流程:freestyle 会旁路引擎(无 per-sub ledger、无 evidence guard、无 recovery)。harnessed 是
|
|
63
63
|
编排大脑(`harnessed gates` 决定哪些 sub fire,`harnessed prompt` 给出每个 spawn-ready prompt,
|
|
64
|
-
`harnessed checkpoint` 记录 ledger);**你**(主 session)用
|
|
64
|
+
`harnessed checkpoint` 记录 ledger);**你**(主 session)用 {{ host.native }} {{ host.spawn_subagent.zh_tool }}做 spawn。
|
|
65
65
|
|
|
66
|
-
**不要** pipe 到 `harnessed run plan` —— 那是 CI/headless 路径(
|
|
67
|
-
session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
|
|
66
|
+
**不要** pipe 到 `harnessed run plan` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.orchestrator_tail }}
|
|
68
67
|
|
|
69
|
-
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清(
|
|
68
|
+
1. 若 "$ARGUMENTS" 触发澄清判据(≥2 方案 / 核心算法 / API contract / 高错误成本),先在**本 session** 交互澄清({{ host.ask_user }})并锁决策;否则透明 skip。产出 locked spec。
|
|
70
69
|
1b. Bash: `harnessed facts plan --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
71
70
|
2. Bash: `harnessed gates plan --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}`。这是 plan SoT(不 spawn)。保留 verbatim JSON。
|
|
72
71
|
3. Bash: `harnessed checkpoint start plan --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
73
|
-
|
|
72
|
+
{{ host.teams_step_note.skill }}
|
|
74
73
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
75
74
|
- **若该项 `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 重复本循环。
|
|
76
75
|
- **否则(leaf sub):**
|
|
77
76
|
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
78
|
-
b. 用
|
|
77
|
+
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
79
78
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete <sub> --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
80
79
|
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
81
80
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
82
|
-
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
81
|
+
c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
83
82
|
d. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete <sub> --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。exit 非零即表示该 sub **未** done —— 重 spawn 补齐,或仅在刻意覆盖时传 `--force`(记录 `evidence_status=overridden`,是可审计的覆盖而非静默放行)。
|
|
84
83
|
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
85
84
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。
|
|
@@ -63,17 +63,16 @@ reframe)。
|
|
|
63
63
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
64
64
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
65
65
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
66
|
-
|
|
66
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
67
67
|
|
|
68
|
-
Do NOT pipe to `harnessed run plan-phase` — that is the CI/headless path (
|
|
69
|
-
that blocks the session inside Claude Code).
|
|
68
|
+
Do NOT pipe to `harnessed run plan-phase` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
70
69
|
|
|
71
70
|
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
72
|
-
2. Spawn a
|
|
71
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
73
72
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-phase --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
74
73
|
- if it blocks, run `harnessed checkpoint fail plan-phase --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
75
74
|
- 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.
|
|
76
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
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.
|
|
77
76
|
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-phase --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
78
77
|
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.
|
|
79
78
|
|
|
@@ -62,17 +62,16 @@ reframe)。
|
|
|
62
62
|
|
|
63
63
|
下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
|
|
64
64
|
freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
|
|
65
|
-
|
|
65
|
+
{{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
|
|
66
66
|
|
|
67
|
-
**不要** pipe 到 `harnessed run plan-phase` —— 那是 CI/headless 路径(
|
|
68
|
-
Code 内部会阻塞 session)。
|
|
67
|
+
**不要** pipe 到 `harnessed run plan-phase` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
69
68
|
|
|
70
69
|
1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
71
|
-
2. 用
|
|
70
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
72
71
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-phase --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
73
72
|
- 若被拦下,跑 `harnessed checkpoint fail plan-phase --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
74
73
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
75
|
-
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
74
|
+
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
76
75
|
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-phase --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
77
76
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-phase --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
78
77
|
|
|
@@ -56,18 +56,17 @@ Sister `workflows/capabilities.yaml` entries:
|
|
|
56
56
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
57
57
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
58
58
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
59
|
-
|
|
59
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
60
60
|
|
|
61
|
-
Do NOT pipe to `harnessed run research` — that is the CI/headless path (
|
|
62
|
-
that blocks the session inside Claude Code).
|
|
61
|
+
Do NOT pipe to `harnessed run research` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
63
62
|
|
|
64
63
|
1. Bash: `harnessed prompt research --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
65
|
-
2. Spawn a
|
|
64
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
66
65
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete research --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
67
66
|
- if it blocks, run `harnessed checkpoint fail research --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
68
67
|
- respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
|
|
69
|
-
-
|
|
70
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
68
|
+
- {{ host.delivery_contract_note }}
|
|
69
|
+
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.
|
|
71
70
|
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete research --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
72
71
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail research --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
|
|
73
72
|
|
|
@@ -54,18 +54,17 @@ Sister `workflows/capabilities.yaml` 条目:
|
|
|
54
54
|
|
|
55
55
|
下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
|
|
56
56
|
freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
|
|
57
|
-
|
|
57
|
+
{{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
|
|
58
58
|
|
|
59
|
-
**不要** pipe 到 `harnessed run research` —— 那是 CI/headless 路径(
|
|
60
|
-
Code 内部会阻塞 session)。
|
|
59
|
+
**不要** pipe 到 `harnessed run research` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
61
60
|
|
|
62
61
|
1. Bash: `harnessed prompt research --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
63
|
-
2. 用
|
|
62
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
|
|
64
63
|
- subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete research --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
65
64
|
- 若被拦下,跑 `harnessed checkpoint fail research --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
66
65
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
67
|
-
-
|
|
68
|
-
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用
|
|
66
|
+
- {{ host.delivery_contract_note }}
|
|
67
|
+
3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
69
68
|
4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete research --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
|
|
70
69
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail research --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
71
70
|
|
package/workflows/retro/SKILL.md
CHANGED
|
@@ -56,17 +56,16 @@ Sister `workflows/capabilities.yaml` entries:
|
|
|
56
56
|
The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
|
|
57
57
|
an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
|
|
58
58
|
evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
|
|
59
|
-
|
|
59
|
+
{{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
|
|
60
60
|
|
|
61
|
-
Do NOT pipe to `harnessed run retro` — that is the CI/headless path (
|
|
62
|
-
that blocks the session inside Claude Code).
|
|
61
|
+
Do NOT pipe to `harnessed run retro` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
63
62
|
|
|
64
63
|
1. Bash: `harnessed prompt retro --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
65
|
-
2. Spawn a
|
|
64
|
+
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
|
|
66
65
|
- on return, write the subagent's final output to a file and run `harnessed checkpoint complete retro --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
|
|
67
66
|
- if it blocks, run `harnessed checkpoint fail retro --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
68
67
|
- respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
|
|
69
|
-
3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via
|
|
68
|
+
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.
|
|
70
69
|
4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete retro --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
|
|
71
70
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail retro --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
|
|
72
71
|
|