@claude-flow/cli 3.64.0 → 3.65.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 (89) hide show
  1. package/.claude/helpers/helpers.manifest.json +2 -2
  2. package/catalog-manifest.json +2 -2
  3. package/dist/src/commands/cost.d.ts +18 -0
  4. package/dist/src/commands/cost.js +195 -0
  5. package/dist/src/commands/doctor-auto-approve.d.ts +9 -0
  6. package/dist/src/commands/doctor-auto-approve.js +32 -0
  7. package/dist/src/commands/doctor.js +21 -3
  8. package/dist/src/commands/hive-mind-worker.d.ts +2 -0
  9. package/dist/src/commands/hive-mind-worker.js +9 -3
  10. package/dist/src/commands/hive-mind.js +15 -1
  11. package/dist/src/commands/hooks.js +8 -2
  12. package/dist/src/commands/index.js +2 -0
  13. package/dist/src/commands/init.js +76 -2
  14. package/dist/src/commands/mods.js +13 -0
  15. package/dist/src/commands/plugins-paths.d.ts +13 -0
  16. package/dist/src/commands/plugins-paths.js +55 -0
  17. package/dist/src/commands/plugins-verify.d.ts +9 -0
  18. package/dist/src/commands/plugins-verify.js +92 -0
  19. package/dist/src/commands/plugins.js +13 -1
  20. package/dist/src/cost/attribution.d.ts +35 -0
  21. package/dist/src/cost/attribution.js +101 -0
  22. package/dist/src/cost/budget-file.d.ts +57 -0
  23. package/dist/src/cost/budget-file.js +113 -0
  24. package/dist/src/cost/litellm.d.ts +69 -0
  25. package/dist/src/cost/litellm.js +135 -0
  26. package/dist/src/init/executor.d.ts +7 -2
  27. package/dist/src/init/executor.js +64 -10
  28. package/dist/src/init/helper-commands.d.ts +16 -0
  29. package/dist/src/init/helper-commands.js +73 -0
  30. package/dist/src/init/risky-settings-gate.d.ts +39 -0
  31. package/dist/src/init/risky-settings-gate.js +130 -0
  32. package/dist/src/init/settings-risk-scanner.d.ts +35 -0
  33. package/dist/src/init/settings-risk-scanner.js +85 -0
  34. package/dist/src/init/types.d.ts +12 -0
  35. package/dist/src/mcp-tools/capability-brain.d.ts +1 -1
  36. package/dist/src/mcp-tools/capability-brain.js +1 -1
  37. package/dist/src/mcp-tools/hooks-tools.js +2 -1
  38. package/dist/src/memory/verified-guards.d.ts +70 -0
  39. package/dist/src/memory/verified-guards.js +101 -0
  40. package/dist/src/memory/verified-outcomes.d.ts +68 -3
  41. package/dist/src/memory/verified-outcomes.js +88 -19
  42. package/dist/src/memory/verified-reverify.d.ts +63 -0
  43. package/dist/src/memory/verified-reverify.js +174 -0
  44. package/dist/src/missions/schemas.d.ts +4 -4
  45. package/dist/src/mods/apply.d.ts +2 -0
  46. package/dist/src/mods/apply.js +68 -8
  47. package/dist/src/mods/command-registry/schema.d.ts +36 -36
  48. package/dist/src/mods/compact-snapshots.d.ts +21 -0
  49. package/dist/src/mods/compact-snapshots.js +45 -0
  50. package/dist/src/mods/headless-check.d.ts +58 -0
  51. package/dist/src/mods/headless-check.js +137 -0
  52. package/dist/src/mods/headless-plugins.d.ts +44 -0
  53. package/dist/src/mods/headless-plugins.js +92 -0
  54. package/dist/src/mods/install-trust.d.ts +28 -0
  55. package/dist/src/mods/install-trust.js +127 -0
  56. package/dist/src/mods/install.d.ts +19 -0
  57. package/dist/src/mods/install.js +38 -1
  58. package/dist/src/mods/plugin-paths.d.ts +60 -0
  59. package/dist/src/mods/plugin-paths.js +131 -0
  60. package/dist/src/mods/plugin-repair.d.ts +8 -0
  61. package/dist/src/mods/plugin-repair.js +7 -0
  62. package/dist/src/plugins/marketplace-trust/scan.d.ts +23 -0
  63. package/dist/src/plugins/marketplace-trust/scan.js +255 -0
  64. package/dist/src/plugins/marketplace-trust/signature.d.ts +53 -0
  65. package/dist/src/plugins/marketplace-trust/signature.js +140 -0
  66. package/dist/src/plugins/marketplace-trust/verify-status.d.ts +42 -0
  67. package/dist/src/plugins/marketplace-trust/verify-status.js +110 -0
  68. package/dist/src/services/headless-worker-executor.d.ts +2 -0
  69. package/dist/src/services/headless-worker-executor.js +13 -3
  70. package/package.json +2 -1
  71. package/plugins/ruflo-metaharness/.claude-plugin/plugin.json +8 -1
  72. package/plugins/ruflo-metaharness/CHANGELOG.md +6 -0
  73. package/plugins/ruflo-metaharness/README.md +14 -1
  74. package/plugins/ruflo-metaharness/agents/metaharness-architect.md +2 -0
  75. package/plugins/ruflo-metaharness/hooks/hooks.json +16 -2
  76. package/plugins/ruflo-metaharness/scripts/_redblue.mjs +12 -2
  77. package/plugins/ruflo-metaharness/scripts/_secret-env.cjs +50 -0
  78. package/plugins/ruflo-metaharness/scripts/_secret.mjs +35 -0
  79. package/plugins/ruflo-metaharness/scripts/smoke.sh +7 -7
  80. package/plugins/ruflo-metaharness/skills/harness-bench/SKILL.md +2 -1
  81. package/plugins/ruflo-metaharness/skills/harness-drift-from-history/SKILL.md +1 -1
  82. package/plugins/ruflo-metaharness/skills/harness-evolve/SKILL.md +2 -1
  83. package/plugins/ruflo-metaharness/skills/harness-gepa/SKILL.md +1 -1
  84. package/plugins/ruflo-metaharness/skills/harness-learn/SKILL.md +2 -1
  85. package/plugins/ruflo-metaharness/skills/harness-mint/SKILL.md +2 -1
  86. package/plugins/ruflo-metaharness/skills/harness-oia-audit/SKILL.md +1 -0
  87. package/plugins/ruflo-metaharness/skills/harness-score/SKILL.md +1 -1
  88. package/plugins/ruflo-metaharness/skills/harness-security-bench/SKILL.md +2 -1
  89. package/plugins/ruflo-metaharness/skills/harness-similarity/SKILL.md +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.64.0",
