Ruflo × MetaHarness Integration: OIA-Layered Walkthrough (ADR-150 implementation across 28 /loop iterations) Ruflo and MetaHarness have integrated an OIA-layered walkthrough across 28 iterations, implementing ADR-150 to improve AI-agent platform routing. The new learned router uses k-NN, kernel ridge regression, and FastGRNN to select the cheapest model meeting a quality bar, with parallel decision logging and a conservative promotion gate requiring >2% quality improvement, <1% cost increase, and <5% p95 latency increase. The OIA manifest reports layer statuses from full to not-applicable, with the router enhancing L3 Models and L5 Agent Orchestration. Plain-language guide to what we built across 28 iterations of /loop work. Companion to ADR-150 · Tracking issue 2399 · Upstream bug 9 OIA = Open Infrastructure Architecture. It's a 9-layer mental model for what makes an AI-agent platform work. Like the OSI model for networking, but for agent harnesses. Each layer answers one question: | Layer | The question it answers | |---|---| | L1 — Physical Compute | Where does the work physically run? | | L2 — Data and Storage | Where do memories and artifacts live? | | L3 — Models | Which language models are available? | | L4 — Tools and Integrations | What can agents reach out and touch? | | L5 — Agent Orchestration | How do agents coordinate? | | L6 — Workflow and Automation | What runs automatically without a human? | | L7 — Governance and Policy | What's allowed, and what's blocked? | | L8 — Observability and Audit | What can we see after the fact? | | L9 — Human and Browser Interface | How do humans and other systems interact? | Plus six "horizontal spans" that cut across every layer: security, observability, identity, governance, policy enforcement, interoperability. The metaharness CLI emits an OIA manifest for any repo: harness oia-manifest . reports each layer as full , partial , none , or not-applicable . That's the standard we'll measure against. L1 Physical Compute not-applicable cloud-agnostic; runs anywhere Node 20+ does L2 Data and Storage partial AgentDB + HNSW vectors + memory namespaces L3 Models FULL haiku/sonnet/opus + OpenRouter alts + KRR routing L4 Tools and Integrations partial 314 MCP tools registered, MCP policy missing L5 Agent Orchestration FULL 16 agent roles, swarm + hive-mind + claims L6 Workflow and Automation partial 17 hooks + 12 background workers + cron L7 Governance and Policy partial mcp-policy.json declared, witness missing L8 Observability and Audit partial cost-tracker stack, audit log not enabled L9 Human and Browser UI partial CLI mature, no dashboard yet That's the WHOLE-RUFLO picture. The ADR-150 work shipped this iteration improves several layers — let's walk through which ones. Ruflo already had a rule-based 3-tier router haiku for simple, sonnet for medium, opus for hard . ADR-148/149 wanted a learned router that picks the cheapest model that still meets a quality bar. The implementation has three parts: - The router itself — @metaharness/router is an external library that does k-NN over a seed corpus, KRR kernel ridge regression with cross-validated lambda, and optional native FastGRNN. Ruflo loads it lazily behind a triple gate env flag + artifact + import success . When it's available, the routing decision carries routedBy: 'metaharness-knn' | 'metaharness-krr' | 'fastgrnn' . - Parallel decision logging iters 10–12 . Every time the bandit Thompson sampling picks a model, the SelfEvolvingRouter a competing arm also picks one. Both picks + the actual outcome go to .swarm/router-parallel.jsonl . Only writes when CLAUDE FLOW ROUTER PARALLEL LOG=1 . Default-path overhead measured at 147ns per route call — imperceptible. - Promotion gate iter 10 . An analyzer reads the JSONL and decides whether to promote SER over the bandit. The gate is conservative on purpose — three criteria, all must pass: quality improvement 2% AND cost increase < 1% AND p95 latency increase < 5% The AND matters: a quality gain that comes with a cost regression doesn't count. This came from review-round-1 of the ADR; the original draft had OR , which could have hidden cost regressions behind quality wins. Why it matters: routing is the most cost-sensitive decision the platform makes. A bad router quietly burns money for a long time before anyone notices. A learned router that's measurably better — not just believed to be — is real money. ADR-150's static-analysis surface is now reachable from Claude Code agents as first-class MCP tools: mcp claude-flow metaharness score "How harness-ready is this repo?" mcp claude-flow metaharness genome "What kind of repo is this, structurally?" mcp claude-flow metaharness mcp scan "Any MCP-config security issues?" mcp claude-flow metaharness threat model "Worst threat in our agent surface?" mcp claude-flow metaharness oia audit "Snapshot all of the above to memory" mcp claude-flow metaharness audit list "What audits exist?" mcp claude-flow metaharness audit trend "Has anything gotten worse since last audit?" These didn't exist before iter 20. Now an agent can ask "should this repo become a custom harness?" and get a quantitative answer from inside its normal tool-use loop — no shell-out to a separate CLI required. Verification depth: the iter-23 runtime test invokes every handler with minimal input and asserts each returns {success, data, degraded, exitCode} without throwing. 65 assertions across 7 tools. CI runs this on every PR via metaharness-ci.yml . The npx ruflo eject command is the most user-visible new capability. It takes the calling ruflo project and lifts it into a renamed standalone harness. The metaharness CLI does the heavy lifting metaharness --from-existing , ruflo provides safety gates: Dry-run by default. Just shows the plan. No --confirm , no writes. Refuses to write to the calling repo. Default target is /tmp/ruflo-eject-