harnessed 4.32.22 → 4.36.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 +1201 -235
  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 +94 -39
  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 +19 -7
  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 +7 -3
  70. package/workflows/task/test/SKILL.zh-Hans.md +7 -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 +33 -14
  90. package/workflows/verify/qa/SKILL.zh-Hans.md +33 -14
  91. package/workflows/verify/qa/workflow.yaml +55 -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
package/README.md CHANGED
@@ -47,7 +47,7 @@ harnessed's three-layer stack is a software-engineering implementation of the es
47
47
  |---|---|---|---|
48
48
  | **① Behavior** | BDD | *What* to build + how we know it's done | gstack `/office-hours` governance · GSD discuss · superpowers brainstorming → acceptance criteria |
49
49
  | **② Spec** | SDD | *How* it's structured | GSD plan-phase → requirements / design / tasks · contracts (Spec Kit / ECC patterns) |
50
- | **③ Implementation** | TDD | Does it actually *work* | superpowers TDD red-green · subagent execution · GSD verify-work · ralph-loop completion |
50
+ | **③ Implementation** | TDD | Does it actually *work* | superpowers TDD red-green · subagent execution · GSD verify-work · harnessed completion gate |
51
51
 
52
52
  The loops are **nested lenses, not phases** — the classic Cucumber BDD-outer + TDD-inner double-loop, extended with a GenAI-era SDD spec ring into a triple-loop. harnessed runs the default outer→inner traversal as its 5-stage cadence, plus the **back-edges it ships today**: Verify kicks failing work back to Task, a subagent that hits a gray area round-trips to clarification before continuing, and every shipped cycle feeds learnings back into the next Discuss. (Finer-grained structured back-edges — e.g. a contract contradiction routing straight to Spec, an ambiguous requirement to Behavior — are on the roadmap, not shipped. harnessed is the linear-cadence realization of the triple-loop; the full routed graph is its evolution path.)
53
53
 
@@ -268,7 +268,7 @@ graph TD
268
268
  | `/task-clarify` | ③ Task | Sub | superpowers brainstorming + `/grill-with-docs` conditional | Subtask startup clarification gate |
269
269
  | `/task-code` | ③ Task | Sub | karpathy 4 principles + `/improve-codebase-architecture` / `/diagnosing-bugs` conditional | Subtask coding + cross-session progress.md sync |
270
270
  | `/task-test` | ③ Task | Sub | superpowers TDD red-green-refactor + `/diagnosing-bugs` conditional | TDD mandatory for core logic (alias mattpocock `/tdd`) |
271
- | `/task-deliver` | ③ Task | Sub | `ralph-loop` SDK wrapper + Agent Teams conditional | Until verbatim `COMPLETE` + R20.10 max_iter fallback |
271
+ | `/task-deliver` | ③ Task | Sub | `harnessed checkpoint` completion gate + Agent Teams conditional | Until verbatim `COMPLETE` + R20.10 max_iter fallback |
272
272
  | `/verify` | ④ Verify | Master | masterOrchestrator | 10 subs conditional dispatch by scenario |
273
273
  | `/verify-progress` | ④ Verify | Sub | GSD `/gsd-verify-work` + `/gsd-progress` | Mandatory serial starting point — UAT acceptance + state sync |
274
274
  | `/verify-code-review` | ④ Verify | Sub | `code-review` multi-subagent fan-out | High-confidence findings in parallel |
@@ -303,7 +303,7 @@ graph TD
303
303
  | ---- | ---- | ---- | ---- |
304
304
  | ① **Discuss** | `/discuss` | strategic / phase / subtask (3 in parallel) | gstack `/office-hours` + GSD `/gsd-discuss-phase` + superpowers brainstorming |
305
305
  | ② **Plan** | `/plan` | architecture (conditional) → phase | gstack `/plan-eng-review` + GSD `/gsd-plan-phase` + planning-with-files |