3
+ "version": "3.65.0",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",
@@ -86,6 +86,7 @@
86
86
  "build": "tsc",
87
87
  "check:metaharness-pins": "node ../../../scripts/check-metaharness-pins.mjs",
88
88
  "test": "vitest run",
89
+ "test:real-binary": "vitest run --config vitest.real-binary.config.ts",
89
90
  "test:plugin-store": "npx tsx src/plugins/tests/standalone-test.ts",
90
91
  "test:pattern-store": "npx tsx src/transfer/store/tests/standalone-test.ts",
91
92
  "postinstall": "node ./scripts/postinstall.cjs",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ruflo-metaharness",
3
3
  "description": "MetaHarness integration for ruflo — surfaces score/genome/mint/mcp-scan/threat-model via skills; pairs with @metaharness/router (ADR-148/149) for cost-optimal model routing; honors ADR-150's architectural constraint that MetaHarness remains an optional augmentation, never a required runtime dependency. As a mod (ADR-445): confirms flywheel promotion, keeps secrets out of inputs, /metaharness-mod, and a status file the console shows",
4
- "version": "0.2.6",
4
+ "version": "0.4.0",
5
5
  "author": {
6
6
  "name": "ruvnet",
7
7
  "url": "https://github.com/ruvnet"
@@ -43,6 +43,13 @@
43
43
  "on",
44
44
  "off"
45
45
  ]
46
+ },
47
+ "openrouterApiKey": {
48
+ "type": "string",
49
+ "title": "OpenRouter API key",
50
+ "description": "Key for the real model judge in redblue runs (--mock-judge needs none). Kept in the credential store, never in settings; OPENROUTER_API_KEY still works when this is empty.",
51
+ "required": false,
52
+ "sensitive": true
46
53
  }
47
54
  }
48
55
  }
@@ -2,6 +2,12 @@
2
2
 
3
3
  Newest first. One `## <version> — <date>` heading per version, then `feat:`, `fix:`, `breaking:` and `chore:` bullets (ADR-478). Built from git history; this is the whole history.
4
4
 
