348 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 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 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 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
ruv de1436bf6f darwin-plugins iter 2 — ruflo-observability: fix Skills table misrepresenting skills as slash-commands 2026-06-26 20:16:10 -04:00
ruv dcf269f7b5 darwin-plugins iter 2 — ruflo-ruvllm: align chat-format argument-hint with 5 supported providers 2026-06-26 20:16:06 -04:00
ruv 99dd600e27 darwin-plugins iter 2 — ruflo-plugin-creator: fix validate-plugin contradiction (plugin.json must not have skills/commands/agents arrays) 2026-06-26 20:15:45 -04:00
ruv 1432cd642b darwin-plugins iter 2 — ruflo-rag-memory: replace unverified 150x-12,500x HNSW claim with measured numbers from intelligence audit 2026-06-26 20:15:27 -04:00
ruv ecd3a4ca80 darwin-plugins iter 2 — ruflo-neural-trader: fix stale skill count (7→9) and document missing trader-explain / trader-portfolio-cg 2026-06-26 20:15:24 -04:00
ruv 7d65f932d7 darwin-plugins iter 2 — ruflo-loop-workers: drop invalid --train-neural flag from post-task example 2026-06-26 20:14:31 -04:00
ruv 4be61d8f27 darwin-plugins iter 2 — ruflo-jujutsu: invoke analyze_diff-reviewers in /jujutsu command 2026-06-26 20:14:22 -04:00
ruv ef87d00b6c darwin-plugins iter 2 — ruflo-iot-cognitum: correct stale source-file count (32→39) 2026-06-26 20:14:12 -04:00
ruv b0af258b2b darwin-plugins iter 2 — ruflo-ddd: fix malformed Bash() permission patterns in skill frontmatter
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01EYpeWgqLx3Q3yL2R2ePfmG
2026-06-26 20:14:10 -04:00
ruv 0253936f4b darwin-plugins iter 2 — ruflo-knowledge-graph: fix README namespace claim (kg-graph → knowledge-graph) to match actual code 2026-06-26 20:13:54 -04:00
ruv 6b735a1537 darwin-plugins iter 2 — ruflo-goals: fix invalid --train-neural flag on post-task (belongs to post-edit) 2026-06-26 20:13:43 -04:00
ruv 16748510c6 darwin-plugins iter 2 — ruflo-daa: tighten /daa command to use detailed:true and remove unmet knowledge-share aggregate claim 2026-06-26 20:13:28 -04:00
ruv 0afaf63bc1 darwin-plugins iter 2 — ruflo-federation: fix misleading commands table (slash commands vs skills)
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01EYpeWgqLx3Q3yL2R2ePfmG
2026-06-26 20:13:16 -04:00
ruv 1df7d4e0d3 darwin-plugins iter 2 — ruflo-autopilot: fix /autopilot config flag names to match MCP signature (maxIterations/timeoutMinutes) 2026-06-26 20:12:51 -04:00
ruv 09eac92096 darwin-plugins iter 2 — ruflo-graph-intelligence: remove broken bench script (missing scripts/benchmark-substrate.mjs) 2026-06-26 20:12:32 -04:00
ruv 39bb83557c darwin-plugins iter 2 — ruflo-browser: fix stale tool count (18 interaction + 5 lifecycle, not 23+5) 2026-06-26 20:12:30 -04:00
ruv 4d7515cd06 darwin-plugins iter 2 — ruflo-agent: document nested-subagents skill in README 2026-06-26 20:12:10 -04:00
ruv 6ae2746ee4 darwin-plugins iter 2 — ruflo-agentdb: replace unverified 150x-12,500x HNSW claims with measured ~1.9x-4.7x 2026-06-26 20:11:39 -04:00
ruv 53916ea2e7 darwin-plugins iter 2 — ruflo-core: refresh stale tool/plugin counts (300+→314, 30+→32) 2026-06-26 20:11:27 -04:00
ruv 4717e3c85f darwin-plugins iter 2 — ruflo-cost-tracker: dedupe 'budget' keyword in plugin.json 2026-06-26 20:11:27 -04:00
ruv 8b565dfb29 darwin-plugins iter 2 — ruflo-adr: fix stale skills table + smoke count (3→4 skills, 10→15 tests) 2026-06-26 20:11:25 -04:00
ruv 347c0b8608 darwin-plugins iter 2 — ruflo-aidefence: declare allowed-tools on /aidefence command 2026-06-26 20:11:19 -04:00
ruv 463aa363d1 darwin-plugins iter 1 — ruflo-graph-intelligence: add ADR-112 'Use when' guidance to 5 MCP tool descriptions 2026-06-26 20:04:34 -04:00