Commit Graph
7782 Commits
Author SHA1 Message Date
ruv a63cdf0526 feat(metaharness): integrate @metaharness/redblue@~0.1.1 — adversarial red/blue LLM testing
ADR-150 sibling-package integration. `@metaharness/redblue` runs an
adversarial red-team → judge → blue-team patch → retest → report loop
against an LLM target you own. Covers OWASP LLM Top-10 / NIST AI RMF
families (prompt injection, tool misuse, data leakage, jailbreaks,
denial-of-wallet). Joins score/genome/mcp-scan/threat-model/oia-audit
as the run-time red/blue layer of the security plugin surface.

Why integrate here vs ruflo-aidefence or ruflo-security-audit:
- aidefence is detection (PII / prompt-injection scan); redblue is
  *generation* — they complement, redblue doesn't replace it
- security-audit is dep CVEs / static scan; redblue is run-time LLM eval
- ruflo-metaharness already carries the @metaharness/* wrapper pattern
  (`_darwin.mjs`, `_harness.mjs`), the locator, the MCP-tool registration
  surface, and the smoke/CI gates — redblue slots in as one more sibling

Surface added:
- `npx ruflo metaharness redblue {init|run|patch|attack|report}` CLI
- `metaharness_redblue` MCP tool (subcommand + family + tests + patch +
  mockJudge + alertOnFail + timeoutMs)
- Skill discoverability via CLAUDE.md (both CLI catalog + MCP tool catalog)
- 11 metaharness subcommands (was 10), 13 MCP tools (was 12)

Safety posture (inherited verbatim from upstream; wrapper does NOT relax):
- upstream `src/config/safety.ts` hard-enforces no real credentials, no
  live external targets (loopback / *.test / *.internal only), no shell,
  no arbitrary network, no eval at config-load time — a config that
  enables any of these errors at load
- `--mock-judge` is the $0 marker-fixture path for CI / offline; the real
  model judge requires `OPENROUTER_API_KEY` and is capped by
  `max_cost_usd` / `max_runtime_minutes` / `max_tests`
- wrapper shells out with `shell: false` argv arrays; never string interp
- ADR-150 graceful-degradation rule #3 — on install/network failure the
  wrapper returns `{degraded: true, reason: ...}` and exits 0 so ruflo
  stays operational

Upstream bug workaround (track for revert):
`@metaharness/redblue@0.1.1`'s CLI bootstrap uses
`isMain = import.meta.url === \`file://\${process.argv[1]}\``. When npx
links `redblue` → `dist/cli/index.js`, argv[1] is the symlink path but
import.meta.url is the resolved real path, so isMain is false and the
binary silently exits 0 with no output, no file, no error. Darwin's CLI
calls `main()` unconditionally and is unaffected. Workaround: install the
package once into `~/.ruflo/redblue-cache` via `npm install --prefix` and
invoke `node <abs_path>/dist/cli/index.js` directly — argv[1] then equals
the real path and isMain becomes true. First install hits npm's cache so
the cold path is ~200ms; warm invocations are ~20ms.

Locator hardening (prevents recurrence of artifact-mirror staleness):
The publish artifact at `v3/@claude-flow/cli/plugins/ruflo-metaharness/`
is regenerated only at `prepublishOnly`. On a dev tree with a fresh
script in source but a stale mirror, the locator would pick the mirror
because `_harness.mjs` exists in both. Locators in `commands/metaharness.ts`
and `mcp-tools/metaharness-tools.ts` now accept an optional `requiredScript`
that narrows the match to dirs containing the dispatched script. The
artifact mirror is also synced with the two new redblue scripts so the
publish artifact stays usable until the next `prepublishOnly`.

Gates updated to lock new state:
- smoke.sh: 9 subcommands in dispatcher (was 8), 11 in description list
  (was 10), 13 MCP tools (was 12), 13 mcp-script-count (was 12), 14
  MCP_SUCCESS_SEMANTIC footnotes (was 13), 13 `success: r.success`
  occurrences (was 12), tilde-pin check covers @metaharness/redblue
- test-mcp-tools.mjs: `tools.length === 13`, `metaharness_redblue`
  enumerated, attack-preview Phase-3 input, 180s timeout (cold-cache npx
  fetch class)
- CLAUDE.md: surfaced under both CLI catalog and MCP-tool catalog (gated
  by smoke 17z56 + 17z57)

Verification:
- `bash plugins/ruflo-metaharness/scripts/smoke.sh` → 120 passed, 0 failed
- `node plugins/ruflo-metaharness/scripts/test-mcp-tools.mjs` → 153 passed, 0 failed
- `node v3/@claude-flow/cli/bin/cli.js metaharness redblue init --out <path>`
  → writes the safety-asserting sample config, exits 0
- attack preview, mock-judge run (3-test → real findings report), and
  CLI dispatcher all exercised end-to-end before commit

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-27 14:01:20 -04:00
rUv 2c8618e782 Merge pull request #2482 from ruvnet/chore/release-3.14.4
chore(release): 3.14.4
v3.14.4
2026-06-27 12:32:42 -04:00
ruv 012c51ee88 chore(release): 3.14.3 → 3.14.4
Patch release shipping the darwin-core systems sweep (PR #2481):
  skill-distillation: 0.4286 → 1.0 (+133% rel on ADR-155 synthetic bench)
  causal-graph hot path: 115ms → 3ms (-97%) via early-exit + import cache
  reasoning-bank: scifact +0.0024 tie-breaker (cumulative +10.3%)
  benchmark-intelligence.mjs: new --only=<dim> flag for per-dim measurement

Also slims root-package files-pattern to exclude .claude/worktrees/**,
.claude/projects/**, .claude/sessions/** and the scheduled_tasks.lock —
the published tarball had bloated to 276 MB from worktree pollution;
now back to 2.3 MB / 1096 files (slimmer than 3.14.1's 77 MB baseline).

All three packages bumped in lockstep:
  @claude-flow/cli@3.14.4
  claude-flow@3.14.4
  ruflo@3.14.4

Legacy alpha + v3alpha tags repointed to 3.14.4.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-27 12:32:04 -04:00
rUv 2709d1c633 Merge pull request #2481 from ruvnet/darwin/core-systems-evolution-2026-06-27
darwin-core: self-learning + memory systems evolution (5 ticks, 4 real wins + bench infra)
2026-06-27 12:20:39 -04:00
ruv af6440c246 darwin-core iter 5 — plateau confirmed, loop halted
0 improvements, 5 honest skips, 1 attempted noImprovement.

The 6 dimensions sit at:
  sona-adapt:        WASM-opaque, AT-TARGET (0.0041 < 0.005)
  moe-gate:          WASM-opaque, AT-TARGET (0.88 > 0.85)
  skill-distillation: bench-saturated 1.0/1.0 (synthetic ADR-155 bench; real ALFWorld eval needed for next jump)
  causal-graph:      smoke binary 21/21 pass; perf path optimized to 3ms (was 115ms)
  reasoning-bank:    BEIR bench doesnt exercise the ReasoningBank subsystem at all — wrong target
  hnsw-search:       NAPI does not honor efConstruction beyond a cap

Real Darwin wins committed across iters 1-4:
  scripts/bench-skill-distillation.mjs (new)         — ADR-155 bench
  scripts/benchmark-intelligence.mjs --only flag      — infra
  v3/@claude-flow/cli/src/mcp-tools/agentdb-tools.ts — early-exit + dynamic-import cache
  v3/@claude-flow/cli/scripts/run-beir-hybrid.mjs    — bm25 tie-breaker

Cron job fd8ff24b deleted. PR incoming.
2026-06-27 11:56:04 -04:00
ruv d82e215696 darwin-core iter 4 — log aggregate
2 improvements:
  skill-distillation: 0.8571 → 1.0 (+0.1429 abs, +17% rel; cumulative +133% over baseline)
  causal-graph:       10ms → 3ms (-70% via dynamic-import cache)

3 noImprovement: sona/moe are WASM-opaque (no editable surface — they're at target anyway);
reasoning-bank BGE prefix needs paired doc re-embedding (not feasible per-tick).

2 new baselines established (finally): hnsw recall@10=0.89 at N=5k (lower than documented
0.99 — worth a separate investigation); moe afterConfidence=0.88079 (above 0.85 target).

Net direction: 2 dims at target, 1 saturated at synthetic-bench ceiling, 1 plateaued
within current cached embeddings, 2 measurable but opaque to in-repo edits.
2026-06-27 11:47:53 -04:00
ruv 45da93d480 darwin-core iter 4 — causal-graph: cache dynamic imports in graph-query/pathfinder hot path Δ=7 2026-06-27 11:46:25 -04:00
ruv d27b6b2e04 darwin-core iter 4 — skill-distillation: promote all successful traces Δ=0.1429 2026-06-27 11:42:23 -04:00
ruv 4618c557a0 darwin-core infra: add --only=<dim> flag to benchmark-intelligence.mjs
Per-dimension Darwin agents only need one bench's output. Without --only,
the script ran all 6 sub-benches (~5-10 min wall) and three agents in
tick 1+2+3 timed out trying to slice the JSON output for their dim.

Accepts both --only hnsw,sona and --only=hnsw,sona forms (Darwin agents
prefer the = form).

Quick verify: `node scripts/benchmark-intelligence.mjs --only=hnsw --sizes 5000`
returns only the hnsw block in ~5s.
2026-06-27 11:41:06 -04:00
ruv 7c85ac56fd darwin-core iter 3 — log aggregate (2 improvements + skill-distillation +100% rel)
skill-distillation breakthrough: AND→OR predicate relax took the metric from
0.4286 → 0.8571 (+100% rel), exceeding the SKILL-DISCO arXiv 2026 +22% target
by 4.5x on the synthetic ADR-155 bench. 6/7 successful traces now promoted
vs the original 3/7.

causal-graph: EXISTS-probe early-exit on missing seed → 115ms → 0ms for the
absent-seed case. Test 5e in graph-query smoke now exits in O(1) vs O(N).
21/21 smoke tests still pass.

reasoning-bank: tried bm25=0.15 (up from 0.05 tick 2 champion), regressed
-0.0062. Confirms bm25=0.05 is the LOCAL OPTIMUM on this axis.

sona-adapt: still at-target.
hnsw-search + moe-gate: still bench-timeout (benchmark-intelligence.mjs has
issues at small N. Tick 4 should investigate the script directly).
2026-06-27 11:32:04 -04:00
ruv b1499ccbcd darwin-core iter 3 — causal-graph: early-exit pathfinder when seedNodeId absent from graph_edges Δ=skip-O(N)-scan 2026-06-27 11:22:27 -04:00
ruv 6c1958427a darwin-core iter 3 — skill-distillation: relax predicate to success && (repeatable || novel) Δ=0.4285 2026-06-27 11:20:40 -04:00
ruv 5dc8de627a darwin-core iter 2 — log aggregate (1 improved, 1 at-target, 1 new baseline, 3 bench-failed) 2026-06-27 11:17:28 -04:00
ruv 28ea21f6c8 darwin-core iter 2 — reasoning-bank: scifact bm25 tie-breaker 0.0→0.05 Δ=+0.0024 2026-06-27 11:16:56 -04:00
ruv 7d207b1fab darwin-core iter 1 — baselines + skill-distillation bench (ADR-155)
3/6 baselines established:
  sona-adapt:        0.004123 ms/call (AT TARGET <0.005)
  reasoning-bank:    0.6256 ndcg@10  (gap to SOTA 0.74)
  skill-distillation: 0.4286 promoted/successful (NEW dim per ADR-155)

3/6 bench-failed (worktree dist/ not built):
  hnsw-search       — needs dist/ build in worktree
  moe-gate          — reward-stream=200 exceeded 6m wall; use 50
  causal-graph      — needs dist/ build in worktree

Cherry-picked bench-skill-distillation.mjs from worktree wf_f1e542d8-245-6.
Tick 2 will fix dist-in-worktree pattern + smaller moe-gate stream.
2026-06-27 10:59:39 -04:00
ruv fb53433128 darwin-core: scaffold core-systems evolution loop (6 dimensions, worktree-isolated) 2026-06-27 10:43:29 -04:00
rUv 1f1ff42094 Merge pull request #2480 from ruvnet/chore/release-3.14.3
chore(release): 3.14.3
v3.14.3
2026-06-27 10:31:40 -04:00
ruv c087e6e4f4 chore(release): 3.14.2 → 3.14.3
Patch release bundling 70+ plugin-level fixes from the darwin/plugin-evolution
sweep (PR #2477) — concurrent fan-out across all 35 plugins × 4 ticks caught
ADR-112 gaps, invalid CLI flags, wrong MCP tool refs, stale README counts,
namespace drift, unverified perf claims, and cross-file consistency issues.

All three packages bumped in lockstep:
  @claude-flow/cli@3.14.3
  claude-flow@3.14.3
  ruflo@3.14.3

Legacy alpha + v3alpha dist-tags repointed at 3.14.3 for backward compat.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-27 10:31:17 -04:00
rUv 50bf48232f Merge pull request #2477 from ruvnet/darwin/plugin-evolution-2026-06-26
darwin: 4-iter concurrent plugin sweep — 71 plugin fixes (ADR-112 + correctness + drift cleanup)
2026-06-27 10:28:21 -04:00
ruv 12ed081f6b darwin-plugins iter 4 — ruflo-security-audit: --depth full → --depth deep (CLI doesnt support full)
This iter-4 edit was made by the headless agent but its commit step
didnt land in the branch (rate-limit at end of workflow). Cleanly
landing it now alongside the lockfile fix.
2026-06-27 10:12:39 -04:00
ruv c81cd6ab0f ci: remove untracked-copilot files from darwin sweep; regenerate pnpm-lock.yaml
Iter-11 of the BEIR darwin loop accidentally swept untracked
v3/@claude-flow/copilot/ files into a commit. Those files aren't ready
for the workspace + their package.json deps weren't in v3/pnpm-lock.yaml,
which broke pnpm install --frozen-lockfile in every v3-ci.yml job.

Removed the copilot/ tree (it can be reintroduced cleanly later) and
regenerated v3/pnpm-lock.yaml. Verified frozen-lockfile passes locally.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-27 10:12:10 -04:00
ruflo-bot 41d475ee1c chore(data): clone snapshot #7 — 0 clones (14d)
Auto-generated by .github/workflows/clone-tracker.yml.
Source: GitHub Traffic API (14-day rolling window).

Co-Authored-By: ruflo-bot <ruflo-bot@users.noreply.github.com>
2026-06-27 07:24:52 +00:00
ruv bc57e3ccc9 darwin-plugins: iter 4 complete — 1/35 improved (strong convergence) 2026-06-26 20:34:47 -04:00
ruv c285fdb042 darwin-plugins: iter 3 complete — 19/35 improved, deeper cross-file drift fixes 2026-06-26 20:30:57 -04:00
ruv 0b5badac7e darwin-plugins iter 3 — ruflo-security-audit: align memory_store namespace to documented security-findings 2026-06-26 20:30:04 -04:00
ruv 4b07145a3f darwin-plugins iter 3 — ruflo-ruvector: fix stale 103 MCP tool count in agent (missed by iter 2) 2026-06-26 20:30:00 -04:00
ruv b5cb847b70 darwin-plugins iter 3 — ruflo-testgen: smoke step 2 covers new tdd-repair skill 2026-06-26 20:29:59 -04:00
ruv c82b3621bf darwin-plugins iter 3 — ruflo-swarm: align swarm-init argument-hint with 6 supported topologies 2026-06-26 20:29:44 -04:00
ruv 53369d1c78 darwin-plugins iter 3 — ruflo-sparc: correct sparc-implement description to name actual SPARC phases (Pseudocode + Architecture) 2026-06-26 20:29:40 -04:00
ruv 0024355145 darwin-plugins iter 3 — ruflo-rag-memory: replace remaining unverified HNSW perf table with measured audit numbers 2026-06-26 20:29:25 -04:00
ruv 73793eb91f darwin-plugins iter 3 — ruflo-plugin-creator: align smoke check-count claim in SKILL.md (10+ → ≥8) with ADR/README 2026-06-26 20:29:22 -04:00
ruv 473e473779 darwin-plugins iter 3 — ruflo-observability: ADR Decision text says 'Accepted' (matches frontmatter + smoke check #9) 2026-06-26 20:29:02 -04:00
ruv c005412254 darwin-plugins iter 3 — ruflo-knowledge-graph: flag semantic-route as disabled in agent tool list (matches kg.md + ADR-0001) 2026-06-26 20:28:25 -04:00
ruv 3e532063e0 darwin-plugins iter 3 — ruflo-market-data: align market patterns command with SKILL.md dual-path store 2026-06-26 20:28:20 -04:00
ruv e4ecb88ae3 darwin-plugins iter 3 — ruflo-intelligence: align plugin.json tool-count breakdown with README inventory 2026-06-26 20:28:10 -04:00
ruv a29dcc522d darwin-plugins iter 3 — ruflo-jujutsu: ADR Decision text now matches smoke check #9 (Accepted, not Proposed) 2026-06-26 20:28:08 -04:00
ruv 1b4c92f462 darwin-plugins iter 3 — ruflo-goals: sync smoke-check description with Accepted ADR status 2026-06-26 20:27:56 -04:00
ruv 00f5fa7c49 darwin-plugins iter 3 — ruflo-cost-tracker: fix subcommand count heading (20→23) 2026-06-26 20:27:06 -04:00
ruv fb7faef781 darwin-plugins iter 3 — ruflo-adr: fix misleading verify.mjs exit-code header comment 2026-06-26 20:26:51 -04:00
ruv 6c17d59256 darwin-plugins iter 3 — ruflo-daa: sync ADR-0001 Context version to v0.2.0 (matches plugin.json) 2026-06-26 20:26:39 -04:00
ruv 7fcdede483 darwin-plugins iter 3 — ruflo-agentdb: fix stale '10 checks' count (smoke has 13 + 3 INV) 2026-06-26 20:26:29 -04:00
ruv 44cf7fe82c darwin-plugins iter 3 — ruflo-core: fix plugin.json description count (3→4 agents/skills) 2026-06-26 20:26:12 -04:00
ruv 4fea343905 darwin-plugins iter 3 — ruflo-arena: align README evolve example with CLI default (300, not 400) 2026-06-26 20:26:10 -04:00
ruv c2f5b69975 darwin-plugins: iter 2 complete — 28/35 plugins improved, 30+ real bug fixes 2026-06-26 20:24:21 -04:00
ruv f251906d47 darwin-plugins iter 2 — ruflo-metaharness: README listed 5 skills but plugin exposes 11 2026-06-26 20:23:39 -04:00
ruv 6ed682d931 darwin-plugins iter 2 — ruflo-security-audit: fix invalid CLI flags (depth=deep not full, drop nonexistent --include-dev / cve --fix / security report) 2026-06-26 20:17:33 -04:00
ruv 0ec7e7c6aa darwin-plugins iter 2 — ruflo-sparc: fix namespace count (4→3 owned + patterns consumed) 2026-06-26 20:17:27 -04:00
ruv e3b8cf00ce darwin-plugins iter 2 — ruflo-swarm: fix nonexistent Agent tool reference in swarm-init skill 2026-06-26 20:17:19 -04:00
ruv dc4b2d86d9 darwin-plugins iter 2 — ruflo-ruvector: correct MCP tool count 103→91 (verified via mcp tools) 2026-06-26 20:17:09 -04:00
ruv 51d0b3c4db darwin-plugins iter 2 — ruflo-testgen: fix stale namespace name in ADR (testgen-gaps → test-gaps) 2026-06-26 20:16:59 -04:00