5
+ ## 0.4.0 — 2026-10-29
6
+ - chore: operational skills are user-invoked only (`disable-model-invocation: true`) and long skill/command descriptions are cut to one sentence, so they cost less prompt on every turn (ADR-507, #4588). Every skill is still available as `/<skill>`.
7
+
8
+ ## 0.3.0 — 2026-10-29
9
+ - feat: `openrouterApiKey` is a `userConfig` option with `sensitive: true` (ADR-506, #4587), read through `readSecret` before the `OPENROUTER_API_KEY` environment fallback.
10
+
5
11
  ## 0.2.6 — 2026-10-12
6
12
  - fix: the shared text screen now catches `.env` and e-mailed credentials, no longer flags a model's token talk (`--max-tokens`, `/oauth/token`, "token usage"), and no longer flags values that only name where a secret lives (`./service-account.json`, `--set-secrets=NAME=NAME:latest`); every rule stays linear (#4094, thanks @proffesor-for-testing)
7
13
 
@@ -29,6 +29,19 @@ MetaHarness integration plugin for ruflo. Surfaces the upstream `metaharness` /
29
29
  | `harness-learn` | `/harness-learn --host <h> --model <m> --slice <manifest> [--repo <checkout>] [--run]` | metaharness@0.3.0 / upstream ADR-235 — GEPA learning run; $0 dry-run default, `--run` to spend; needs a metaharness repo checkout |
30
30
  | `harness-gepa` | `/harness-gepa --op genome\|validate\|render\|analyze [--path <genome.json>]` | darwin@0.8.0 GEPA library surface — genome load/validate/render + transcript failure analysis; `gepaOptimize` stays library-only |
31
31
 
32
+ ## User-invoked skills (ADR-507)
33
+
34
+ These skills carry `disable-model-invocation: true`: Claude does not pick them on its own, and they cost nothing in the per-turn skill listing. Type them to run them. They run benchmarks, spend-gated learning or evolution runs, scheduled audits, or a one-shot scaffold.
35
+
36
+ | Skill | Run it with |
37
+ |---|---|
38
+ | harness-bench | `/ruflo-metaharness:harness-bench` |
39
+ | harness-evolve | `/ruflo-metaharness:harness-evolve` |
40
+ | harness-learn | `/ruflo-metaharness:harness-learn` |
41
+ | harness-mint | `/ruflo-metaharness:harness-mint` |
42
+ | harness-oia-audit | `/ruflo-metaharness:harness-oia-audit` |
43
+ | harness-security-bench | `/ruflo-metaharness:harness-security-bench` |
44
+
32
45
  ## Phase-0 baseline (ruflo itself, 2026-06-16)
33
46
 
34
47
  ```json
@@ -79,6 +92,6 @@ This plugin ships a function-hook mod (ADR-445, `hooks/register.ts`). It makes n
79
92
  - **`/metaharness-mod`**: `status`, `recent`, `tools` (which of this plugin's tools are connected) and `scan <text>` (would the guard refuse it). Answered locally.
80
93
  - **Status file**: `.claude-flow/metaharness-mod/status.json` (`{version: 1, updatedMs, guard, calls, total, blocked, recent}`, counters only, never tool input), written at session start and after every call to this plugin's tools.
81
94
 
82
- Options (`userConfig`): `guard` (on).
95
+ Options (`userConfig`): `guard` (on); `openrouterApiKey` (sensitive, empty by default): the key for redblue's real model judge, kept in the credential store. A classic SessionStart hook exports it as `OPENROUTER_API_KEY` to the session's Bash commands when that variable is unset, so a redblue run started from a skill uses it; it never goes in argv. The `metaharness_redblue` MCP tool runs inside ruflo-core's MCP server, which does not see it: export `OPENROUTER_API_KEY` before starting Claude Code for that path (ADR-506).
83
96
 
84
97
  Test it: `claude plugin validate plugins/ruflo-metaharness`, `claude plugin test plugins/ruflo-metaharness`, `bash plugins/ruflo-metaharness/scripts/smoke.sh`.
@@ -36,6 +36,8 @@ needs its own ADR.
36
36
  | `harness-oia-audit` | Composite weekly audit worker (iter 7) | Cron-scheduled; bundles oia+threat+mcp into one timestamped record in `metaharness-audit` namespace |
37
37
  | `harness-mint` | Scaffold a custom harness | User wants to fork; ALWAYS dry-run first, never write to project root |
38
38
 
39
+ `harness-oia-audit` and `harness-mint` are user-invoked (ADR-507), as are `harness-bench`, `harness-evolve`, `harness-learn` and `harness-security-bench`: the Skill tool refuses them. Tell the user which `/ruflo-metaharness:<skill>` to run rather than running it yourself.
40
+
39
41
  ## Tools (subprocess-only, no library imports)
40
42
 
41
43
  - All skills shell out to the pinned `metaharness` / `harness` binaries (`metaharness@~0.4.1`, local install or one-time versioned cache — never `@latest`) via the `_harness.mjs` shared helper.
@@ -1,4 +1,18 @@
1
1
  {
2
- "description": "MetaHarness as a mod (ADR-445): a tighten-only guard on the metaharness tools (promotion needs an explicit confirm, no secrets in inputs), a status file the console reads, and /metaharness-mod.",
3
- "modules": ["./register.ts"]
2
+ "description": "MetaHarness as a mod (ADR-445): a tighten-only guard on the metaharness tools (promotion needs an explicit confirm, no secrets in inputs), a status file the console reads, and /metaharness-mod. The classic SessionStart hook hands the sensitive option openrouterApiKey to the Bash tool as OPENROUTER_API_KEY through CLAUDE_ENV_FILE, only when that variable is not already set, so a redblue run started from a skill can use a key kept in the credential store (scripts/_secret-env.cjs, ADR-506).",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "node -e \"require(require('path').join(process.env.CLAUDE_PLUGIN_ROOT,'scripts','_secret-env.cjs')).bridge({openrouterApiKey:'OPENROUTER_API_KEY'})\""
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ },
15
+ "modules": [
16
+ "./register.ts"
17
+ ]
4
18
  }
@@ -54,7 +54,9 @@
54
54
  // (no real creds, no live targets, no shell, no eval, no arbitrary network).
55
55
  // This wrapper does NOT relax those — it only forwards argv with shell:false.
56
56
  // `--mock-judge` is the $0 CI path; the real model judge gates on
57
- // $OPENROUTER_API_KEY which we never inject.
57
+ // $OPENROUTER_API_KEY. The wrapper never puts a key in argv. When that
58
+ // variable is unset but the plugin option `openrouterApiKey` (sensitive,
59
+ // ADR-506) is, the child gets it as OPENROUTER_API_KEY in its environment.
58
60
 
59
61
  import { spawnSync } from 'node:child_process';
60
62
  import { realpathSync } from 'node:fs';
@@ -67,6 +69,7 @@ import {
67
69
  makeDegradedEmitter,
68
70
  resolvePackageBin,
69
71
  } from './_invoke.mjs';
72
+ import { readSecret } from './_secret.mjs';
70
73
 
71
74
  const DEFAULT_TIMEOUT_MS = 120_000;
72
75
 
@@ -78,6 +81,13 @@ const REDBLUE_PIN = `${REDBLUE_PKG}@${REDBLUE_PIN_VERSION}`;
78
81
 
79
82
  const REASON_PREFIX = 'metaharness-redblue';
80
83
 
84
+ /** The child environment, with OPENROUTER_API_KEY filled from the plugin option when the variable is unset (ADR-506). */
85
+ export function judgeEnv(env) {
86
+ if (env.OPENROUTER_API_KEY) return env;
87
+ const key = readSecret('openrouterApiKey', [], env);
88
+ return key ? { ...env, OPENROUTER_API_KEY: key } : env;
89
+ }
90
+
81
91
  // Cache dir is versioned by the pin so bumping REDBLUE_PIN_VERSION
82
92
  // invalidates stale installs (handled inside ensureCachedInstall). The
83
93
  // resolved layout matches the pre-consolidation helper so existing caches
@@ -133,7 +143,7 @@ export function runRedblue(args, opts = {}) {
133
143
  encoding: 'utf-8',
134
144
  timeout: timeoutMs,
135
145
  cwd: opts.cwd,
136
- env: { ...process.env, ...(opts.env || {}) },
146
+ env: judgeEnv({ ...process.env, ...(opts.env || {}) }),
137
147
  shell: false,
138
148
  });
139
149
  const durationMs = Date.now() - start;
@@ -0,0 +1,50 @@
1
+ // Secret bridge (ADR-506): hand a sensitive `userConfig` option to the scripts a skill or command runs
2
+ // through the Bash tool. Copied verbatim into each plugin that needs it (a test keeps the copies identical).
3
+ //
4
+ // Claude Code gives a plugin's option only to that plugin's hooks, as CLAUDE_PLUGIN_OPTION_<KEY>; the Bash
5
+ // tool never sees it. A SessionStart hook, though, gets CLAUDE_ENV_FILE, and the lines it appends there are
6
+ // loaded into every later Bash tool command of the session. So the plugin's SessionStart hook calls
7
+ // bridge({ option: 'VARIABLE' }) and the script reads VARIABLE as it always did.
8
+ //
9
+ // Exposure: the value then sits in the session's environment file (under ~/.claude, owner-only) and in the
10
+ // environment of the session's Bash commands, the same as exporting it in a shell profile. What the option
11
+ // adds is masked entry and credential-store storage instead of a plain-text profile or .env file.
12
+ //
13
+ // Rules: a variable the user already exported wins and is never overwritten; the value is never printed,
14
+ // logged or put in argv; a value with a newline or NUL is refused; any failure is silent and never blocks
15
+ // the session.
16
+ 'use strict'
17
+ const fs = require('fs')
18
+
19
+ const optionEnvName = (name) => `CLAUDE_PLUGIN_OPTION_${String(name).replace(/[^A-Za-z0-9_]/g, '_').toUpperCase()}`
20
+ const VARIABLE = /^[A-Za-z_][A-Za-z0-9_]*$/
21
+ const quote = (value) => `'${value.replace(/'/g, `'\\''`)}'`
22
+
23
+ /** The env-file lines for the options that are set and whose variable is not. Never contains a value that was not asked for. */
24
+ function bridgeLines(map, env = process.env) {
25
+ const lines = []
26
+ for (const [option, variable] of Object.entries(map || {})) {
27
+ if (!VARIABLE.test(variable)) continue
28
+ if (typeof env[variable] === 'string' && env[variable].trim() !== '') continue
29
+ const value = env[optionEnvName(option)]
30
+ if (typeof value !== 'string' || value.trim() === '' || /[\n\r\0]/.test(value)) continue
31
+ lines.push(`export ${variable}=${quote(value)}`)
32
+ }
33
+ return lines
34
+ }
35
+
36
+ /** Append the lines to CLAUDE_ENV_FILE (owner-only). Returns the variable NAMES written, never values. */
37
+ function bridge(map, env = process.env) {
38
+ try {
39
+ const file = env.CLAUDE_ENV_FILE
40
+ if (!file) return []
41
+ const lines = bridgeLines(map, env)
42
+ if (lines.length === 0) return []
43
+ fs.appendFileSync(file, lines.join('\n') + '\n', { mode: 0o600 })
44
+ return lines.map((line) => line.slice('export '.length, line.indexOf('=')))
45
+ } catch {
46
+ return []
47
+ }
48
+ }
49
+
50
+ module.exports = { bridge, bridgeLines, optionEnvName }
@@ -0,0 +1,35 @@
1
+ // readSecret: one way to read a plugin credential (ADR-506). Copied verbatim into each plugin that
2
+ // needs it, since a plugin may not import from another plugin's folder; keep the copies identical
3
+ // (a test compares them).
4
+ //
5
+ // Order: CLAUDE_PLUGIN_OPTION_<NAME>, which Claude Code sets for a plugin's hooks when the
6
+ // `userConfig` option (declared with "sensitive": true, kept in the credential store) is filled in;
7
+ // then the environment variables the plugin always read, for standalone CLI use and backward
8
+ // compatibility. The value is never logged, echoed, or placed in an error message.
9
+
10
+ /** The environment variable Claude Code sets for a `userConfig` key (non-identifier characters to `_`, upper-cased). */
11
+ export const optionEnvName = (name) => `CLAUDE_PLUGIN_OPTION_${String(name).replace(/[^A-Za-z0-9_]/g, '_').toUpperCase()}`
12
+
13
+ /** The secret, or undefined when neither the option nor any fallback variable holds a non-empty value. Read at call time. */
14
+ export function readSecret(name, envFallbacks = [], env = process.env) {
15
+ for (const variable of [optionEnvName(name), ...envFallbacks]) {
16
+ const value = env[variable]
17
+ if (typeof value === 'string' && value.trim() !== '') return value
18
+ }
19
+ return undefined
20
+ }
21
+
22
+ /** Where the secret was found (a variable NAME, never the value), or undefined. */
23
+ export function secretSource(name, envFallbacks = [], env = process.env) {
24
+ for (const variable of [optionEnvName(name), ...envFallbacks]) {
25
+ const value = env[variable]
26
+ if (typeof value === 'string' && value.trim() !== '') return variable
27
+ }
28
+ return undefined
29
+ }
30
+
31
+ /** Error text for a missing secret: names the option and the variables, never a value. */
32
+ export function secretHint(name, envFallbacks = []) {
33
+ const vars = envFallbacks.length ? ` or export ${envFallbacks.join(' / ')} in your shell` : ''
34
+ return `no ${name} configured: set the plugin option "${name}" with /plugin (it is stored in the credential store)${vars}. Never paste a key into a prompt or a file.`
35
+ }
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env bash
2
- # Structural smoke test for ruflo-metaharness v0.2.6 (ADR-150 Phase 1).
2
+ # Structural smoke test for ruflo-metaharness v0.4.0 (ADR-150 Phase 1).
3
3
  set -u
