Harness learn

From ruvnet/ruflo · View interactive version

Harness learn is an AI agent skill from the GitHub repository ruvnet/ruflo. 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).

How to use this skill

Skill file

Surfaces metaharness learn — the upstream GEPA learning harness that

evolves harness policy genomes against a scored task corpus instead of

hand-editing prompts. Candidates are scored on held-out slices and only

measured winners promote (the shipped cand-6 genome is the first such

promotion: holdout gold 2/12 → 3/12, zero regressions).

When to use

measured improvement loop rather than manual prompt iteration.

resolves the slice manifest and reports cost without any model calls.

to inspect what the promoted policy actually says.

Preconditions (upstream design)

The learning harness (GEPA + SWE-bench + Docker) is too heavy for the npm

package, so learn needs a local clone:

git clone https://github.com/ruvnet/metaharness.git
node scripts/learn.mjs --repo ./metaharness --host claude-code --model haiku --slice slices/lite.json

Without a checkout the script emits {status: "checkout-required"} and

exits 0 — a precondition report, not an error (distinct from

degraded: true, which means the npm package itself is absent). The

managed-service path (gateway-side learn jobs, no checkout) is upstream's

ADR-235 follow-up and not available yet.

Algorithm

Implementation: CODE0.

  1. Validate --repo exists when given; export it as $METAHARNESS_REPO.
  2. Invoke the pinned metaharness binary (metaharness@~0.4.1, local install

or one-time versioned cache — never @latest): `metaharness learn --host <h>

--model <m> --slice <s> [--run] via _harness.mjs` (graceful degradation,

hard timeout).

  1. Default timeouts: 120s dry-run, 600s with --run — real runs on larger

slices need an explicit --timeout-ms matched to slice size × model cost.

  1. Detect the checkout-required message → structured payload, exit 0.
  2. Parse the trailing JSON report when upstream emits one; otherwise return

the raw report text under rawReport.

Cost note

--run is the ONLY path that spends. Everything else — dry-run, checkout

probe, degraded path — is $0. The MCP tool (metaharness_learn) has a 120s

subprocess budget; run real learning cycles from a terminal via

ruflo metaharness learn ... --run --timeout-ms <big>.

Exit codes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.