306
- | ③ **Task** | `/task` | clarify → code → test → deliver (4 serial per subtask) | karpathy principles + mattpocock moves + superpowers TDD + `ralph-loop` |
306
+ | ③ **Task** | `/task` | clarify → code → test → deliver (4 serial per subtask) | karpathy principles + mattpocock moves + superpowers TDD + harnessed completion gate |
307
307
  | ④ **Verify** | `/verify` | progress → 5 parallel conditional → simplify (+ multispec critical) | GSD `/gsd-verify-work` + code-review + gstack `/review` / `/qa` / `/cso` / `/design-review` + code-simplifier |
308
308
  | ⑤ **Ship** | `/ship` | preflight (release-readiness gate) → delegate PR/deploy | `harnessed release-preflight` + gstack `/ship` + `publish.yml` CI (tag-ready boundary) |
309
309
 
@@ -389,7 +389,7 @@ harnessed/
389
389
  │ L6 Workflow orchestration (workflows/<stage>/<sub>/) │
390
390
  ├────────────────────────────────────────────────────────────┤
391
391
  │ L5b Execution Mechanism (orthogonal): subagent / Agent Teams │
392
- │ / main session + ralph-loop wrapper │
392
+ │ / main session + harnessed completion gate │
393
393
  │ parallelism-gate.yaml: default subagent → escalate 5 triggers │
394
394
  │ Pattern A full-stack three-way / B opposing hypotheses / C multi-dim review │
395
395
  ├────────────────────────────────────────────────────────────┤
@@ -417,9 +417,9 @@ harnessed/
417
417
  behavioral (6): karpathy-guidelines + output-style + language + operational + priority + protocols
418
418
  tool-slash-cmd (~60): gstack 30+ optional + gsd 10+ + mattpocock 12 high-frequency + etc.
419
419
  tool-mcp (3): chrome-devtools-mcp / tavily-mcp / exa-mcp
420
- tool-cli (2): ctx7 / gws
420
+ tool-cli (3): ctx7 / gws / completion-gate
421
421
  tool-plugin (2): planning-with-files / @playwright/test
422
- tool-bundled (3): ralph-loop / webapp-testing / playwright-cli
422
+ tool-bundled (2): webapp-testing / playwright-cli
423
423
  agent-platform (3): agent-teams-create / send-message / shutdown
424
424
  ```
425
425
 
@@ -183,6 +183,9 @@ function scanTasks(dirPath) {
183
183
  return { nextUnchecked: null }
184
184
  }
185
185
 
186
+ // src/checkpoint/progress.ts
187
+ var PLATEAU_THRESHOLD = 2
188
+
186
189
  // src/checkpoint/injectState.ts
187
190
  var INTENT_TTL_MS = 24 * 60 * 60 * 1e3
188
191
  function formatIntentAge(ms) {
@@ -246,6 +249,19 @@ function buildWorkflowStateBlock(wf, forward, ledgerAgeMs) {
246
249
  `BREAK-LOOP: sub '${l.sub}' failed ${l.count}x \u2014 stop retrying, run break-loop skill`,
247
250
  )
248
251
  }
252
+ for (const e of ledger) {
253
+ const attempts = e.fail_count ?? 0
254
+ if (e.attempt_budget !== void 0 && attempts >= e.attempt_budget) {
255
+ lines.push(
256
+ `BUDGET-EXHAUSTED: sub '${e.sub}' spent ${attempts}/${e.attempt_budget} attempts \u2014 do NOT spawn it again; re-scope, fix the blocker, or escalate`,
257
+ )
258
+ }
259
+ if ((e.progress?.stale_count ?? 0) >= PLATEAU_THRESHOLD) {
260
+ lines.push(
261
+ `NO-PROGRESS: sub '${e.sub}' made no improvement for ${e.progress?.stale_count} consecutive attempts (metric: ${e.progress?.metric}) \u2014 stop respawning, change the approach`,
262
+ )
263
+ }
264
+ }
249
265
  if (wf.ship_ready) {
250
266
  lines.push(
251
267
  `SHIP-READY: ${wf.ship_commits ?? 0} commit(s) since the last release tag \u2014 consider shipping (harnessed release-preflight, then /ship)`,