/ruflo-metaharness:harness-evolve --repo <path> [--generations 3] [--children 3] [--concurrency 2] [--sandbox real|mock|agent] [--selection pareto|quality-diversity|...] [--mutator deterministic|ruvllm] [--diagnose] [--confirm]from ruflo-metaharness
Evolves a harness by mutating its seven policy surfaces, sandbox-scoring variants, and promoting only measured wins against tests or a bench suite.
Ships in ruflo-metaharness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Surfaces the upstream metaharness-darwin evolve CLI as a ruflo skill. The
write layer that pairs with ADR-150's read layer (score / genome /
mcp-scan / threat-model / oia-audit). Use when you have a harness whose
readiness scores are flat and you want to discover which surface mutation
moves them — without retraining the foundation model.
harness-score result is below target and you don't know which policy
surface is responsible.Implementation: scripts/evolve.mjs.
--repo exists, caps on --generations ≤ 50, --children
≤ 20, --concurrency ≤ 8, sandbox/selection/mutator are known values).--confirm: print plan + exit 0 (mirrors harness-mint safety
convention; defense in depth over the upstream safety.ts checks).--confirm: run metaharness-darwin evolve <repo> ... from the installed
@metaharness/darwin (pin in _darwin.mjs; one-time ~/.ruflo/darwin-cache-<pin>
install only if no installed copy qualifies — never npx) via the shared
_darwin.mjs async helper. Per-generation progress is
forwarded to stderr; final champion JSON is captured from stdout.generations × children × per-variant (per-variant
≈ 60s real, ≈ 2s mock). Caller may override with --timeout-ms.inspectVariant
for secrets / shell-out / network / dynamic-eval). See ADR-153 §"Safety model".--alert-on-no-improvement: exit 1 when champion ≤ parent.| Surface | What it owns |
|---|---|
planner | task decomposition / step ordering |
contextBuilder | what gets fed into the prompt |
reviewer | self-critique / output verification |
retryPolicy | when + how to retry on failure |
toolPolicy | which tools the agent may use, under which conditions |
memoryPolicy | what to persist, recall, forget |
scorePolicy | how the agent grades its own output |
One mutation per variant. Multi-surface mutations are not allowed (causal attribution stays clean).
Reports land under <repo>/.metaharness/:
.metaharness/
archive.json # full lineage tree (sampling next gen draws from this)
lineage.json # parent→child edges only
variants/<id>/ # per-variant code (kept for audit)
runs/<id>/ # per-variant sandbox test output
reports/winner.json # final champion + score delta vs parent
Skill stdout = JSON {success, data: {champion, plan, durationMs, improved}}
(plus data.diagnosis when --diagnose is passed — see below).
--diagnose)GEPA's key trick is natural-language failure diagnosis from execution traces
feeding the next mutation — not just scalar fitness. --diagnose adds a
modest slice of that: after the evolution completes, the losing / failed
variants' transcripts are run through darwin's GEPA library ops
(analyzeTranscript + classifyFailure, via the shared importGepa
resolver in scripts/_darwin.mjs) and a diagnosis section is appended to
the emitted JSON:
"diagnosis": {
"available": true,
"scope": "losing-variants",
"variants": [
{ "id": "g1_v0", "transcripts": 2,
"failureClasses": { "exploration-loop": 1, "edit-mechanics": 1 },
"dominantClass": "exploration-loop" }
],
"totals": { "exploration-loop": 1, "edit-mechanics": 1 }
}
Upstream shape caveats (verified against @metaharness/[email protected]):
metaharness-darwin evolve --json prints a TEXT leaderboard — the stdout
carries no JSON and no transcripts. Per-variant run records live at
<repo>/.metaharness/runs/<id>.json.{taskId, exitCode, stdout, stderr}), which are NOT GEPA {actionRaw, obs} transcripts. Diagnosis
therefore uses GEPA-shaped transcripts when a run record embeds them
(agent sandbox / future upstream), falls back to the champion's transcript,
and otherwise emits diagnosis: {available: false, reason, traceSummary}
where traceSummary is a mechanical per-variant tally (tasks / failed /
timedOut / blockedActions).--diagnose NEVER fails the run — any internal error degrades to
{available: false, reason: "diagnosis-failed: ..."}.| Code | Meaning |
|---|---|
| 0 | Evolved OK, or dry-run, or degraded (Darwin absent) |
| 1 | --alert-on-no-improvement and champion did not beat parent |
| 2 | Config error or evolution infrastructure failure |
| 99 | Upstream "safety-disqualified" (PROPAGATED, not remapped) |
When @metaharness/darwin is not installed, the script emits
{degraded: true, reason: 'metaharness-darwin-not-available', hint: ...}
and exits 0. ruflo continues to function. CI's
no-metaharness-smoke.yml-style job asserts this path.
What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/harness-benchCreate (`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./harness-drift-from-historyOne-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./harness-genome7-section repo readiness report from `metaharness genome {path}`. Returns repo_type / agent_topology / risk_score / mcp_surface / test_confidence / publish_readiness. Pure-read; degrades gracefully (ADR-150)./harness-gepaLoad, 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./harness-learnRun 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)./harness-mcp-scanStatic security scan of a harness's declared MCP surface via `harness mcp-scan {path}`. Reads `.mcp/servers.json` + `.harness/claims.json`. Pure-read, no dispatch. Exits 1 on findings at or above `--fail-on` severity.npx claudepluginhub ruvnet/ruflo --plugin ruflo-metaharnessOther plugins' skills for the same job