Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(ruflo-wasm): v0.2.0 β€” adopt plugin contract + ADR-070 integration cross-reference (ADR-0001)

Reuven81ec1af409f9
diff --git a/plugins/ruflo-wasm/.claude-plugin/plugin.json b/plugins/ruflo-wasm/.claude-plugin/plugin.json
index c6c7445e6c..cc617b4f4a 100644
--- a/plugins/ruflo-wasm/.claude-plugin/plugin.json
+++ b/plugins/ruflo-wasm/.claude-plugin/plugin.json
@@ -1,7 +1,7 @@
{
"name": "ruflo-wasm",
- "description": "Sandboxed WASM agent creation, execution, and gallery sharing",
- "version": "0.1.0",
+ "description": "Sandboxed WASM agent creation, execution, and gallery sharing β€” wraps 10 wasm_* MCP tools (agent_create/prompt/tool/list/terminate/files/export + gallery_list/search/create); built on @ruvector/rvagent-wasm + @ruvector/ruvllm-wasm per ADR-070 (Implemented)",
+ "version": "0.2.0",
"author": {
"name": "ruvnet",
"url": "https://github.com/ruvnet"
@@ -13,6 +13,9 @@
"wasm",
"sandbox",
"agents",
- "gallery"
+ "gallery",
+ "mcp",
+ "rvagent-wasm",
+ "ruvllm-wasm"
]
}
diff --git a/plugins/ruflo-wasm/README.md b/plugins/ruflo-wasm/README.md
index f78a4d1c96..86dccc484e 100644
--- a/plugins/ruflo-wasm/README.md
+++ b/plugins/ruflo-wasm/README.md
@@ -24,3 +24,62 @@ Sandboxed WASM agent creation, execution, and gallery sharing.
- `wasm-agent` -- Create and manage sandboxed WASM agents
- `wasm-gallery` -- Browse and publish agents in the community gallery
+
+## Compatibility
+
+- **CLI:** pinned to `@claude-flow/cli` v3.6 major+minor.
+- **WASM runtime:** built on `@ruvector/rvagent-wasm` + `@ruvector/ruvllm-wasm`. Both are declared in `@claude-flow/cli`'s `optionalDependencies` per [ADR-070 (Implemented)](../../v3/implementation/adrs/ADR-070-rvagent-wasm-completion.md). Without those packages, runtime falls through to the graceful-degradation path and the MCP tools no-op.
+- **Verification:** `bash plugins/ruflo-wasm/scripts/smoke.sh` is the contract.
+
+## MCP surface (10 tools)
+
+All defined at `v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts`:
+
+### Agent lifecycle (7)
+
+| Tool | Purpose |
+|------|---------|
+| `wasm_agent_create` | Spin up a sandboxed WASM agent |
+| `wasm_agent_prompt` | Send a prompt to the agent |
+| `wasm_agent_tool` | Invoke a tool inside the sandbox |
+| `wasm_agent_list` | List active WASM agents |
+| `wasm_agent_terminate` | Stop a WASM agent |
+| `wasm_agent_files` | Read/write files in the sandbox |
+| `wasm_agent_export` | Export agent state |
+
+### Gallery (3)
+
+| Tool | Purpose |
+|------|---------|
+| `wasm_gallery_list` | Browse community-published WASM agents |
+| `wasm_gallery_search` | Search the gallery |
+| `wasm_gallery_create` | Publish a WASM agent to the gallery |
+
+## Sandbox isolation
+
+WASM agents run with **no host filesystem access** by default. The `wasm_agent_files` tool exposes a sandboxed virtual filesystem; the host filesystem is not reachable from inside the WASM module.
+
+For prompt-injection defense inside the sandbox, the [ruflo-aidefence 3-gate pattern](../ruflo-aidefence/docs/adrs/0001-aidefence-contract.md) applies to any output flowing back to the host LLM.
+
+## Namespace coordination
+
+This plugin owns the `wasm-gallery` AgentDB namespace (kebab-case, follows the convention from [ruflo-agentdb ADR-0001 Β§"Namespace convention"](../ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md)). Reserved namespaces (`pattern`, `claude-memories`, `default`) MUST NOT be shadowed.
+
+`wasm-gallery` indexes published WASM agents (manifest, version, signature, download count). Accessed via `memory_*` (namespace-routed).
+
+## Verification
+
+```bash
+bash plugins/ruflo-wasm/scripts/smoke.sh
+# Expected: "11 passed, 0 failed"
+```
+
+## Architecture Decisions
+
+- [`ADR-0001` β€” ruflo-wasm plugin contract (10-tool MCP surface, ADR-070 integration cross-reference, sandbox isolation, smoke as contract)](./docs/adrs/0001-wasm-contract.md)
+
+## Related Plugins
+
+- `ruflo-agentdb` β€” namespace convention owner
+- `ruflo-aidefence` β€” 3-gate pattern applies to sandbox output flowing back to the host LLM
+- `ruflo-ruvector` β€” the underlying ruvector substrate that ships @ruvector/rvagent-wasm
diff --git a/plugins/ruflo-wasm/docs/adrs/0001-wasm-contract.md b/plugins/ruflo-wasm/docs/adrs/0001-wasm-contract.md
new file mode 100644
index 0000000000..af20a72cc9
--- /dev/null
+++ b/plugins/ruflo-wasm/docs/adrs/0001-wasm-contract.md
@@ -0,0 +1,59 @@
+---
+id: ADR-0001
+title: ruflo-wasm plugin contract β€” pinning, namespace coordination, ADR-070 integration cross-reference, smoke as contract
+status: Proposed
+date: 2026-05-04
+authors:
+ - reviewer (Claude Code)
+tags: [plugin, wasm, sandbox, gallery, namespace, smoke-test]
+---
+
+## Context
+
+`ruflo-wasm` (v0.1.0) β€” sandboxed WASM agent creation, execution, and gallery sharing. 1 agent (`wasm-specialist`), 2 skills (`wasm-agent`, `wasm-gallery`), 1 command (`/wasm`).
+
+Wraps **10 `wasm_*` MCP tools** at `v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts:18, 51, 74, 103, 117, 138, 160, 181, 195, 216`:
+
+| Tool | Purpose |
+|------|---------|
+| `wasm_agent_create` | Spin up a sandboxed WASM agent |
+| `wasm_agent_prompt` | Send a prompt to the agent |
+| `wasm_agent_tool` | Invoke a tool inside the sandbox |
+| `wasm_agent_list` | List active WASM agents |
+| `wasm_agent_terminate` | Stop a WASM agent |
+| `wasm_agent_files` | Read/write files in the sandbox |
+| `wasm_agent_export` | Export agent state |
+| `wasm_gallery_list` | Browse community-published WASM agents |
+| `wasm_gallery_search` | Search the gallery |
+| `wasm_gallery_create` | Publish a WASM agent to the gallery |
+
+### Upstream ADR-070 cross-reference
+
+[ADR-070 (Implemented)](../../../v3/implementation/adrs/ADR-070-rvagent-wasm-completion.md) closed the gap on `@ruvector/rvagent-wasm` + `@ruvector/ruvllm-wasm` integration. Per ADR-070, both packages are now declared in `package.json` `optionalDependencies` so `npm install` fetches them. Without ADR-070's fix, the runtime would always hit the graceful-degradation path and these MCP tools would no-op.
+
+## Decision
+
+1. Add this ADR (Proposed).
+2. README augment: Compatibility (pin v3.6 + ADR-070 implementation status); 10-tool MCP surface table; Namespace coordination (claims `wasm-gallery`); Verification + Architecture Decisions sections.
+3. Bump `0.1.0 β†’ 0.2.0`. Keywords add `mcp`, `rvagent-wasm`, `ruvllm-wasm`.
+4. `scripts/smoke.sh` β€” 11 structural checks: version + keywords; both skills + agent + command with valid frontmatter; all 10 `wasm_*` tools referenced; v3.6 pin; namespace coordination; ADR-070 cross-reference; sandbox isolation documented; ADR Proposed; no wildcard tools.
+
+## Consequences
+
+**Positive:** plugin joins the cadence. The ADR-070 integration dependency is now contractually documented β€” readers know that `@ruvector/rvagent-wasm` + `@ruvector/ruvllm-wasm` must be installed (via npm install since ADR-070) for these tools to be functional.
+
+**Negative:** none material.
+
+## Verification
+
+```bash
+bash plugins/ruflo-wasm/scripts/smoke.sh
+# Expected: "11 passed, 0 failed"
+```
+
+## Related
+
+- `v3/implementation/adrs/ADR-070-rvagent-wasm-completion.md` β€” upstream integration completion (Implemented)
+- `plugins/ruflo-agentdb/docs/adrs/0001-agentdb-optimization.md` β€” namespace convention
+- `plugins/ruflo-aidefence/docs/adrs/0001-aidefence-contract.md` β€” 3-gate pattern (relevant for sandboxed prompt-injection defense)
+- `v3/@claude-flow/cli/src/mcp-tools/wasm-agent-tools.ts` β€” 10 `wasm_*` tools
diff --git a/plugins/ruflo-wasm/scripts/smoke.sh b/plugins/ruflo-wasm/scripts/smoke.sh
new file mode 100755
index 0000000000..a7fdef1309
--- /dev/null
+++ b/plugins/ruflo-wasm/scripts/smoke.sh
@@ -0,0 +1,87 @@
+#!/usr/bin/env bash
+set -u
+ROOT="$(cd "$(dirname "$0")/.." && pwd)"
+PASS=0
+FAIL=0
+step() { printf "β†’ %s ... " "$1"; }
+ok() { printf "PASS\n"; PASS=$((PASS+1)); }
+bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
+
+step "1. plugin.json declares 0.2.0 with new keywords"
+v=$(grep -E '"version"' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
+if [[ "$v" != "0.2.0" ]]; then bad "expected 0.2.0, got '$v'"; else
+ miss=""
+ for k in mcp rvagent-wasm ruvllm-wasm; do
+ grep -q "\"$k\"" "$ROOT/.claude-plugin/plugin.json" || miss="$miss $k"
+ done
+ [[ -z "$miss" ]] && ok || bad "missing keywords:$miss"
+fi
+
+step "2. both skills + agent + command present with valid frontmatter"
+miss=""
+for s in wasm-agent wasm-gallery; do
+ f="$ROOT/skills/$s/SKILL.md"
+ [[ -f "$f" ]] || { miss="$miss missing-$s"; continue; }
+ for k in 'name:' 'description:'; do
+ grep -q "^$k" "$f" || miss="$miss $s-no-$k"
+ done
+done
+[[ -f "$ROOT/agents/wasm-specialist.md" ]] || miss="$miss missing-agent"
+[[ -f "$ROOT/commands/wasm.md" ]] || miss="$miss missing-command"
+[[ -z "$miss" ]] && ok || bad "$miss"
+
+step "3. all 10 wasm_* MCP tools referenced"
+miss=""
+for t in wasm_agent_create wasm_agent_prompt wasm_agent_tool wasm_agent_list wasm_agent_terminate wasm_agent_files wasm_agent_export wasm_gallery_list wasm_gallery_search wasm_gallery_create; do
+ grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
+done
+[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
+
+step "4. README pins @claude-flow/cli to v3.6"
+grep -qE "@claude-flow/cli.*v3\.6|v3\.6.*claude-flow/cli" "$ROOT/README.md" \
+ && ok || bad "v3.6 pin missing"
+
+step "5. README defers to ruflo-agentdb namespace convention"
+grep -q "ruflo-agentdb" "$ROOT/README.md" \
+ && grep -q "Namespace convention" "$ROOT/README.md" \
+ && ok || bad "namespace coordination block incomplete"
+
+step "6. wasm-gallery namespace claimed"
+grep -q "wasm-gallery" "$ROOT/README.md" \
+ && ok || bad "wasm-gallery namespace not claimed"
+
+step "7. ADR-070 cross-reference present (rvagent-wasm + ruvllm-wasm integration)"
+F="$ROOT/README.md"
+miss=""
+grep -q "ADR-070" "$F" || miss="$miss adr-ref"
+grep -q "rvagent-wasm" "$F" || miss="$miss rvagent-wasm"
+grep -q "ruvllm-wasm" "$F" || miss="$miss ruvllm-wasm"
+grep -qE "optionalDependencies|graceful-degradation" "$F" || miss="$miss integration-detail"
+[[ -z "$miss" ]] && ok || bad "$miss"
+
+step "8. sandbox isolation documented"
+F="$ROOT/README.md"
+grep -q "Sandbox isolation\|sandbox isolation" "$F" \
+ && grep -qE "no host filesystem|virtual filesystem" "$F" \
+ && ok || bad "sandbox isolation guarantee not documented"
+
+step "9. AIDefence 3-gate cross-reference (sandbox β†’ host LLM defense)"
+F="$ROOT/README.md"
+grep -q "ruflo-aidefence" "$F" \
+ && grep -qE "3-gate|3 gates" "$F" \
+ && ok || bad "AIDefence 3-gate cross-reference missing"
+
+step "10. ADR-0001 exists with status Proposed"
+ADR="$ROOT/docs/adrs/0001-wasm-contract.md"
+[[ -f "$ADR" ]] && grep -qE "^status:[[:space:]]*Proposed" "$ADR" \
+ && ok || bad "ADR missing or status != Proposed"
+
+step "11. no wildcard tool grants in skills"
+bad_skills=""
+for f in "$ROOT"/skills/*/SKILL.md; do
+ grep -q '^allowed-tools:[[:space:]]*\*' "$f" && bad_skills="$bad_skills $(basename $(dirname "$f"))"
+done
+[[ -z "$bad_skills" ]] && ok || bad "wildcard:$bad_skills"
+
+printf "\n%s passed, %s failed\n" "$PASS" "$FAIL"
+[[ $FAIL -eq 0 ]] || exit 1