4
4
  ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5
5
  PASS=0
@@ -32,10 +32,10 @@ else
32
32
  bad "extraction-regex-rot: EXPECTED_TOOLS=$EXPECTED_TOOLS EXPECTED_SUBS=$EXPECTED_SUBS"
33
33
  fi
34
34
 
35
- step "1. plugin.json declares 0.2.6 with adr-150 keywords"
35
+ step "1. plugin.json declares 0.4.0 with adr-150 keywords"
36
36
  v=$(grep -E '"version"' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
37
- if [[ "$v" != "0.2.6" ]]; then
38
- bad "expected 0.2.6, got '$v'"
37
+ if [[ "$v" != "0.4.0" ]]; then
38
+ bad "expected 0.4.0, got '$v'"
39
39
  else
40
40
  miss=""
41
41
  for k in ruflo metaharness harness scorecard genome mcp-scan threat-model router adr-150 adr-148 adr-149 optional-dependency graceful-degradation subprocess phase-1-mvp; do
@@ -483,7 +483,7 @@ step "17z74a. plugin helper pins accept the CLI-declared ranges — no tool-time
483
483
  miss=""
484
484
  # 17z74 compares package.json files with each other; the helpers' own
485
485
  # *_PIN_VERSION constants (what findLocalPackageDir accepts) were never
486
- # compared with them and drifted (~0.3.0 / ~0.8.0 vs declared ^0.4.1 /
486
+ # compared with them and drifted (~0.4.0 / ~0.8.0 vs declared ^0.4.1 /
487
487
  # ~0.10.2), so every metaharness_* call npm-installed an older release next
488
488
  # to the one ruflo ships. Hermetic runtime gate: stub packages at the declared
489
489
  # versions, published layout, npm/npx trap.
@@ -1287,7 +1287,7 @@ miss=""
1287
1287
  DISP="$ROOT/../../v3/@claude-flow/cli/src/commands/metaharness.ts"
1288
1288
  WRAPPER="$ROOT/../../v3/@claude-flow/cli/src/mcp-tools/metaharness-tools.ts"
1289
1289
  # All 13 dispatchable subcommands present (iter-73 had 10; @metaharness/redblue
1290
- # added redblue.mjs; metaharness@0.3.0/darwin@0.8.0 added learn.mjs + gepa.mjs).
1290
+ # added redblue.mjs; metaharness@0.4.0/darwin@0.8.0 added learn.mjs + gepa.mjs).
1291
1291
  for sub in score genome mcp-scan threat-model oia-audit audit-list audit-trend similarity drift-from-history mint redblue learn gepa; do
1292
1292
  grep -q "${sub}" "$DISP" 2>/dev/null || miss="$miss subcommand-${sub}-not-listed"
1293
1293
  done
@@ -2199,7 +2199,7 @@ grep -q "result has 'degraded'" "$F" || miss="$miss no-degraded-assertion"
2199
2199
  grep -q "result has 'exitCode'" "$F" || miss="$miss no-exitcode-assertion"
2200
2200
  # All tool names enumerated (similarity iter 36, drift_from_history iter 54,
2201
2201
  # ADR-153 added bench/evolve/security_bench, @metaharness/redblue added redblue,
2202
- # metaharness@0.3.0/darwin@0.8.0 added learn + gepa, ADR-322 added flywheel)
2202
+ # metaharness@0.4.0/darwin@0.8.0 added learn + gepa, ADR-322 added flywheel)
2203
2203
  for tool in metaharness_score metaharness_genome metaharness_mcp_scan metaharness_threat_model metaharness_oia_audit metaharness_audit_list metaharness_audit_trend metaharness_similarity metaharness_drift_from_history metaharness_bench metaharness_evolve metaharness_security_bench metaharness_redblue metaharness_learn metaharness_gepa metaharness_flywheel; do
2204
2204
  grep -q "${tool}" "$F" || miss="$miss missing-${tool}"
2205
2205
  done
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: harness-bench
3
- description: Manage `@metaharness/darwin` bench suites — `bench create {repo}` scaffolds a JSON suite from a repo's test corpus; `bench verify {suite.json}` checks suite well-formedness. Bench suites are the fixed evaluation corpora that `harness-evolve --bench {suite.json}` scores variants against, decoupling evolution from the repo's natural tests. Degrades gracefully when @metaharness/darwin is absent.
3
+ description: Create (`bench create {repo}`) or verify (`bench verify {suite.json}`) a @metaharness/darwin bench suite, the fixed corpus `harness-evolve --bench` scores variants against. Use when preparing an evolution benchmark. Degrades gracefully without darwin.
4
4
  argument-hint: "--op create --repo <path> [--out <path>] | --op verify --suite <path>"
5
5
  allowed-tools: Bash
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  Surfaces `metaharness-darwin bench <create|verify>` — the supporting verb
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: harness-drift-from-history
3
- description: One-command drift detection. Composes audit-list + oia-audit + audit-trend into a single primitive — finds the most recent audit in `metaharness-audit` namespace, runs a fresh audit against the current repo, diffs them via ADR-152 §3.1 similarity, and alerts when structural distance crosses `--threshold`. Iter 53 of ADR-150 deep integration.
3
+ description: "One-command drift detection: run a fresh metaharness audit, diff it against the latest stored audit by ADR-152 similarity, and alert when the distance crosses `--threshold`. Use when checking whether a harness has drifted since its last audit."
4
4
  argument-hint: "[--path .] [--baseline-since 7d] [--threshold 0.95] [--dry-run] [--format json|table]"
5
5
  allowed-tools: Bash
6
6
  ---
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: harness-evolve
3
- description: Run `@metaharness/darwin evolve {repo}` to mutate a harness's seven policy surfaces (planner/contextBuilder/reviewer/retryPolicy/toolPolicy/memoryPolicy/scorePolicy), sandbox-score each variant, and promote only measured wins. The model is frozen; the harness evolves. Closes the loop ADR-150 opens (score+genome describe; evolve changes). Degrades gracefully when @metaharness/darwin is absent (ADR-150 + ADR-153 architectural constraints).
3
+ description: "Run `@metaharness/darwin evolve {repo}`: mutate a harness's seven policy surfaces, sandbox-score each variant and promote only measured wins. Use when evolving a harness against its tests or a bench suite. Degrades gracefully without darwin (ADR-150/153)."
4
4
  argument-hint: "--repo <path> [--generations 3] [--children 3] [--concurrency 2] [--sandbox real|mock|agent] [--selection pareto|quality-diversity|...] [--mutator deterministic|ruvllm] [--diagnose] [--confirm]"
5
5
  allowed-tools: Bash
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  Surfaces the upstream `metaharness-darwin evolve` CLI as a ruflo skill. The
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: harness-gepa
3
- description: "Inspect and audit GEPA genomes via the `@metaharness/darwin/gepa` library entry (darwin 0.8.0) — load/validate a genome (default is the shipped cand-6 promotion), render the system prompt a genome compiles to, or classify failure modes in a run transcript. The `gepaOptimize` loop itself is library-only (bring your own evaluator) and not surfaced here — use `harness-evolve` for sandbox-scored evolution. Degrades gracefully when @metaharness/darwin is absent."
3
+ description: Load, validate or render a GEPA genome, or classify failure modes in a run transcript, via @metaharness/darwin/gepa. Use when inspecting or auditing a genome; use harness-evolve for sandbox-scored evolution. Degrades gracefully without darwin.
4
4
  argument-hint: "--op genome|validate|render|analyze [--path <genome.json>] [--transcript <t.json>] [--alert-on-invalid]"
5
5
  allowed-tools: Bash
6
6
  ---
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: harness-learn
3
- description: Run a GEPA learning cycle via `metaharness learn` (upstream ADR-235, metaharness@0.3.0) — optimizes a harness genome against a SWE-bench-style slice manifest. $0 dry-run by default; `--run` is the explicit spend opt-in. Requires a metaharness repo checkout (`--repo` or $METAHARNESS_REPO) — without one it reports `checkout-required` with clone instructions. Degrades gracefully when metaharness is absent.
3
+ description: Run a GEPA learning cycle via `metaharness learn`, optimizing a harness genome against a SWE-bench-style slice. Use when training a harness genome. $0 dry-run by default; `--run` opts into spend. Needs a metaharness checkout (--repo or $METAHARNESS_REPO).
4
4
  argument-hint: "--host <h> --model <m> --slice <manifest> [--repo <checkout>] [--run] [--alert-on-fail]"
5
5
  allowed-tools: Bash
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  Surfaces `metaharness learn` — the upstream GEPA learning harness that
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: harness-mint
3
- description: Scaffold a custom AI agent harness via `metaharness new {name} --template {id} --host {id}`. Defaults to DRY-RUN (no writes) unless --confirm is passed. Refuses to write to the calling repo root or anywhere inside it. Honors ADR-150 architectural constraint + ruflo's "destructive-action confirmation" pattern.
3
+ description: Scaffold a custom AI agent harness via `metaharness new {name} --template {id} --host {id}`. Use when the user wants a new standalone harness. Dry-run unless --confirm is passed, and refuses to write inside the calling repo.
4
4
  argument-hint: "--name <id> --template <vertical:coding|minimal|…> [--host claude-code|codex|…] [--target /abs/path] [--confirm] [--format table|json]"
5
5
  allowed-tools: Bash
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  The one write-capable skill in the plugin. Every other skill is
@@ -3,6 +3,7 @@ name: harness-oia-audit
3
3
  description: Composite Phase-2 audit worker (ADR-150). Bundles harness oia-manifest + threat-model + mcp-scan into one timestamped audit record stored in the `metaharness-audit` memory namespace. Designed for cron-scheduled drift detection.
4
4
  argument-hint: "[--path .] [--dry-run] [--alert-on-worst clean|low|medium|high] [--format table|json]"
5
5
  allowed-tools: Bash
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  The 13th worker (ADR-150 Phase 2) — runs three MetaHarness static
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: harness-score
3
- description: 5-dimension harness readiness scorecard from `metaharness score {path}`. Returns harnessFit / compileConfidence / taskCoverage / toolSafety / memoryUsefulness + estCostPerRunUsd + scaffoldReady. Pure-read; subprocess invocation; degrades gracefully when MetaHarness is absent (ADR-150 architectural constraint).
3
+ description: 5-dimension harness readiness scorecard from `metaharness score {path}` (harnessFit, compileConfidence, taskCoverage, toolSafety, memoryUsefulness, plus cost per run). Use when rating a repo as an agent harness. Pure-read; degrades gracefully without MetaHarness.
4
4
  argument-hint: "[--path .] [--alert-on-fit-below 70] [--format table|json]"
5
5
  allowed-tools: Bash
6
6
  ---
@@ -1,8 +1,9 @@
1
1
  ---
2
2
  name: harness-security-bench
3
- description: Run `@metaharness/darwin security bench` (upstream "Darwin Shield" / ADR-155) — evolves a champion security-detection harness against a 10-vuln / 9-decoy corpus and grades it on TPR/FPR/patch-pass/repro/unsafe vs four baselines (B0 static, B1 LLM-single-pass, B2 fixed-agent, B3 Darwin-champion). Closest reference implementation for ruflo's own ADR-155 nightly self-learning security harness (PR #2417). Degrades gracefully when @metaharness/darwin is absent.
3
+ description: "Run `@metaharness/darwin security bench` (Darwin Shield): evolve a security-detection harness on a 10-vuln/9-decoy corpus and grade TPR/FPR/patch/repro against four baselines. Use when benchmarking security-harness detection. Degrades gracefully without darwin."
4
4
  argument-hint: "[--population 2] [--cycles 1] [--seed N] [--alert-on-fail]"
5
5
  allowed-tools: Bash
6
+ disable-model-invocation: true
6
7
  ---
7
8
 
8
9
  Surfaces the upstream `metaharness-darwin security bench` command. **This is
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: harness-similarity
3
- description: ADR-152 — weighted similarity between two harness fingerprints (genome + score JSON). Returns overall score in [0,1] plus per-component breakdown (cosine over 9 numerics, categorical agreement over 4 enums, jaccard over agent_topology). Unblocks ADR-151 §3.2 Recommender, §3.3 Drift Detection, §3.5 Plugin Compat. Pure-TS, no `@metaharness/*` dep — preserves ADR-150's four architectural constraints.
3
+ description: "Weighted similarity (ADR-152) between two harness fingerprints (genome + score JSON): an overall score in [0,1] plus per-component breakdown. Use when comparing two harnesses or detecting drift between them. Pure TypeScript; needs no @metaharness package."
4
4
  argument-hint: "(--a a.json --b b.json | --a-key X --b-key Y) [--per-dimension] [--alert-below 0.5] [--format json|table]"
5
5
  allowed-tools: Bash
6
6
  ---