harnessed 5.0.12 → 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 +18 -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 +1524 -589
- 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
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QA+Gb,CAAA;;;AC5GO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"5.0.
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QA+Gb,CAAA;;;AC5GO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"5.0.13\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\",\n \"harnessed-inject-state\": \"./bin/harnessed-inject-state.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"bin\",\n \"manifests\",\n \"messages\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"CHANGELOG.md\",\n \"README.md\",\n \"README-en.md\",\n \"README-zh.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup && node ./scripts/build-hooks.mjs\",\n \"prepack\": \"npm run build\",\n \"build:hooks\": \"node ./scripts/build-hooks.mjs\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"test:codex-live\": \"node ./scripts/codex-live/run.mjs\",\n \"bench\": \"vitest bench --run\",\n \"bench:runtime\": \"node scripts/benchmark-runtime.mjs\",\n \"test:runtime-channels\": \"node scripts/runtime-channel-smoke.mjs\",\n \"test:docs\": \"node --test tests/docs/install-channels.contract.mjs\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\",\n \"build:binary\": \"bun scripts/build-binary.mjs\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"smol-toml\": \"^1.9.1\",\n \"undici\": \"^8.12.1\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"esbuild\": \"0.27.7\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
|
package/messages/en.json
CHANGED
|
@@ -135,5 +135,19 @@
|
|
|
135
135
|
"manifest_add.gate_passed_dry_run": "[manifest-add] EE-5 gate passed (dry-run); would write {{path}}",
|
|
136
136
|
|
|
137
137
|
"resume.fail": "✗ {{error}}",
|
|
138
|
-
"resume.corrupt": "✗ {{error}}\n path: {{path}}"
|
|
138
|
+
"resume.corrupt": "✗ {{error}}\n path: {{path}}",
|
|
139
|
+
|
|
140
|
+
"auto_update.consent_on": "[harnessed] auto-update ON",
|
|
141
|
+
"auto_update.consent_off": "[harnessed] auto-update OFF",
|
|
142
|
+
"auto_update.preferences_replaced": "[harnessed] the preferences file was unreadable (invalid JSON) — it has been replaced.",
|
|
143
|
+
"auto_update.reminder_off_note": "[harnessed] the update reminder is OFF — the \"new version available\" notice will not be printed. Use 'harnessed auto-update status' to check on it.",
|
|
144
|
+
"auto_update.path.host": " host: {{host}}",
|
|
145
|
+
"auto_update.path.preferences": " preferences: {{path}}",
|
|
146
|
+
"auto_update.path.status": " status: {{path}}",
|
|
147
|
+
"auto_update.error.unsupported_host": "unsupported host: {{host}} (expected claude or codex)",
|
|
148
|
+
"auto_update.error.runtime": "could not resolve the {{host}} update-reminder runtime",
|
|
149
|
+
"auto_update.notice.updated_from": "harnessed updated {{from}} -> {{to}}.",
|
|
150
|
+
"auto_update.notice.updated_to": "harnessed updated to {{to}}.",
|
|
151
|
+
"auto_update.notice.restart": "Restart {{host}} so the new version + hooks take effect.",
|
|
152
|
+
"auto_update.notice.codex_trust": "Codex hooks still need your trust confirmed — approve the harness hook registration in Codex (or run 'harnessed setup' there)."
|
|
139
153
|
}
|
package/messages/zh-Hans.json
CHANGED
|
@@ -135,5 +135,19 @@
|
|
|
135
135
|
"manifest_add.gate_passed_dry_run": "[manifest-add] EE-5 gate passed (dry-run); would write {{path}}",
|
|
136
136
|
|
|
137
137
|
"resume.fail": "✗ {{error}}",
|
|
138
|
-
"resume.corrupt": "✗ {{error}}\n path: {{path}}"
|
|
138
|
+
"resume.corrupt": "✗ {{error}}\n path: {{path}}",
|
|
139
|
+
|
|
140
|
+
"auto_update.consent_on": "[harnessed] 自动更新已开启",
|
|
141
|
+
"auto_update.consent_off": "[harnessed] 自动更新已关闭",
|
|
142
|
+
"auto_update.preferences_replaced": "[harnessed] 偏好设置文件无法解析(非法 JSON)——已替换。",
|
|
143
|
+
"auto_update.reminder_off_note": "[harnessed] 更新提醒已关闭——「有新版本可用」提示不会再打印。用 'harnessed auto-update status' 查看。",
|
|
144
|
+
"auto_update.path.host": " 宿主: {{host}}",
|
|
145
|
+
"auto_update.path.preferences": " 偏好设置: {{path}}",
|
|
146
|
+
"auto_update.path.status": " 状态文件: {{path}}",
|
|
147
|
+
"auto_update.error.unsupported_host": "不支持的宿主: {{host}}(期望 claude 或 codex)",
|
|
148
|
+
"auto_update.error.runtime": "无法解析 {{host}} 的 update-reminder 运行时",
|
|
149
|
+
"auto_update.notice.updated_from": "harnessed 已从 {{from}} 更新到 {{to}}。",
|
|
150
|
+
"auto_update.notice.updated_to": "harnessed 已更新到 {{to}}。",
|
|
151
|
+
"auto_update.notice.restart": "请重启 {{host}},让新版本与 hooks 生效。",
|
|
152
|
+
"auto_update.notice.codex_trust": "Codex hooks 仍需你确认信任——请在 Codex 中批准该 harness hook 注册(或在该机器上运行 'harnessed setup')。"
|
|
139
153
|
}
|
package/package.json
CHANGED
package/workflows/auto/SKILL.md
CHANGED
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: auto
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
discuss
|
|
6
|
-
|
|
7
|
-
v3.2.0 强化:Phase 0 AI 1-shot complexity assessment + Phase 0.5 understanding check prompt
|
|
8
|
-
+ Phase 5 `/retro` mandatory。
|
|
9
|
-
schema_version: harnessed.workflow.v3 with delegates_to (6 sub: research conditional order 0 +
|
|
10
|
-
4 stage-master order 1-4 + retro mandatory order 5) + disciplines_applied (6 default)
|
|
11
|
-
+ tools_available (agent-teams-create + planning-with-files)。Fail-fast default; opt-in
|
|
12
|
-
`--staged` flag 重现 stage gate UX (每 stage 完停 user review)。
|
|
13
|
-
Triggered by slash command `/auto` (bare per ADR 0030 namespace policy D-02 LOCK)
|
|
14
|
-
after `harnessed setup`.
|
|
4
|
+
Run the whole feature development flow end to end in one command — optional research,
|
|
5
|
+
then discuss, plan, task, verify and retrospective. Use it for a trivial or well-defined
|
|
6
|
+
feature you want to run hands-off.
|
|
15
7
|
trigger_phrases:
|
|
16
8
|
- "auto"
|
|
17
9
|
- "自动跑完"
|
|
@@ -120,26 +112,26 @@ Do NOT pipe to `harnessed run auto` — that is the CI/headless path ({{ host.ha
|
|
|
120
112
|
|
|
121
113
|
1. FIRST run the discuss stage interactively in THIS session (spawned subagents cannot ask the user questions). Evaluate strategic / phase / subtask clarification criteria for "$ARGUMENTS"; dialogue with the user ({{ host.ask_user }}) for each layer that fires, lock decisions, transparent-skip the rest. After locking blocking decisions, relay the deferrable set to the user in a single batched {{ host.ask_user }} with each agent-recommended default pre-selected — deferrable defers scheduling, not user authority; only skip an item if the user explicitly defers it again. Produce a locked spec.
|
|
122
114
|
1b. Bash: `harnessed facts auto --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.
|
|
123
|
-
2. Bash: `harnessed gates auto --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. For a small self-contained task (single-file / single-page class), the sanctioned lite path is adding `--skip-sub verify --skip-sub retro` (repeatable / comma-separated) — skipped subs are still recorded in the ledger with reasons; lite ≠ freestyle (the ledger/evidence IS the difference).
|
|
115
|
+
2. Bash: `harnessed gates auto --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. For a small self-contained task (single-file / single-page class), the sanctioned lite path is adding `--skip-sub verify --skip-sub retro` (repeatable / comma-separated) — skipped subs are still recorded in the ledger with reasons; lite ≠ freestyle (the ledger/evidence IS the difference).
|
|
124
116
|
3. Bash: `harnessed checkpoint start auto --plan '<the verbatim gates JSON from step 2>'` → seeds the per-sub ledger so `harnessed status --recover` can re-orient you after compaction.
|
|
125
117
|
{{ host.teams_step_note.skill }}
|
|
126
118
|
{{ host.teams_teardown_note }}
|
|
127
119
|
5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
|
|
128
120
|
- **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. The nested `checkpoint start` expands that parent entry inside the existing root ledger; it must not replace the root workflow owner, timestamps, checkpoint path, or sibling entries.
|
|
129
121
|
- **Else (leaf sub):**
|
|
130
|
-
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
|
|
131
|
-
b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
132
|
-
-
|
|
122
|
+
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
123
|
+
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:
|
|
124
|
+
- 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>`.
|
|
133
125
|
- 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.
|
|
134
126
|
- 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.
|
|
135
|
-
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.
|
|
136
|
-
d.
|
|
127
|
+
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.
|
|
128
|
+
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).
|
|
137
129
|
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.
|
|
138
130
|
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. Then run the `retro` stage to capture lessons.
|
|
139
131
|
|
|
140
132
|
**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.
|
|
141
133
|
|
|
142
|
-
<!-- harnessed-generated:v4.
|
|
134
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
143
135
|
|
|
144
136
|
## References
|
|
145
137
|
|
|
@@ -1,17 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: auto
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
discuss → plan → task → verify → retro mandatory), 适合 trivial / well-defined feature OR 你
|
|
6
|
-
想 hands-off。每 stage 内部仍 fan-out sub-workflow per 现有 stage-master orchestrator pattern。
|
|
7
|
-
v3.2.0 强化:Phase 0 AI 1-shot complexity assessment + Phase 0.5 understanding check prompt
|
|
8
|
-
+ Phase 5 `/retro` mandatory。
|
|
9
|
-
schema_version: harnessed.workflow.v3 with delegates_to (6 sub: research conditional order 0 +
|
|
10
|
-
4 stage-master order 1-4 + retro mandatory order 5) + disciplines_applied (6 default)
|
|
11
|
-
+ tools_available (agent-teams-create + planning-with-files)。Fail-fast default; opt-in
|
|
12
|
-
`--staged` flag 重现 stage gate UX (每 stage 完停 user review)。
|
|
13
|
-
Triggered by slash command `/auto` (bare per ADR 0030 namespace policy D-02 LOCK)
|
|
14
|
-
after `harnessed setup`.
|
|
4
|
+
一行命令跑完功能开发流:按需调研、澄清、计划、任务、验证、回顾。适合想 hands-off 跑完的简单或边界明确的功能。
|
|
15
5
|
trigger_phrases:
|
|
16
6
|
- "auto"
|
|
17
7
|
- "自动跑完"
|
|
@@ -118,26 +108,26 @@ Sister `workflows/capabilities.yaml`:
|
|
|
118
108
|
|
|
119
109
|
1. 先在**本 session** 交互式跑 discuss 阶段(spawned subagent 无法向用户提问):对 "$ARGUMENTS" 评估 strategic / phase / subtask 澄清判据,对每个 fire 的层用 {{ host.ask_user }} 与用户对话锁决策,其余透明 skip。blocking 集锁定后,把 deferrable 集以单轮批量 {{ host.ask_user }} 转达给用户(各项 agent 推荐默认值预选)—— deferrable 推迟的是排期,不是用户决策权;仅当用户明确再次推迟才可跳过该项。产出 locked spec。
|
|
120
110
|
1b. Bash: `harnessed facts auto --out .harnessed-facts.json` → 它只列出**本阶段 gate 真正读取**的 fact:能确定性推导的已填好(改动行数 / 触及文件数 / stage,来自 git),判断题留 `null` 并附一行说明。编辑该文件,把 `facts` 里每个 `null` 按 locked spec 换成你的真实判断 —— 只有确实无法判断时才留 null(此时回退内置默认值)。**不要**跳过本步,也**不要**自行编造命令没问的 fact。
|
|
121
|
-
2. Bash: `harnessed gates auto --task "<locked spec>" --context-file .harnessed-facts.json --skip-sub discuss` → 解析 JSON `{fire, skip, parallelism}
|
|
111
|
+
2. Bash: `harnessed gates auto --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。自包含小任务(单文件/单页面级)的合规轻量路径:追加 `--skip-sub verify --skip-sub retro`(可重复/逗号分隔)——被 skip 的 sub 仍带原因进 ledger;lite ≠ freestyle(差别就在 ledger/evidence)。
|
|
122
112
|
3. Bash: `harnessed checkpoint start auto --plan '<step 2 的 verbatim gates JSON>'` → seed per-sub ledger,让 `harnessed status --recover` 能在 compaction 后给你重新定位。
|
|
123
113
|
{{ host.teams_step_note.skill }}
|
|
124
114
|
{{ host.teams_teardown_note }}
|
|
125
115
|
5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
|
|
126
116
|
- **若该项 `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 重复本循环。nested `checkpoint start` 会在现有 root ledger 内展开 parent entry;不得替换 root workflow owner、时间戳、checkpoint path 或 sibling entries。
|
|
127
117
|
- **否则(leaf sub):**
|
|
128
|
-
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
129
|
-
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
130
|
-
-
|
|
118
|
+
a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
119
|
+
b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
120
|
+
- 闸门是 `harnessed checkpoint complete <sub> --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
131
121
|
- 若被拦下,跑 `harnessed checkpoint fail <sub> --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
132
122
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
133
|
-
c.
|
|
134
|
-
d.
|
|
123
|
+
c. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
|
|
124
|
+
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`,是可审计的覆盖而非静默放行)。
|
|
135
125
|
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 —— 重新收敛范围、修掉阻塞点或上报用户,并说明情况。
|
|
136
126
|
6. 所有 fired subs `done`(或记录 `failed`)后,Bash `harnessed status --recover` 确认 ledger,并向用户报告 per-sub fired/skipped/done/failed 摘要。 然后跑 `retro` 阶段沉淀 lessons。
|
|
137
127
|
|
|
138
128
|
**若丢失上下文(compaction / resume):** 先跑 `harnessed status --recover` —— 它读 ledger 并打印「你在这里,下一步是什么」,让你从第一个 `pending` sub 续跑而非重启。若 ledger 为空,重跑 step 2-3。
|
|
139
129
|
|
|
140
|
-
<!-- harnessed-generated:v4.
|
|
130
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
141
131
|
|
|
142
132
|
## 参考文档
|
|
143
133
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
+ disciplines_applied (6 default) + tools_available (planning-with-files)。
|
|
8
|
-
Triggered by slash command `/discuss`
|
|
9
|
-
(bare per ADR 0030 namespace policy D-02 LOCK) after `harnessed setup`.
|
|
4
|
+
Decide which clarification layers a piece of work needs, then run them in parallel —
|
|
5
|
+
strategic, phase, and subtask are judged independently. Use it at the start of new work
|
|
6
|
+
to settle scope before planning.
|
|
10
7
|
trigger_phrases:
|
|
11
8
|
- "discuss"
|
|
12
9
|
- "讨论澄清"
|
|
@@ -71,7 +68,7 @@ execution stages.
|
|
|
71
68
|
|
|
72
69
|
Output: a locked spec the execution stages (`/plan` → `/task` → `/verify`) consume without further user input.
|
|
73
70
|
|
|
74
|
-
<!-- harnessed-generated:v4.
|
|
71
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
75
72
|
|
|
76
73
|
## References
|
|
77
74
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
战略层 / Phase 层 / 子任务层独立判断 gate, 可能 3 个全跑 / 1-2 个 / 全跳 + 透明声明。
|
|
6
|
-
schema_version: harnessed.workflow.v3 with delegates_to (3 sub: strategic + phase + subtask, mode parallel)
|
|
7
|
-
+ disciplines_applied (6 default) + tools_available (planning-with-files)。
|
|
8
|
-
Triggered by slash command `/discuss`
|
|
9
|
-
(bare per ADR 0030 namespace policy D-02 LOCK) after `harnessed setup`.
|
|
4
|
+
判断工作需要哪几层澄清(战略层、Phase 层、子任务层),再并行执行,各层独立判断。用于开工前定范围。
|
|
10
5
|
trigger_phrases:
|
|
11
6
|
- "discuss"
|
|
12
7
|
- "讨论澄清"
|
|
@@ -70,7 +65,7 @@ Sister `workflows/capabilities.yaml`:
|
|
|
70
65
|
|
|
71
66
|
产出:一份 locked spec,执行阶段(`/plan` → `/task` → `/verify`)无需再问用户即可消费。
|
|
72
67
|
|
|
73
|
-
<!-- harnessed-generated:v4.
|
|
68
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
74
69
|
|
|
75
70
|
## 参考资料
|
|
76
71
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss-phase
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(gsd-discuss-phase + planning-with-files) + 2 phases (01-gsd-discuss + 02-persist findings.md
|
|
8
|
-
+ knowledge.md)。Triggered by headless CLI `harnessed run discuss-phase` or slash
|
|
9
|
-
command `/discuss-phase` after `harnessed setup`.
|
|
4
|
+
Optional: clarify a phase's gray areas with GSD and persist the outcome to findings.md,
|
|
5
|
+
when a phase has two or more open implementation decisions, an unclear cross-phase
|
|
6
|
+
contract, or a scope of more than a day.
|
|
10
7
|
trigger_phrases:
|
|
11
8
|
- "discuss phase"
|
|
12
9
|
- "phase 层澄清"
|
|
@@ -67,7 +64,7 @@ execution stages.
|
|
|
67
64
|
|
|
68
65
|
Output: a locked spec the execution stages (`/plan` → `/task` → `/verify`) consume without further user input.
|
|
69
66
|
|
|
70
|
-
<!-- harnessed-generated:v4.
|
|
67
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
71
68
|
|
|
72
69
|
## References
|
|
73
70
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss-phase
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
实现决策 / 跨 phase API contract 不清 / phase scope > 1 天 / 灰色地带)。
|
|
6
|
-
schema_version: harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
|
|
7
|
-
(gsd-discuss-phase + planning-with-files) + 2 phases(01-gsd-discuss + 02-persist findings.md
|
|
8
|
-
+ knowledge.md)。Triggered by headless CLI `harnessed run discuss-phase` or slash
|
|
9
|
-
command `/discuss-phase` after `harnessed setup`.
|
|
4
|
+
可选:用 GSD 澄清 phase 灰色地带,落盘 findings.md,在多决策未定、跨阶段契约不清或范围超一天。
|
|
10
5
|
trigger_phrases:
|
|
11
6
|
- "discuss phase"
|
|
12
7
|
- "phase 层澄清"
|
|
@@ -66,7 +61,7 @@ Sister `workflows/judgments/phase-gate.yaml`:
|
|
|
66
61
|
|
|
67
62
|
产出:一份 locked spec,执行阶段(`/plan` → `/task` → `/verify`)无需再问用户即可消费。
|
|
68
63
|
|
|
69
|
-
<!-- harnessed-generated:v4.
|
|
64
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
70
65
|
|
|
71
66
|
## 参考资料
|
|
72
67
|
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss-strategic
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(gstack-office-hours + gstack-plan-ceo-review + planning-with-files) + 3 phases (gate
|
|
8
|
-
judgments.strategic-gate.* fires + planning-with-files /plan findings.md 持久化)。
|
|
9
|
-
Triggered by slash command
|
|
10
|
-
`/discuss-strategic` after `harnessed setup`.
|
|
4
|
+
Run the gstack strategic governance gates before starting a new feature, milestone, or
|
|
5
|
+
product direction. Use it when the commercial scope or user value of the work is still
|
|
6
|
+
unclear.
|
|
11
7
|
trigger_phrases:
|
|
12
8
|
- "discuss strategic"
|
|
13
9
|
- "战略层澄清"
|
|
@@ -71,7 +67,7 @@ execution stages.
|
|
|
71
67
|
|
|
72
68
|
Output: a locked spec the execution stages (`/plan` → `/task` → `/verify`) consume without further user input.
|
|
73
69
|
|
|
74
|
-
<!-- harnessed-generated:v4.
|
|
70
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
75
71
|
|
|
76
72
|
## References
|
|
77
73
|
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss-strategic
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
milestone / 新产品方向启动前强制治理关卡(打包 gstack governance gate,新功能前必跑)。
|
|
6
|
-
schema_version: harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
|
|
7
|
-
(gstack-office-hours + gstack-plan-ceo-review + planning-with-files) + 3 phases(gate
|
|
8
|
-
judgments.strategic-gate.* fires + planning-with-files /plan findings.md 持久化)。
|
|
9
|
-
Triggered by slash command
|
|
10
|
-
`/discuss-strategic` after `harnessed setup`.
|
|
4
|
+
新功能、新里程碑或新产品方向启动前跑 gstack 战略治理关卡。用于商业范围或用户价值尚不明确的场合。
|
|
11
5
|
trigger_phrases:
|
|
12
6
|
- "discuss strategic"
|
|
13
7
|
- "战略层澄清"
|
|
@@ -70,7 +64,7 @@ Sister `workflows/judgments/strategic-gate.yaml`:
|
|
|
70
64
|
|
|
71
65
|
产出:一份 locked spec,执行阶段(`/plan` → `/task` → `/verify`)无需再问用户即可消费。
|
|
72
66
|
|
|
73
|
-
<!-- harnessed-generated:v4.
|
|
67
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
74
68
|
|
|
75
69
|
## 参考资料
|
|
76
70
|
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss-subtask
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
(01-brainstorm with conditional invokes_tools for spec_ambiguous + no_docs)。Triggered by
|
|
8
|
-
headless CLI `harnessed run discuss-subtask` or slash command `/discuss-subtask`
|
|
9
|
-
after `harnessed setup`.
|
|
4
|
+
Optional: explore implementation options for a subtask with superpowers brainstorming,
|
|
5
|
+
when the design has several viable approaches, touches a core algorithm or API contract,
|
|
6
|
+
or is expensive to get wrong.
|
|
10
7
|
trigger_phrases:
|
|
11
8
|
- "discuss subtask"
|
|
12
9
|
- "子任务澄清"
|
|
@@ -72,7 +69,7 @@ execution stages.
|
|
|
72
69
|
|
|
73
70
|
Output: a locked spec the execution stages (`/plan` → `/task` → `/verify`) consume without further user input.
|
|
74
71
|
|
|
75
|
-
<!-- harnessed-generated:v4.
|
|
72
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
76
73
|
|
|
77
74
|
## References
|
|
78
75
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: discuss-subtask
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
API contract / 错误成本高)。schema_version: harnessed.workflow.v3 with disciplines_applied (6
|
|
6
|
-
default) + tools_available (superpowers-brainstorming + grill-with-docs + grill-me) + 1 phase
|
|
7
|
-
(01-brainstorm,含 spec_ambiguous + no_docs 条件调用 invokes_tools)。Triggered by
|
|
8
|
-
headless CLI `harnessed run discuss-subtask` or slash command `/discuss-subtask`
|
|
9
|
-
after `harnessed setup`.
|
|
4
|
+
可选:用 brainstorming 探索子任务的多种实现方案,当设计有分歧、涉及核心算法或 API 契约、易出错时。
|
|
10
5
|
trigger_phrases:
|
|
11
6
|
- "discuss subtask"
|
|
12
7
|
- "子任务澄清"
|
|
@@ -71,7 +66,7 @@ Sister `workflows/judgments/subtask-gate.yaml`:
|
|
|
71
66
|
|
|
72
67
|
产出:一份 locked spec,执行阶段(`/plan` → `/task` → `/verify`)无需再问用户即可消费。
|
|
73
68
|
|
|
74
|
-
<!-- harnessed-generated:v4.
|
|
69
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
75
70
|
|
|
76
71
|
## 参考资料
|
|
77
72
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: harnessed-update
|
|
3
3
|
description: |
|
|
4
|
-
Preview, confirm and execute a deterministic harnessed update
|
|
5
|
-
outcomes honestly
|
|
4
|
+
Preview, confirm, and execute a deterministic harnessed update when you want to upgrade
|
|
5
|
+
harnessed itself. Report partial outcomes honestly and offer bounded agent repair only
|
|
6
|
+
after a second confirmation.
|
|
6
7
|
trigger_phrases:
|
|
7
8
|
- "harnessed update"
|
|
8
9
|
- "update harnessed"
|
|
@@ -94,13 +95,13 @@ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subag
|
|
|
94
95
|
|
|
95
96
|
Do NOT pipe to `harnessed run harnessed-update` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
|
|
96
97
|
|
|
97
|
-
1. Bash: `harnessed prompt harnessed-update --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
|
|
98
|
-
2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model
|
|
99
|
-
-
|
|
98
|
+
1. Bash: `harnessed prompt harnessed-update --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model, result_file}`.
|
|
99
|
+
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:
|
|
100
|
+
- the gate is `harnessed checkpoint complete harnessed-update --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>`.
|
|
100
101
|
- if it blocks, run `harnessed checkpoint fail harnessed-update --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
|
|
101
102
|
- 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.
|
|
102
|
-
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.
|
|
103
|
-
4.
|
|
103
|
+
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.
|
|
104
|
+
4. When `result_file` carries the completion marker: Bash `harnessed checkpoint complete harnessed-update --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.
|
|
104
105
|
5. If the complete gate blocked: Bash `harnessed checkpoint fail harnessed-update --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.
|
|
105
106
|
|
|
106
|
-
<!-- harnessed-generated:v4.
|
|
107
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: harnessed-update
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
只有在第二次确认后才提供有边界的 agent repair。
|
|
4
|
+
想升级 harnessed 时,预览、确认并执行确定性更新,如实报告部分结果;二次确认后才提供有界的 agent 修复。
|
|
6
5
|
trigger_phrases:
|
|
7
6
|
- "harnessed update"
|
|
8
7
|
- "update harnessed"
|
|
@@ -78,13 +77,13 @@ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 sp
|
|
|
78
77
|
|
|
79
78
|
**不要** pipe 到 `harnessed run harnessed-update` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
|
|
80
79
|
|
|
81
|
-
1. Bash: `harnessed prompt harnessed-update --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
|
|
82
|
-
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn
|
|
83
|
-
-
|
|
80
|
+
1. Bash: `harnessed prompt harnessed-update --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model, result_file}`。
|
|
81
|
+
2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn。sub 自己把最终结果写入 `result_file`(prompt 里给出的那个路径)—— **完成信号是文件**,不是聊天消息:后台 / 被 re-parent 的 agent 消息可能永不到达,不要等它。然后用 harnessed 自己的完成闸门驱动交付:
|
|
82
|
+
- 闸门是 `harnessed checkpoint complete harnessed-update --result-file <result_file> --wait 60` —— 单次调用最多等 60 秒,sub 需要更久就重复**同一条**命令;它对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
|
|
84
83
|
- 若被拦下,跑 `harnessed checkpoint fail harnessed-update --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
|
|
85
84
|
- **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
|
|
86
|
-
3.
|
|
87
|
-
4.
|
|
85
|
+
3. 若 sub 的输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表(从 `result_file` 读 —— 聊天消息可能永不到达):STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
|
|
86
|
+
4. 当 `result_file` 携带完成标记时:Bash `harnessed checkpoint complete harnessed-update --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`),不是静默放行。
|
|
88
87
|
5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail harnessed-update --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
|
|
89
88
|
|
|
90
|
-
<!-- harnessed-generated:v4.
|
|
89
|
+
<!-- harnessed-generated:v4.13.0 -->
|
|
@@ -238,15 +238,15 @@ primitives:
|
|
|
238
238
|
# `default` aliases `.skill` (30 hits vs 1 for the command surface).
|
|
239
239
|
teams_step_note:
|
|
240
240
|
default: &teams_step_skill
|
|
241
|
-
claude: '4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team. There is NO create step and no create tool — spawn one background teammate per fired sub with `Agent(name: <sub>, run_in_background: true, prompt: <that sub''s `harnessed prompt <sub>` prompt>)` and the team forms implicitly on the FIRST spawn, with this session as lead (the `team_name` input is accepted but ignored — the name is session-derived). Coordinate via `SendMessage`; when a sub is finished, ask that teammate to shut down BY NAME (e.g. "ask the verify-qa teammate to shut down"). Still checkpoint each sub (`complete` / `fail`) as below.'
|
|
241
|
+
claude: '4. If `parallelism.escalate_to_teams === true`: read `~/.claude/rules/agent-teams.md`, then drive the fired subs as an Agent Team. There is NO create step and no create tool — spawn one background teammate per fired sub with `Agent(name: <sub>, run_in_background: true, prompt: <that sub''s `harnessed prompt <sub>` prompt>)` and the team forms implicitly on the FIRST spawn, with this session as lead (the `team_name` input is accepted but ignored — the name is session-derived). Coordinate via `SendMessage`; when a sub is finished, ask that teammate to shut down BY NAME (e.g. "ask the verify-qa teammate to shut down"). Still checkpoint each sub (`complete` / `fail`) as below. 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.'
|
|
242
242
|
# Drops the `~/.claude/rules/agent-teams.md` read — that file does not exist
|
|
243
243
|
# on codex, and F7b already settled that codex variants inline the points
|
|
244
244
|
# rather than pointing at an external file.
|
|
245
|
-
codex: '4. If `parallelism.escalate_to_teams === true`: 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. When a sub is finished, close it with `close_agent`. Still checkpoint each sub (`complete` / `fail`) as below. TODO(未验证): codex agent lifecycle — whether agents are session-scoped, whether anything is reclaimed automatically on exit, and whether an agent may spawn another. Do not rely on any of it until measured.'
|
|
245
|
+
codex: '4. If `parallelism.escalate_to_teams === true`: 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. When a sub is finished, close it with `close_agent`. 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 — whether agents are session-scoped, whether anything is reclaimed automatically on exit, and whether an agent may spawn another. Do not rely on any of it until measured.'
|
|
246
246
|
skill: *teams_step_skill
|
|
247
247
|
command:
|
|
248
|
-
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.'
|
|
249
|
-
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.'
|
|
248
|
+
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.'
|
|
249
|
+
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.'
|
|
250
250
|
|
|
251
251
|
# Two bullets, each carrying 3 LEADING SPACES in the original. A block scalar
|
|
252
252
|
# would strip that common indent, so these are double-quoted with \n.
|
|
@@ -257,11 +257,11 @@ primitives:
|
|
|
257
257
|
|
|
258
258
|
delivery_contract_note:
|
|
259
259
|
default:
|
|
260
|
-
claude: "delivery contract: use a BLOCKING Agent/Task call — only a blocking call returns the subagent's final text as your tool result. A named/background teammate's final message is DISCARDED by the platform; if you must run it that way, instruct the agent to write its findings to a file (and read it back) or SendMessage them to the main session — otherwise the COMPLETE promise and the findings never reach you."
|
|
261
|
-
codex: "delivery contract: instruct the agent to write its findings to a file (and read it back), or to return them with `send_input` to this session; call `wait_agent` before you read. TODO(未验证): whether codex hands a spawned agent's final text back to the caller — until measured, do not rely on it, so that the COMPLETE promise and the findings reach you by file or by `send_input` either way."
|
|
260
|
+
claude: "delivery contract: use a BLOCKING Agent/Task call — only a blocking call returns the subagent's final text as your tool result. A named/background teammate's final message is DISCARDED by the platform; if you must run it that way, instruct the agent to write its findings to a file (and read it back) or SendMessage them to the main session — otherwise the COMPLETE promise and the findings never reach you. Therefore the completion credential is the result file (`harnessed prompt <sub>` prints the result-file path of that sub) — never the final message of the teammate."
|
|
261
|
+
codex: "delivery contract: instruct the agent to write its findings to a file (and read it back), or to return them with `send_input` to this session; call `wait_agent` before you read. The completion credential is the result file (`harnessed prompt <sub>` prints that path), not the final message of the agent. TODO(未验证): whether codex hands a spawned agent's final text back to the caller — until measured, do not rely on it, so that the COMPLETE promise and the findings reach you by file or by `send_input` either way."
|
|
262
262
|
checklist:
|
|
263
|
-
claude: "Delivery contract: a named/background teammate's FINAL message is discarded by the platform — every finding must arrive via SendMessage to the lead or be written to a file the lead reads back;
|
|
264
|
-
codex: "Delivery contract: every finding must arrive via `send_input` to the lead or be written to a file the lead reads back; call `wait_agent` before reading. TODO(未验证): whether codex returns a spawned agent's final message to the lead — do not rely on it."
|
|
263
|
+
claude: "Delivery contract: a named/background teammate's FINAL message is discarded by the platform — every finding must arrive via SendMessage to the lead or be written to a result file the lead reads back; the completion credential is that result file, never the last output of the teammate"
|
|
264
|
+
codex: "Delivery contract: every finding must arrive via `send_input` to the lead or be written to a result file the lead reads back; call `wait_agent` before reading. The completion credential is that result file, not the final message of the agent. TODO(未验证): whether codex returns a spawned agent's final message to the lead — do not rely on it."
|
|
265
265
|
|
|
266
266
|
# `default` aliases `.checklist` — the shortest, most generic phrasing of the
|
|
267
267
|
# same discipline. The other three are site-specific wordings that must each
|