evolve
Evolve this harness with Darwin Mode — frozen model, evolving harness (real, sandboxed, safety-gated).
git clone --depth 1 https://github.com/ruvnet/metaharness /tmp/evolve && cp -r /tmp/evolve/kimi-k3-harness/.claude/skills/evolve ~/.claude/skills/evolveSKILL.md
# evolve — Darwin Mode self-improvement `kimi-k3-harness` ships with **Darwin Mode** (`@metaharness/darwin`, ADR-070…146): the model is frozen; the *harness* evolves. Each generation mutates ONE of the 7 surface files (planner, contextBuilder, reviewer, retry/tool/memory/score policy), sandboxes each child, scores it, and keeps only variants that *measurably* improve — building an archive of successful descendants. ## Run it ```bash npm run evolve # real substrate: runs your test command per variant (deterministic mutator — no API key, no network) npm run evolve:dry # mock substrate: fast, fully offline, no test execution ``` Or directly: ```bash npx metaharness-darwin evolve . --sandbox real --generations 3 --children 4 ``` ## Safety (secure by default) - **Deterministic mutator** is the default — **no network, no API key, air-gapped**. - Every mutation passes the `validateGeneratedCode` gate: no new imports, network, filesystem, shell, env access, or dependencies — pure refactor/tuning only. - Mutations run in a **sandbox**; only variants that pass your tests are archived. - Nothing is promoted without measured improvement (guard against Goodharting). See `@metaharness/darwin` for selection strategies (`--selection`, `--crossover`, `--curriculum`), statistical gates (`--fdr`, `--bench`), and the real-LLM mutator (library API). ## What the benchmarks taught us (measured, full SWE-bench Lite 300) Defaults worth carrying into how you evolve and run this harness (full evidence + CIs in `@metaharness/darwin`'s `LEARNINGS.md` / `bench/results/RESULTS.md`): 1. **Closed-loop repair is the #1 lever (~2×).** Feeding test/compiler failure back and retrying took resolve-rate 7.7% → 15.3% on the *same cheap model*. Iterate against ground truth, don't single-shot. 2. **Cheap-first + cost-aware routing.** Track **$/resolve**, not just resolve-rate; a cheap model resolved 31× cheaper per fix than a frontier one. Reserve frontier for *measured* capability gaps. 3. **Tier the models (Barbarian & Scholar).** Cheap sweep + frontier on *only the residual* = 33.3% at ~6× lower cost than running frontier everywhere. 4. **Put the output-format contract in a system message + example**, and size prompts to the model's real context window — this alone took a weak local model from 0% to ~50% valid output. 5. **Only trust batch evaluation of the final artifact** — in-loop counters drift 1.5–5×. 6. **The harness multiplies the model; it can't rescue one below the task's reasoning floor.** Pick the smallest model *above* the floor, then let evolution do the rest.
Diff two scaffolded harnesses (ADR-031). Reports manifest meta drift + host list + per-file fingerprint changes (added/removed/changed). Exits 0 IDENTICAL, 1 DRIFT, 2 missing manifest. Use --bundle for the ADR-031 schema-1 JSON envelope.
Scaffold your own focused AI agent harness — pick host (Claude Code, Codex, pi.dev, Hermes), template, agents, skills, and ship a npm-publishable harness with its own npx CLI. Use when a user asks to "create my own agent harness", "scaffold a harness", "make a custom Claude Code plugin like ruflo", or "build a vertical AI assistant for X".
Kernel-version skew check (ADR-027). Reports manifest surface + manifest kernel + installed kernel + verdict (match/patch-diff/minor-diff/major-diff). Exits 1 on minor/major skew with a copy-pasteable `npm install @metaharness/kernel@X.Y.Z` next step. Exits 2 if no .harness/manifest.json at path.
Scaffold a ready-made AI agent harness in one command from the 19 published @metaharness/* example packages — 9 host integrations (Claude Code, Codex, Hermes, pi.dev, OpenClaw, RVM, Copilot, OpenCode, GitHub Actions) + 10 vertical pods (devops, research, trading, support, legal, coding, education, sales, gaming, repo-maintainer).
GCP Secret Manager integration: validate setup, fetch values, or confirm an NPM_TOKEN is non-revoked via `npm whoami`. Used for publish-time token rotation without long-lived keys in CI.
List the available harness templates and what each one ships with. Use when the user asks "what templates are available", "what verticals does the harness generator support", or "show me what I can scaffold".
Emit .harness/oia-manifest.json declaring layer alignment with the OIA v0.1 9-layer reference architecture. Self-describes the harness's MCP wiring, witness signing, audit log, identity posture (always 'none' at v0.1). --check verifies an existing manifest, --dry-run prints without writing, --json emits to stdout.
Publish a generated harness to npm — runs the smoke test, signs the witness manifest, and dispatches `npm publish --provenance` from your tagged release.