Files
ruvnet--ruflo/v3/docs/adr/ADR-151-harness-intelligence-layer.md
wehub-resource-sync 23f7624596
ADR-166 MCP Bridge Security Lock / Static-source security lock (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / Compose default binds loopback + Mongo has auth (push) Failing after 2s
CodeQL Advanced / Analyze (rust) (push) Failing after 0s
ADR-166 MCP Bridge Security Lock / plugin-agent-federation bindHost default (push) Failing after 1s
ADR-166 MCP Bridge Security Lock / Runtime behavior — 401 + terminal gate + fail-closed (push) Failing after 4s
business-pods-smoke / smoke (push) Failing after 1s
all-plugins-smoke / smoke-all (push) Failing after 2s
CI/CD Pipeline / Security & Code Quality (push) Failing after 1s
CI/CD Pipeline / Test Suite (ubuntu-latest) (push) Failing after 1s
CI/CD Pipeline / Build & Package (macos-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (ubuntu-latest) (push) Has been skipped
CI/CD Pipeline / Build & Package (windows-latest) (push) Has been skipped
CI/CD Pipeline / Documentation & Examples (push) Failing after 1s
Clone Tracker (14-day rolling) / Snapshot clones for ruflo ecosystem (push) Failing after 1s
CodeQL Advanced / Analyze (actions) (push) Failing after 1s
CodeQL Advanced / Analyze (javascript-typescript) (push) Failing after 1s
federation-peer-rust / stable-noop (push) Failing after 1s
metaharness-ci / score (push) Failing after 1s
metaharness-ci / router-compat (push) Failing after 0s
metaharness-ci / similarity-tests (push) Failing after 0s
no-agentbbs-smoke / smoke-without-agentbbs (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (windows-latest) (push) Has been skipped
codex-integration-audit / Codex integration audit (push) Failing after 1s
helpers-manifest-guard / guard (push) Failing after 1s
🔗 Cross-Agent Integration Tests / 🤝 Agent Coordination Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🧠 Memory Sharing Integration (push) Has been skipped
🔗 Cross-Agent Integration Tests / 🛡️ Fault Tolerance Tests (push) Has been skipped
🔗 Cross-Agent Integration Tests / ⚡ Performance Integration Tests (push) Has been skipped
metaharness-ci / mcp-scan (push) Failing after 1s
metaharness-ci / eject-dryrun (push) Failing after 1s
metaharness-ci / metaharness-real-data (push) Failing after 0s
no-cli-optdep-bloat-2561 / guard (push) Failing after 1s
no-metaharness-smoke / smoke-without-metaharness (push) Failing after 1s
no-phantom-agentic-flow-subpath / guard (push) Failing after 1s
🔄 Automated Rollback Manager / 🚨 Failure Detection (push) Failing after 1s
V3 CI/CD Pipeline / Plugin hooks smoke / ubuntu-latest / Node 22 (push) Failing after 1s
V3 CI/CD Pipeline / ruflo-graph-intelligence build + test smoke (#2044, ADR-123) (push) Failing after 1s
CVE Audit Gate / Audit root (critical-blocking) (push) Failing after 2s
cost-tracker-smoke / smoke (push) Failing after 3s
oia-audit-weekly / audit (push) Failing after 2s
ruflo-agent-smoke / ruflo-agent structural smoke (push) Failing after 1s
📊 Status Badges Update / 📊 Update Status Badges (push) Failing after 1s
V3 CI/CD Pipeline / Static regression guards (#2267 YAML + (push) Failing after 1s
V3 CI/CD Pipeline / Test V3 Packages (push) Failing after 0s
V3 CI/CD Pipeline / agent_execute provider routing smoke (#2042) (push) Failing after 0s
CVE Audit Gate / Audit v3 (critical-blocking) (push) Failing after 1s
federation-peer-rust / stable-native (push) Failing after 2s
🔗 Cross-Agent Integration Tests / 🚀 Integration Test Setup (push) Failing after 2s
neural-trader-smoke / runtime-smoke (push) Failing after 1s
V3 CI/CD Pipeline / Build V3 (macos-latest) (push) Has been skipped
V3 CI/CD Pipeline / Build V3 (ubuntu-latest) (push) Has been skipped
V3 CI/CD Pipeline / Type Check V3 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 24 (push) Failing after 1s
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / ubuntu-latest / Node 22 (push) Failing after 2s
V3 CI/CD Pipeline / browser rvf create flag smoke (#2015) (push) Failing after 0s
V3 CI/CD Pipeline / Dependency review (#2046) (push) Has been skipped
V3 CI/CD Pipeline / Supply-chain audit (#2046) (push) Failing after 0s
V3 CI/CD Pipeline / witness marker drift smoke (#2021) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader portfolio CG smoke (#2068, ADR-126 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / neural-trader backtest signing smoke (#2068, ADR-126 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / kg-extract type-import classification smoke (#2049) (push) Failing after 0s
V3 CI/CD Pipeline / witness verify precondition smoke (#1880) (push) Failing after 2s
V3 CI/CD Pipeline / neural-trader pipeline risk-gate smoke (#2068, ADR-126 Phase 5) (push) Failing after 0s
V3 CI/CD Pipeline / neural-trader feature attribution smoke (#2068, ADR-126 Phase 6) (push) Failing after 0s
V3 CI/CD Pipeline / plugin-registry signature verification smoke (#1922, CWE-347) (push) Failing after 4s
V3 CI/CD Pipeline / memory stats legacy-DB smoke (#2120) (push) Failing after 4s
V3 CI/CD Pipeline / github deprecated actions smoke (#2089, ADR-127 Phase 3) (push) Failing after 1s
V3 CI/CD Pipeline / graph query + pathfinder smoke (ADR-130 P2+P5) (push) Has been skipped
V3 CI/CD Pipeline / graph trajectory hooks smoke (ADR-130 P3) (push) Has been skipped
V3 CI/CD Pipeline / graph plugin adapter smoke (ADR-130 P4) (push) Has been skipped
V3 CI/CD Pipeline / graph benchmark (ADR-130 P6) (push) Has been skipped
V3 CI/CD Pipeline / statusline generator delegation smoke (#2195) (push) Failing after 1s
V3 CI/CD Pipeline / wizard init regression guard (#2206 (push) Failing after 1s
V3 CI/CD Pipeline / memory no-stray-db smoke (ADR-125 P7) (push) Failing after 1s
V3 CI/CD Pipeline / github-safe injection smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github actions pin smoke (#2089, ADR-127 Phase 1) (push) Failing after 1s
V3 CI/CD Pipeline / github attribution opt-in smoke (#2089, ADR-127 Phase 4) (push) Failing after 1s
V3 CI/CD Pipeline / pre-bash hook safety smoke (#2017) (push) Failing after 1s
V3 CI/CD Pipeline / Memory import smoke / ubuntu-latest (push) Failing after 0s
V3 CI/CD Pipeline / MCP protocol smoke / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / ruvllm WASM auto-init smoke (#2086) (push) Failing after 4s
V3 CI/CD Pipeline / MCP paired-tool round-trip smoke (#1889) (push) Failing after 1s
V3 CI/CD Pipeline / Plugin package install-safety (#1902/#1903/#1904) (push) Failing after 1s
V3 CI/CD Pipeline / Tool description discoverability (ADR-112) (push) Failing after 3s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (22) (push) Failing after 1s
V3 CI/CD Pipeline / CLI npx-install smoke (#1147 / (24) (push) Failing after 1s
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / ubuntu-latest (push) Failing after 2s
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / ubuntu-latest (push) Failing after 1s
V3 CI/CD Pipeline / Vector-index dimension audit (#1947) (push) Failing after 0s
V3 CI/CD Pipeline / Hook-command install safety (#1921) (push) Failing after 1s
V3 CI/CD Pipeline / ToolOutputGuardrail smoke (ADR-131, (push) Failing after 1s
V3 CI/CD Pipeline / init-bundle invariants smoke (#2095, ADR-128 Phase 5) (push) Failing after 1s
V3 CI/CD Pipeline / wasm provider bridge smoke (ADR-129 P1) (push) Failing after 2s
V3 CI/CD Pipeline / wasm gallery CRUD smoke (ADR-129 P3) (push) Failing after 1s
V3 CI/CD Pipeline / wasm plugin bridge smoke (ADR-129 P4) (push) Failing after 0s
V3 CI/CD Pipeline / wasm compose smoke (ADR-129 P2) (push) Failing after 4s
V3 CI/CD Pipeline / graph schema smoke (ADR-130 P1) (push) Failing after 0s
Validate Marketplace / validate (push) Failing after 1s
🔍 Verification Pipeline / 🚀 Setup Verification (push) Failing after 1s
🔍 Verification Pipeline / 🛡️ Security Verification (push) Has been skipped
🔍 Verification Pipeline / 📝 Code Quality (push) Has been skipped
🔍 Verification Pipeline / 🧪 Test Verification (${{ matrix.os }}, Node ${{ matrix.node }}) (push) Has been skipped
🔍 Verification Pipeline / 🏗️ Build Verification (push) Has been skipped
🔍 Verification Pipeline / 📚 Documentation Verification (push) Has been skipped
CVE Audit Gate / High-severity report (warn only) (push) Has been cancelled
🔄 Automated Rollback Manager / 🔄 Execute Rollback (push) Has been cancelled
🔄 Automated Rollback Manager / ✅ Post-Rollback Verification (push) Has been cancelled
🔄 Automated Rollback Manager / 📊 Rollback Monitoring (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook execution smoke (#2132) / windows-latest (push) Has been cancelled
🔄 Automated Rollback Manager / ⏳ Manual Rollback Approval (push) Has been cancelled
V3 CI/CD Pipeline / MCP protocol smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Memory import smoke / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows hook shim smoke (#2132) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Windows init hooks smoke (#2132) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / macos-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / ubuntu-latest (push) Has been cancelled
V3 CI/CD Pipeline / Witness verify (signed manifest) / windows-latest (push) Has been cancelled
V3 CI/CD Pipeline / Publish to npm (alpha) (push) Has been cancelled
V3 CI/CD Pipeline / Smoke (no better-sqlite3) / macos-latest / Node 22 (push) Has been cancelled
V3 CI/CD Pipeline / Plugin hooks smoke / macos-latest / Node 22 (push) Has been cancelled
CI/CD Pipeline / Deploy & Release (push) Has been cancelled
CI/CD Pipeline / CI Status (push) Has been cancelled
🔗 Cross-Agent Integration Tests / 📊 Integration Test Report (push) Has been cancelled
🔄 Automated Rollback Manager / 🔍 Pre-Rollback Validation (push) Has been cancelled
🔍 Verification Pipeline / ⚡ Performance Verification (push) Has been cancelled
🔍 Verification Pipeline / 📊 Verification Report (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:02:19 +08:00

12 KiB
Raw Permalink Blame History

ADR-151 — Harness Intelligence Layer (Phase 3 scope shell)

Status: Proposed (scope-only; each sub-capability gets its own ADR) Date: 2026-06-16 Related: ADR-150 (MetaHarness Integration Surfaces — Phase 1+2 implemented across iters 132 on feat/metaharness-integration-research) Successor: each Phase-3 capability below will be assigned its own ADR-152, 153, 154, 155, 156 once it moves from "scope" to "decided" Architectural inheritance: this ADR explicitly inherits ADR-150's four load-bearing constraints. Every sub-ADR MUST honor them or supersede them.

Context

ADR-150 Phase 1+2 shipped (32 /loop iterations on the integration branch). The visible result: ruflo can score / scaffold / audit / route / diff harnesses via plugin skills, top-level CLI subcommands, MCP tools, and CI workflows. The latent result: the static-analysis surface (harness score, harness genome, harness mcp-scan, harness threat-model, harness oia-manifest) produces structured per-harness fingerprints — and we are now accumulating those fingerprints over time via the iter-7 oia-audit worker.

A fingerprint is a vector. Vectors enable similarity. Similarity enables a class of capabilities that don't exist anywhere else in the agent-framework space today, all built on the same already-shipped instrumentation:

  • "Find the closest existing harness to this repo."
  • "Recommend the smallest delta from a template that would harness-fit this team's needs."
  • "Alert when fleet-wide harness drift exceeds a threshold."
  • "Map every capability across N internal harnesses — find duplicates, find gaps."
  • "Predict whether plugin X will work in harness Y."

ADR-150's Phase-3 section listed these as scope-only with the rule "each gets its own ADR before implementation." This ADR is the parent: it catalogs them, establishes the architectural invariants they all inherit, and orders them by build-on dependency so future implementation work has a clear sequence.

Decision

Adopt the Harness Intelligence Layer as a Phase-3 capability cluster, scoped to five sub-capabilities below. Each sub-capability:

  1. Inherits all four ADR-150 architectural constraints (removable / optional-only / graceful / CI-gate).
  2. Gets its own ADR before implementation begins.
  3. Must measure its value against the existing instrumentation it builds on — no new metric inventions allowed at this layer; every claim resolves to a number harness score / genome / threat-model / oia-audit already emits.
  4. May not assume a centralized fleet-tracking server. Operate over what's locally inspectable + what's published to the IPFS-pinned ruflo plugin registry (which iter-6 made type: 'harness'-aware).

Phase-3 sub-capabilities (in implementation-dependency order)

3.1 — Genome Similarity Search (ADR-152, ACCEPTED iter 35 — spike landed, both invariants pass)

What: Given two harnesses (or one harness + a candidate repo), compute a similarity score across the 7 genome sections and the 5 scorecard dimensions. Return a normalized 0..1 number plus a per-dimension breakdown.

Who it serves: Devs evaluating "is this repo close enough to harness X that I should fork-and-adapt vs scaffold-from-scratch?"

Builds on: harness genome <repo> (iter-1 wired) + harness score <repo> (iter-1 wired) + ruflo's existing embeddings infrastructure for tokenized text (e.g. the repo's README, agent prompts).

Riskiest assumption: that the 7-section genome + 5-dim scorecard are sufficient signal for similarity. Counter-evidence would be two harnesses with identical genomes but radically different behavior. Mitigation: include a behavioral fingerprint from harness threat-model (the categorized findings) as a tie-breaker.

Smallest demonstrable spike: cosine similarity between two metaharness genome JSON outputs. Pure-function, zero deps beyond what's already in ruflo.

3.2 — Harness Recommendation Engine (ADR-153)

What: Given a repo + a user description, recommend (a) the closest existing harness in the registry, (b) the closest template, (c) the minimum delta to fork from either. Output is an ordered list with confidence scores.

Who it serves: Users approaching ruflo for the first time. Currently ruflo init produces a generic scaffold; this would let ruflo init --recommend propose a specific harness.

Builds on: 3.1 (similarity search) + the IPFS-pinned ruflo plugin registry's type: 'harness' entries (iter-6) + metaharness analyze for the no-exec recommendation path.

Riskiest assumption: that user descriptions are reliable signal. Most users describe what they think they want, not what they need. Mitigation: weight repo-genome evidence over user-description at the recommender's confidence calculation.

Smallest demonstrable spike: seed the recommender with the 13 metaharness verticals (devops, support, legal, etc.) + ruflo itself. Test on 5 real OSS repos. Compare to a human's recommendation.

3.3 — Fleet-Wide Architecture Drift Detection (ADR-154)

What: For organizations running multiple harnesses, track per-harness genome over time and alert when any one drifts beyond a threshold from its template lineage. Lift iter-15's audit-trend from single-harness drift to fleet-wide drift.

Who it serves: Enterprise-scale users with 5+ harnesses where each was originally forked from a template and is now diverging individually.

Builds on: iter-7's oia-audit worker (already accumulates timestamped records per harness) + iter-15's audit-trend (already diffs two records) + the recommender's similarity score (3.1).

Riskiest assumption: that drift is bad. Sometimes drift is healthy specialization. Mitigation: surface drift as informational unless it crosses BOTH a structural-distance threshold AND a regression in threat-model worst — coupling fights false positives.

Smallest demonstrable spike: the existing audit-trend already does this for one harness; extend the JSON shape to accept a list of harness keys.

3.4 — Cross-Harness Capability Graph (ADR-155)

What: Given a fleet of harnesses, emit a graph where nodes are capabilities (skills, MCP tools, agent roles) and edges are "X harness includes capability Y". Lets ops answer "which harness has the closest capability set to this new task?" without leaving the registry.

Who it serves: Multi-harness orgs deciding where new work belongs.

Builds on: harness compare <a> <b> (already exists upstream — manifest diff + per-file fingerprint) + the iter-6 plugin-registry harness entries + 3.1 similarity for ranked traversal.

Riskiest assumption: that capability lists are stable and orthogonal. They aren't — overlap and aliasing are the norm. Mitigation: cluster capabilities by behavioral fingerprint (use embeddings on the SKILL.md descriptions), not by name.

Smallest demonstrable spike: walk npx ruflo plugins list --type harness --format json (works post-iter-6) and dump nodes+edges to a flat JSON. Visualize separately.

3.5 — Plugin Compatibility Analysis (ADR-156)

What: Given a plugins/X/ and a target harness, predict whether the plugin's allowed-tools requirements are satisfied by the harness's MCP server declarations + agent roles. Return verdict: {compatible: bool, missingTools: [...], policyConflicts: [...]}.

Who it serves: Plugin authors checking distribution targets; harness maintainers vetting incoming plugin proposals.

Builds on: the iter-87 SKILL.md frontmatter audit (already enforces allowed-tools is non-empty) + iter-30's mcp-policy schema (already declares what's allowed/denied) + 3.1 similarity (for "closest compatible harness if this one fails").

Riskiest assumption: that static allowed-tools declarations are reliable. Plugins sometimes use tools they didn't declare. Mitigation: cross-check declarations against actual MCP-tool-call audit logs (the iter-7 oia-audit records include MCP usage in its threat-model output).

Smallest demonstrable spike: read plugins/X/skills/*/SKILL.md::allowed-tools, intersect with target harness's .claude/settings.json::mcpServers, return the set difference.

Architectural Inheritance from ADR-150

Every Phase-3 sub-ADR MUST satisfy the four load-bearing constraints from ADR-150, repeated here for explicit inheritance:

  1. Removablenpm ls --without @metaharness/* must still produce a working CLI. Phase-3 capabilities may NOT introduce a static @metaharness/* import on the boot path. The single allowed exception remains v3/@claude-flow/cli/src/ruvector/neural-router.ts (dynamic import, triple-gated).

  2. Optional in package.json — every @metaharness/* package goes in optionalDependencies or peerDependencies (optional), never dependencies. Static-grep enforced by no-metaharness-smoke.yml.

  3. Graceful degradation — every Phase-3 code path catches MODULE_NOT_FOUND and emits a structured degraded payload. The reference implementation is _harness.mjs::emitDegradedJsonAndExit (iter 1, fixed iter 27).

  4. CI gate on the absent path — at least one CI job runs without any @metaharness/* installed and asserts the system continues to function. no-metaharness-smoke.yml already does this; Phase-3 work extends its drill list.

A sub-ADR that breaks any of these is a breaking change that requires its own meta-ADR superseding ADR-150's constraint clause.

Consequences

Positive

  • Establishes a build-on dependency order for the five Phase-3 capabilities, so implementation can start on 3.1 immediately and the others can be planned in parallel without coordination overhead.
  • Phase-3 work is scope-only — no code lands until each sub-ADR is decided. Avoids the trap of letting the architecture grow ahead of the use case.
  • Inheritance from ADR-150's four constraints means Phase-3 capabilities can NEVER become a hard runtime dependency, no matter how useful they get. The boundary is permanent.
  • Every Phase-3 capability builds on already-shipped instrumentation (genome, score, threat-model, mcp-scan, oia-audit, audit-trend, plugin-registry harness entries). No new measurement layer required — the existing ones are sufficient signal.

Negative / risks

  • Scope creep: a parent ADR for five capabilities risks the trap of "well, since we're planning all this, let's just build it." Mitigation: this ADR is explicitly scope-only; no code lands without a sub-ADR.
  • Capability overlap: 3.1 (similarity) is used by 3.2, 3.3, and 3.5 — making 3.1 a critical path. Mitigation: ship 3.1 first as a standalone; only THEN attempt to layer on the consumers.
  • Recommender confidence inflation: a recommendation engine that says "I'm 99% sure this template fits" when the actual signal is noisy is worse than no recommender. Mitigation per 3.2: weight repo-genome evidence over user-description.

Neutral

  • The Harness Intelligence Layer doesn't change ruflo's runtime behavior. It's all about helping humans + agents make better choices about WHICH harness to use, BEFORE the harness runs. Strictly additive to the existing flow.

Open Questions (for sub-ADR authors)

  • Should Phase-3 capabilities live in plugins/ruflo-metaharness/ or a new plugins/ruflo-harness-intelligence/ plugin? Lean toward the latter — clean separation of "wrap upstream metaharness" (existing) from "compute similarity/recommendation atop it" (new).
  • Should the recommendation engine (3.2) be invocable as an MCP tool, so Claude Code agents can call it during conversation? Strong yes — that's the deepest integration.
  • Should fleet drift (3.3) be a paid/enterprise feature? Lean no — drift detection is a defensive capability and gating it behind a paywall hurts adoption of the underlying observability.
  • Should the capability graph (3.4) export to standard graph formats (DOT, GraphML, Mermaid) or stay in JSON only? Probably JSON + a thin renderer skill; visualizers are a separate tool category.

References