harnessed 4.32.22 → 4.37.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.
Files changed (99) hide show
  1. package/README.md +6 -6
  2. package/bin/harnessed-inject-state.mjs +16 -0
  3. package/dist/cli.mjs +1471 -302
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/schemas/index.mjs.map +1 -1
  8. package/manifests/optional/doc-discipline-gate.yaml +54 -0
  9. package/messages/en.json +8 -0
  10. package/messages/zh-Hans.json +8 -0
  11. package/package.json +1 -1
  12. package/routing/decision_rules.yaml +1 -1
  13. package/workflows/README.md +1 -1
  14. package/workflows/auto/SKILL.md +13 -9
  15. package/workflows/auto/SKILL.zh-Hans.md +13 -9
  16. package/workflows/capabilities.yaml +100 -40
  17. package/workflows/defaults.yaml +8 -2
  18. package/workflows/disciplines/karpathy.yaml +29 -0
  19. package/workflows/disciplines/karpathy.zh-Hans.yaml +27 -0
  20. package/workflows/disciplines/language.yaml +15 -10
  21. package/workflows/disciplines/operational.yaml +1 -1
  22. package/workflows/disciplines/operational.zh-Hans.yaml +1 -1
  23. package/workflows/disciplines/output-style.yaml +10 -2
  24. package/workflows/disciplines/output-style.zh-Hans.yaml +10 -2
  25. package/workflows/disciplines/priority.yaml +15 -2
  26. package/workflows/disciplines/priority.zh-Hans.yaml +15 -2
  27. package/workflows/discuss/auto/SKILL.md +4 -4
  28. package/workflows/discuss/auto/SKILL.zh-Hans.md +4 -4
  29. package/workflows/discuss/auto/workflow.yaml +16 -3
  30. package/workflows/discuss/phase/SKILL.md +1 -1
  31. package/workflows/discuss/phase/SKILL.zh-Hans.md +1 -1
  32. package/workflows/discuss/strategic/SKILL.md +1 -1
  33. package/workflows/discuss/strategic/SKILL.zh-Hans.md +1 -1
  34. package/workflows/discuss/subtask/SKILL.md +1 -1
  35. package/workflows/discuss/subtask/SKILL.zh-Hans.md +1 -1
  36. package/workflows/judgments/parallelism-gate.yaml +11 -6
  37. package/workflows/judgments/phase-gate.yaml +5 -1
  38. package/workflows/judgments/stage-routing.yaml +21 -26
  39. package/workflows/judgments/strategic-gate.yaml +30 -0
  40. package/workflows/judgments/user-overrides.yaml +7 -3
  41. package/workflows/judgments/web-testing-routing.yaml +33 -12
  42. package/workflows/plan/architecture/SKILL.md +7 -3
  43. package/workflows/plan/architecture/SKILL.zh-Hans.md +7 -3
  44. package/workflows/plan/auto/SKILL.md +11 -7
  45. package/workflows/plan/auto/SKILL.zh-Hans.md +11 -7
  46. package/workflows/plan/phase/SKILL.md +7 -3
  47. package/workflows/plan/phase/SKILL.zh-Hans.md +7 -3
  48. package/workflows/research/SKILL.md +24 -9
  49. package/workflows/research/SKILL.zh-Hans.md +23 -9
  50. package/workflows/research/workflow.yaml +43 -3
  51. package/workflows/retro/SKILL.md +7 -3
  52. package/workflows/retro/SKILL.zh-Hans.md +7 -3
  53. package/workflows/role-prompts.yaml +28 -21
  54. package/workflows/role-prompts.zh-Hans.yaml +22 -17
  55. package/workflows/ship/auto/SKILL.md +11 -7
  56. package/workflows/ship/auto/SKILL.zh-Hans.md +11 -7
  57. package/workflows/ship/preflight/SKILL.md +7 -3
  58. package/workflows/ship/preflight/SKILL.zh-Hans.md +7 -3
  59. package/workflows/task/auto/SKILL.md +26 -16
  60. package/workflows/task/auto/SKILL.zh-Hans.md +26 -16
  61. package/workflows/task/auto/workflow.yaml +11 -4
  62. package/workflows/task/clarify/SKILL.md +1 -1
  63. package/workflows/task/clarify/SKILL.zh-Hans.md +1 -1
  64. package/workflows/task/code/SKILL.md +7 -3
  65. package/workflows/task/code/SKILL.zh-Hans.md +7 -3
  66. package/workflows/task/deliver/SKILL.md +53 -35
  67. package/workflows/task/deliver/SKILL.zh-Hans.md +54 -36
  68. package/workflows/task/deliver/workflow.yaml +32 -24
  69. package/workflows/task/test/SKILL.md +37 -3
  70. package/workflows/task/test/SKILL.zh-Hans.md +33 -3
  71. package/workflows/task/test/workflow.yaml +13 -0
  72. package/workflows/verify/auto/SKILL.md +12 -8
  73. package/workflows/verify/auto/SKILL.zh-Hans.md +12 -8
  74. package/workflows/verify/auto/workflow.yaml +3 -1
  75. package/workflows/verify/code-review/SKILL.md +7 -3
  76. package/workflows/verify/code-review/SKILL.zh-Hans.md +7 -3
  77. package/workflows/verify/design/SKILL.md +24 -10
  78. package/workflows/verify/design/SKILL.zh-Hans.md +24 -10
  79. package/workflows/verify/design/workflow.yaml +36 -7
  80. package/workflows/verify/eval-review/SKILL.md +7 -3
  81. package/workflows/verify/eval-review/SKILL.zh-Hans.md +7 -3
  82. package/workflows/verify/multispec/SKILL.md +17 -10
  83. package/workflows/verify/multispec/SKILL.zh-Hans.md +16 -10
  84. package/workflows/verify/multispec/workflow.yaml +7 -5
  85. package/workflows/verify/paranoid/SKILL.md +7 -3
  86. package/workflows/verify/paranoid/SKILL.zh-Hans.md +7 -3
  87. package/workflows/verify/progress/SKILL.md +7 -3
  88. package/workflows/verify/progress/SKILL.zh-Hans.md +7 -3
  89. package/workflows/verify/qa/SKILL.md +44 -14
  90. package/workflows/verify/qa/SKILL.zh-Hans.md +44 -14
  91. package/workflows/verify/qa/workflow.yaml +61 -2
  92. package/workflows/verify/security/SKILL.md +7 -3
  93. package/workflows/verify/security/SKILL.zh-Hans.md +7 -3
  94. package/workflows/verify/simplify/SKILL.md +7 -3
  95. package/workflows/verify/simplify/SKILL.zh-Hans.md +7 -3
  96. package/workflows/verify/validate-phase/SKILL.md +7 -3
  97. package/workflows/verify/validate-phase/SKILL.zh-Hans.md +7 -3
  98. package/manifests/skill-packs/karpathy-skills.yaml +0 -65
  99. package/manifests/tools/ralph-loop.yaml +0 -46
