Files
ruflo/plugins/ruflo-core
rUv 8008bc3562 fix(federation): verified event identity must win over publisher-controlled content (#3322)
* fix(federation): verified event identity must win over publisher-controlled content

fetchRecent/fetchManyOn/fetchChannel spread the parsed message content
after the signature-verified id/pubkey/created_at, so a publisher could
put those keys in their own content and overwrite their verified
identity downstream (reduceClaims trusts .pubkey for claim
release/handoff authorization). Reorder so verified fields always win.

Also in x-federation-channels.ts: reqEvents() never called verifyEvent()
at all, so channel-read/grant-accept events were trusted unsigned; add
the check. Same content-override reorder in x_federation_channel_read.

fix(hooks): escape argv for the Windows shell:true npm-shim path

ruflo-hook.cjs's invokeHook() passes hook-derived values (command text,
file paths) through cmd.exe via shell:true to resolve npm's .cmd/.ps1
shims. Node does no escaping in that mode, so a value containing a
cmd.exe metacharacter could be reinterpreted as a separate command or
redirection instead of reaching the CLI as data. Add escapeCmdArg()
(qntm.org/cmd algorithm, same one cross-spawn uses) and apply it to
every argv element on that path.

No native Windows/cmd.exe available to execute this end-to-end in this
environment — verified at the string-transform level only (8 unit
tests). Real Windows execution remains a required follow-up gate.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01RYP825phHMjPRmmjkcAWpq

* fix(ci): register new hook test env var and test file with CI guards

Follow-up to the previous commit's escape-cmd-arg.test.cjs:
- Register RUFLO_HOOK_UNIT_TEST in audit-env-var-precedence.mjs's
  KNOWN_ESCAPE_HATCHES, matching the existing RUFLO_HOOK_CLI_OVERRIDE/
  RUFLO_HOOK_DEBUG_STDOUT entries for the same file.
- Register plugins/ruflo-core/scripts/escape-cmd-arg.test.cjs in
  ci-test-baseline.txt, matching the sibling mcp-launch.test.cjs entry —
  both are node:test-based .cjs files that vitest's own JSON reporter
  marks "failed" (it doesn't recognize the node:test API) even though
  every test inside genuinely passes under `node --test`.

Verified locally: node scripts/audit-env-var-precedence.mjs now passes
(exit 0). A scoped `vitest run` + `ci-test-ratchet.mjs --report` against
just these two files confirms escape-cmd-arg.test.cjs is no longer an
unexpected failure (the one remaining flagged file is a stale local
worktree artifact under .claude/worktrees/, not part of a clean CI
checkout).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01RYP825phHMjPRmmjkcAWpq
2026-09-14 17:12:05 +00:00
..

ruflo-core

Foundation plugin. Registers the ruflo MCP server (314 tools), provides three generalist agents (coder, researcher, reviewer), three first-run helpers (init-project, ruflo-doctor, discover-plugins), and a curated catalog covering all 32 sibling plugins.

Install

/plugin marketplace add ruvnet/ruflo
/plugin install ruflo-core@ruflo

What's Included

  • MCP Server: 314 tools via @claude-flow/cli (memory, agentdb, embeddings, hooks, neural, autopilot, browser, aidefence, agent, swarm, system, terminal, github, daa, coordination, performance, workflow, …)
  • CLI Commands: 26 commands with 140+ subcommands for agent orchestration
  • 3-Tier Model Routing: Agent Booster (WASM), Haiku, Sonnet/Opus with automatic cost optimization
  • Session Management: Persistent sessions with cross-conversation learning
  • Hooks: PreToolUse / PostToolUse / PreCompact / Stop wired to claude-flow's auto-routing + learning loop. Defined at plugins/ruflo-core/hooks/hooks.json so the per-plugin loader picks them up on /plugin install ruflo-core@ruflo (per-plugin layout — fixes #1748 Issue 1; the marketplace-root copy at .claude-plugin/hooks/hooks.json is preserved for claude --plugin-dir <repo-root> users).

Configuration

The MCP server starts automatically when this plugin is active. Override environment variables in .mcp.json as needed.

Compatibility

  • CLI: pinned to @claude-flow/cli v3.6 major+minor. The .mcp.json invocation uses @latest for dynamic resolution; the smoke contract verifies the resolved CLI matches the v3.6 line.
  • Verification: bash plugins/ruflo-core/scripts/smoke.sh is the contract.

MCP server contract

The registered ruflo MCP server exposes 314 tools across these families. Runtime truth is mcp tool call mcp_status:

Family Notable tools Plugin documenting it
memory_* memory_store, _search, _search_unified, _import_claude, _bridge_status ruflo-rag-memory
agentdb_* 15 tools for hierarchical / pattern / causal storage ruflo-agentdb
embeddings_* 10 tools incl. RaBitQ 32× quantization ruflo-agentdb, ruflo-ruvector
hooks_* (incl. hooks_intelligence_*) 19+ tools — routing, learning, transfer, metrics, explain ruflo-intelligence, ruflo-autopilot
aidefence_* 6 tools — PII / prompt-injection / sanitization ruflo-aidefence
neural_* 6 tools — train, predict, patterns, compress ruflo-intelligence
autopilot_* 10 tools — autonomous loops + learning ruflo-autopilot
browser_* (+ new browser_session_*) 23 + 5 = 28 tools — Playwright + RVF lifecycle ruflo-browser
ruvllm_sona_* / ruvllm_microlora_* 4 tools — adaptive learning ruflo-intelligence, ruflo-ruvllm
agent_*, swarm_* spawn, list, status, orchestrate ruflo-swarm
system_*, terminal_* system + terminal session ops this plugin

For every other plugin's tool surface, see its docs/adrs/0001-*.md.

Sibling contracts

This foundation plugin defers to seven sibling ADRs that own specific cross-cutting contracts. New plugins (and consumers of ruflo-core) should reference these instead of re-deriving:

Contract Owner
Pinning + smoke as contract (general pattern) ruflo-ruvector ADR-0001
Namespace convention (<plugin-stem>-<intent>, reserved namespaces) ruflo-agentdb ADR-0001
Session-as-skill architecture (RVF + trajectory + 3 AIDefence gates) ruflo-browser ADR-0001
4-step intelligence pipeline (RETRIEVE → JUDGE → DISTILL → CONSOLIDATE) ruflo-intelligence ADR-0001
3-gate AIDefence pattern (PII pre-storage, sanitization, prompt-injection) ruflo-aidefence ADR-0001
270s cache-aware /loop heartbeat ruflo-autopilot ADR-0001
ADR plugin contract (token-optimization via REFERENCE.md) ruflo-adr ADR-0001

Verification

bash plugins/ruflo-core/scripts/smoke.sh
# Expected: "10 passed, 0 failed"

Architecture Decisions