@@ -15,10 +15,25 @@ description: |
15
15
  Stage ④.d gstack /qa 端到端 QA 验收 (has_ui_changes 触发, 可选 conditional)。
16
16
  Gate: judgments.stage-routing.verify-qa-ui.fires (phase.has_ui_changes == true) —
17
17
  frontend / E2E module fire only; 后端 / docs PR skip。tools_available 包含
18
- playwright-cli / playwright-test / webapp-testing 配套 E2E test 工具链。
18
+ browse / playwright-cli / playwright-test / webapp-testing / chrome-devtools-mcp
19
+ 配套 E2E test + 非功能性诊断工具链 (T2.3: 三层职责矩阵 4 条 lane 各接一个
20
+ web-testing-routing gate)。
19
21
 
20
22
  disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
21
- tools_available: [gstack-qa, playwright-cli, playwright-test, webapp-testing]
23
+ # T2.3 — browse 补入 (手层主导, /browse 优先于 playwright-cli);
24
+ # chrome-devtools-mcp 补入 —— 「非功能性诊断 (性能 / a11y / 内存) 必用
25
+ # chrome-devtools-mcp」之前对模型完全不可见 (不在任何 tools_available)。
26
+ # chrome-devtools-mcp provider 二选一: ecc (bonus tier, ECC 唯一默认 MCP connector)
27
+ # 或 optional 自装 manifest chrome-devtools-mcp (不装 ecc 的兜底); 双装 doctor warn;
28
+ # 两者都缺时该 lane 不可用 —— 不再只是注记: phase 05 gate 含
29
+ # `chrome_devtools_available == true` arm 强制 (注记体例同 web-testing-routing.yaml)。
30
+ tools_available:
31
+ - gstack-qa
32
+ - browse
33
+ - playwright-cli
34
+ - playwright-test
35
+ - webapp-testing
36
+ - chrome-devtools-mcp
22
37
 
23
38
  phases:
24
39
  - id: 01-qa
@@ -31,3 +46,47 @@ phases:
31
46
  # D2-followup (ADR-0033): declare report artifact so the evidence guard is real
32
47
  # (verified, not none_declared) — proves the end-to-end QA pass actually ran.
33
48
  artifacts_expected: [qa-report.md]
49
+
50
+ # T2.3 — 三层职责矩阵 + 非功能性诊断的 4 条 lane。之前 web-testing-routing.yaml
51
+ # 的 4 个 trigger 是运行时孤儿 (零 gate ref → 文件永不加载求值)。lane 由
52
+ # subtask.test_type 单值选择 (互斥); 默认 gateContext test_type 无信号 → 全 skip,
53
+ # 与改动前行为等价 (只跑 01-qa)。
54
+
55
+ # 脑 — 提交进 repo / CI 跑的正式 E2E test framework
56
+ - id: 02-e2e-ci
57
+ name: '@playwright/test (脑层 — frontend/e2e/*.spec.ts, 断言 / fixtures / reporter)'
58
+ upstream: playwright-test
59
+ model: sonnet
60
+ gate: judgments.web-testing-routing.playwright-test-default.fires
61
+ max_iterations: 3
62
+
63
+ # 手 — AI 实时探查 / 调试 / 一次性确认; /browse 主导, 未装 gstack 降级 playwright-cli
64
+ - id: 03-browser-probe
65
+ name: browse (手层 — /browse 主导; 未装 gstack 降级 playwright-cli)
66
+ upstream: gstack
67
+ capability: '{{ capabilities.browse.cmd }}'
68
+ model: sonnet
69
+ gate: judgments.web-testing-routing.browse-probe.fires
70
+ max_iterations: 3
71
+
72
+ # 筋骨 — Python 后端联动特例 (Tortoise ORM / pandas / Django Jinja 模板)
73
+ - id: 04-python-backend-e2e
74
+ name: webapp-testing (筋骨层 — tests/e2e/*.py + with_server.py 双进程)
75
+ upstream: gstack
76
+ capability: '{{ capabilities.webapp-testing.cmd }}'
77
+ model: sonnet
78
+ gate: judgments.web-testing-routing.webapp-testing-python-backend.fires
79
+ max_iterations: 3
80
+
81
+ # 非功能性诊断 — 有 provider 时必用 chrome-devtools-mcp (NOT playwright/test/cli/webapp-testing)。
82
+ # gate 有两个 arm: subtask.test_type == 'perf-diagnostic' AND chrome_devtools_available == true。
83
+ # 第二个 arm 由 src/cli/lib/probe-chrome-devtools.ts 实测 (ecc plugin / 官方 plugin /
84
+ # stdio mcpServers), `harnessed facts` 自动填入。两个 provider 都缺 → 本 phase 不 fire;
85
+ # 开启路径二选一: `harnessed install ecc` 或 `claude mcp add chrome-devtools-mcp`
86
+ # (只装一个; 双装 doctor `ecc` check warn)。probe 抛错 = unknown → 仍 fire (fail-soft)。
87
+ - id: 05-perf-a11y-diagnostic
88
+ name: chrome-devtools-mcp (LCP / Core Web Vitals / ARIA / 堆快照 — 非功能性 only)
89
+ upstream: chrome-devtools-mcp
90
+ model: sonnet
91
+ gate: judgments.web-testing-routing.chrome-devtools-mcp-diagnostic.fires
92
+ max_iterations: 3
@@ -62,11 +62,15 @@ Do NOT pipe to `harnessed run verify-security` — that is the CI/headless path
62
62
  that blocks the session inside Claude Code).
63
63
 
64
64
  1. Bash: `harnessed prompt verify-security --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
65
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
65
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
66
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete verify-security --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
67
+ - if it blocks, run `harnessed checkpoint fail verify-security --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
68
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
66
69
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
67
- 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-security --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
70
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete verify-security --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
71
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail verify-security --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
68
72
 
69
- <!-- harnessed-generated:v4.9.3 -->
73
+ <!-- harnessed-generated:v4.12.0 -->
70
74
 
71
75
  ## References
72
76
 
@@ -61,11 +61,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
61
61
  Code 内部会阻塞 session)。
62
62
 
63
63
  1. Bash: `harnessed prompt verify-security --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
64
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
64
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
65
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete verify-security --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
66
+ - 若被拦下,跑 `harnessed checkpoint fail verify-security --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
67
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
65
68
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
66
- 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-security --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
69
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete verify-security --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
70
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail verify-security --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
67
71
 
68
- <!-- harnessed-generated:v4.9.3 -->
72
+ <!-- harnessed-generated:v4.12.0 -->
69
73
 
70
74
  ## 参考资料
71
75
 
@@ -62,11 +62,15 @@ Do NOT pipe to `harnessed run verify-simplify` — that is the CI/headless path
62
62
  that blocks the session inside Claude Code).
63
63
 
64
64
  1. Bash: `harnessed prompt verify-simplify --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
65
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
65
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
66
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete verify-simplify --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
67
+ - if it blocks, run `harnessed checkpoint fail verify-simplify --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
68
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
66
69
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
67
- 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-simplify --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
70
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete verify-simplify --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
71
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail verify-simplify --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
68
72
 
69
- <!-- harnessed-generated:v4.9.3 -->
73
+ <!-- harnessed-generated:v4.12.0 -->
70
74
 
71
75
  ## References
72
76
 
@@ -61,11 +61,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
61
61
  Code 内部会阻塞 session)。
62
62
 
63
63
  1. Bash: `harnessed prompt verify-simplify --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
64
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
64
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
65
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete verify-simplify --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
66
+ - 若被拦下,跑 `harnessed checkpoint fail verify-simplify --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
67
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
65
68
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
66
- 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-simplify --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
69
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete verify-simplify --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
70
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail verify-simplify --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
67
71
 
68
- <!-- harnessed-generated:v4.9.3 -->
72
+ <!-- harnessed-generated:v4.12.0 -->
69
73
 
70
74
  ## 参考资料
71
75
 
@@ -57,11 +57,15 @@ Do NOT pipe to `harnessed run verify-validate-phase` — that is the CI/headless
57
57
  that blocks the session inside Claude Code).
58
58
 
59
59
  1. Bash: `harnessed prompt verify-validate-phase --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
60
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
60
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
61
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete verify-validate-phase --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
62
+ - if it blocks, run `harnessed checkpoint fail verify-validate-phase --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
63
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
61
64
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
62
- 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-validate-phase --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
65
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete verify-validate-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.
66
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail verify-validate-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.
63
67
 
64
- <!-- harnessed-generated:v4.9.3 -->
68
+ <!-- harnessed-generated:v4.12.0 -->
65
69
 
66
70
  ## References
67
71
 
@@ -56,11 +56,15 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
56
56
  Code 内部会阻塞 session)。
57
57
 
58
58
  1. Bash: `harnessed prompt verify-validate-phase --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
59
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
59
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
60
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete verify-validate-phase --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
61
+ - 若被拦下,跑 `harnessed checkpoint fail verify-validate-phase --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
62
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
60
63
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
61
- 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-validate-phase --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
64
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete verify-validate-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`),不是静默放行。
65
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail verify-validate-phase --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
62
66
 
63
- <!-- harnessed-generated:v4.9.3 -->
67
+ <!-- harnessed-generated:v4.12.0 -->
64
68
 
65
69
  ## 参考资料
66
70
 
@@ -1,65 +0,0 @@
1
- # yaml-language-server: $schema=../../schemas/manifest.v1.schema.json
2
- #
3
- # v3.9.8 — install method changed from `git-clone-with-setup` (broken: cmd was
4
- # a local `cp -R` migration script that didn't match the installer's required
5
- # `git clone <url> <dest>` cmd shape, causing Step B to fail every run) to
6
- # `cc-plugin-marketplace` matching the actual user install path (`claude
7
- # plugin install andrej-karpathy-skills@karpathy-skills`). The plugin is
8
- # distributed via forrestchang/andrej-karpathy-skills marketplace; the
9
- # pre-v3.9.8 yaml intended local-copy from harnessed repo but never worked
10
- # headlessly.
11
- apiVersion: harnessed/v1
12
- kind: Manifest
13
- metadata:
14
- name: karpathy-skills
15
- display_name: Karpathy Baseline (心法 always-on)
16
- description: Andrej Karpathy 心法 always-on SKILL-ONLY injection (D-02 锁 不动 CLAUDE.md).
17
- upstream:
18
- source: github.com/forrestchang/andrej-karpathy-skills
19
- homepage: https://github.com/forrestchang/andrej-karpathy-skills
20
- repository: https://github.com/forrestchang/andrej-karpathy-skills.git
21
- license: MIT
22
- notice: |
23
- Andrej Karpathy heuristics distilled into a Claude Code plugin by
24
- forrestchang. Distributed via the karpathy-skills marketplace.
25
- spec:
26
- type: cc-plugin
27
- component_type: command
28
- category: meta
29
- install_type: skill
30
- install:
31
- method: cc-plugin-marketplace
32
- cmd: "claude plugin marketplace add forrestchang/andrej-karpathy-skills && claude plugin install andrej-karpathy-skills@karpathy-skills"
33
- git_ref: fb8fdb0aa74ccf587d2b666da7160e0d0eb94e6a
34
- idempotent_check: "claude plugin list 2>&1 | grep -q andrej-karpathy-skills"
35
- marketplace_source:
36
- source: github
37
- repo: forrestchang/andrej-karpathy-skills
38
- verify:
39
- cmd: "claude plugin list 2>&1 | grep -q andrej-karpathy-skills"
40
- timeout_ms: 10000
41
- uninstall:
42
- cmd: "claude plugin uninstall andrej-karpathy-skills@karpathy-skills"
43
- # v4.14.0 — codex install path. 上游 README 无 codex 官方路径(仅 CC plugin /
44
- # CLAUDE.md / Cursor rule),但 repo 是标准 skills/ 结构(skills/karpathy-guidelines
45
- # 含 SKILL.md)→ skills CLI 可装;--agent 由 installer 按平台注入(codex)。
46
- harness_overrides:
47
- codex:
48
- install:
49
- method: npx-skill-installer
50
- cmd: "npx --yes skills@latest add forrestchang/andrej-karpathy-skills --skill karpathy-guidelines --copy -y"
51
- npm_version: ^1.5.7
52
- idempotent_check: "test -d ~/.agents/skills/karpathy-guidelines || test -d ~/.claude/skills/karpathy-guidelines"
53
- verify:
54
- cmd: "test -f ~/.agents/skills/karpathy-guidelines/SKILL.md || test -f ~/.claude/skills/karpathy-guidelines/SKILL.md"
55
- timeout_ms: 5000
56
- upstream_health:
57
- stability: stable
58
- last_check: "2026-05-26"
59
- last_known_good_version: 1.0.0
60
- fallback_action: warn
61
- signed_by: easyinplay
62
- platforms:
63
- - linux
64
- - darwin
65
- - win32
@@ -1,46 +0,0 @@
1
- # yaml-language-server: $schema=../../schemas/manifest.v1.schema.json
2
- #
3
- # NOTE: spec.install.cmd is a Claude Code REPL slash command, NOT a shell command.
4
- # cc-plugin-marketplace install method's actual mechanism is undefined for
5
- # headless installer execution. Phase 1.2 plan-phase will resolve via one of:
6
- # (A) Auto-print prompt + require user to paste into CC REPL (semi-automated);
7
- # (B) Headless `claude plugin install <name>` CLI if/when CC ships it;
8
- # (C) Defer ralph-loop to v0.2+ (until headless mechanism exists).
9
- # Tracked: progress.md § B F20.
10
- apiVersion: harnessed/v1
11
- kind: Manifest
12
- metadata:
13
- name: ralph-loop
14
- display_name: ralph-loop
15
- description: Sub-task delivery loop with completion-promise (Anthropic-official). Windows requires jq + Git Bash.
16
- upstream:
17
- source: ralph-loop
18
- homepage: https://github.com/anthropics/claude-plugins-official/tree/main/plugins/ralph-loop
19
- repository: https://github.com/anthropics/claude-plugins-official.git
20
- license: MIT
21
- notice: ralph-loop maintained by Anthropic in claude-plugins-official, used as sub-task delivery guarantor in harnessed.
22
- spec:
23
- type: cc-plugin
24
- component_type: command
25
- category: engineering
26
- install_type: skill
27
- install:
28
- method: cc-plugin-marketplace
29
- cmd: "/plugin install ralph-loop@claude-plugins-official"
30
- git_ref: 45896c8f2fe68e68ca2a8e3554d4441f48475431
31
- idempotent_check: "/plugin list | grep -q ralph-loop"
32
- verify:
33
- cmd: "/plugin list | grep -q ralph-loop"
34
- timeout_ms: 5000
35
- uninstall:
36
- cmd: "/plugin uninstall ralph-loop@claude-plugins-official"
37
- upstream_health:
38
- stability: beta
39
- last_check: "2026-05-11"
40
- last_known_good_version: main
41
- fallback_action: warn
42
- signed_by: easyinplay
43
- platforms:
44
- - linux
45
- - darwin
46
- - win32