mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-09-14 14:01:28 +08:00
6e1bdc211e
The plugin's docs had drifted from the real ruvector CLI: many documented invocations (`embed "TEXT"`, `compare`, `cluster --namespace`, `hooks route --task`, `brain agi status`, `midstream status`, `index create/stats`, `embed --model poincare`) failed with "unknown command" or "unknown option" on the installed ruvector. Probed every subcommand against ruvector@0.2.25 and rewrote the plugin to match reality. Changes: - Pin every `npx ruvector` call to `npx -y ruvector@0.2.25` across README, agent, skills, and commands - Rewrite commands/vector.md with 80+ verified subcommands (embed, db lifecycle, RVF cognitive containers, GNN, attention mechanisms, hooks, native/workers, brain, SONA, LLM, identity, edge, server, decompile, demo) - Add vector-setup skill that installs onnx-embeddings-wasm + pi-brain + ruvllm and registers the MCP server with the pinned version - Add scripts/smoke.sh — 11-check contract test (version pin, top-level surface, positional-arg invariants, removed-surface-stays-removed) - Replace stale "Search Capabilities (v2.1+)" table claiming FlashAttention-3 / Graph RAG / DiskANN / ColBERT / Matryoshka / MLA / TurboQuant as CLI features with an "Attention Mechanisms" table mapped to real `attention compute|benchmark|hyperbolic` invocations - Document known 0.2.25 bugs: `optimize` not yet shipped, `hooks force-learn` TypeError, `hooks graph-mincut` undefined.length, `benchmark` dimension bug, top-level `cluster` "Coming Soon" - Add ADR-0001 documenting the pin policy, optional add-on packages, MCP registration, removed-surface contract, and smoke-test gate - Bump plugin version 0.2.0 → 0.2.1 Smoke: 11/11 passing against ruvector@0.2.25. Co-Authored-By: RuFlo <ruv@ruv.net>
77 lines
2.8 KiB
Bash
Executable File
77 lines
2.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Smoke test for ruflo-ruvector plugin against ruvector@0.2.25.
|
|
# Exits non-zero if any contracted CLI surface is missing or behaves
|
|
# differently from documented. Run after `npm install ruvector@0.2.25`
|
|
# (or rely on the npx fetch).
|
|
set -u
|
|
PIN="ruvector@0.2.25"
|
|
PASS=0
|
|
FAIL=0
|
|
WORKDIR="$(mktemp -d -t ruvector-smoke.XXXXXX)"
|
|
trap 'rm -rf "$WORKDIR"' EXIT
|
|
cd "$WORKDIR" || exit 2
|
|
|
|
step() { printf "→ %s ... " "$1"; }
|
|
ok() { printf "PASS\n"; PASS=$((PASS+1)); }
|
|
bad() { printf "FAIL: %s\n" "$1"; FAIL=$((FAIL+1)); }
|
|
|
|
run() { npx -y "$PIN" "$@" 2>&1; }
|
|
|
|
step "version pin"
|
|
# --version output may include npm warnings; take the last non-empty line.
|
|
ver=$(run --version | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | tail -1)
|
|
[[ "$ver" == "0.2.25" ]] && ok || bad "expected 0.2.25, got '$ver'"
|
|
|
|
step "top-level help mentions hooks/embed/rvf/attention/gnn/brain/sona"
|
|
help=$(run --help)
|
|
missing=""
|
|
for c in hooks embed rvf attention gnn brain sona create stats search insert; do
|
|
grep -qE "^[[:space:]]+$c( |\$)" <<<"$help" || missing="$missing $c"
|
|
done
|
|
[[ -z "$missing" ]] && ok || bad "missing:$missing"
|
|
|
|
step "hooks route is positional"
|
|
out=$(run hooks route "test task")
|
|
grep -q '"recommended"' <<<"$out" && ok || bad "no JSON 'recommended' field — got: $out"
|
|
|
|
step "hooks ast-analyze on a sample TS file"
|
|
echo 'export const x = 1;' > sample.ts
|
|
out=$(run hooks ast-analyze sample.ts)
|
|
grep -q "AST Analysis" <<<"$out" && ok || bad "ast-analyze did not return summary"
|
|
|
|
step "hooks ast-complexity returns JSON"
|
|
out=$(run hooks ast-complexity sample.ts)
|
|
grep -q '"cyclomatic"' <<<"$out" && ok || bad "ast-complexity output unexpected"
|
|
|
|
step "attention list shows mechanisms"
|
|
out=$(run attention list)
|
|
grep -q "FlashAttention" <<<"$out" && ok || bad "attention list missing FlashAttention"
|
|
|
|
step "rvf examples lists at least 10 stores"
|
|
out=$(run rvf examples)
|
|
n=$(grep -cE '^\s+[a-z_]+\s+[0-9]' <<<"$out")
|
|
[[ $n -ge 10 ]] && ok || bad "expected ≥10 RVF examples, got $n"
|
|
|
|
step "gnn info reports Available"
|
|
out=$(run gnn info)
|
|
grep -q "Status:.*Available" <<<"$out" && ok || bad "gnn info did not report Available"
|
|
|
|
step "info reports CLI Version 0.2.25"
|
|
out=$(run info)
|
|
grep -q "CLI Version: 0.2.25" <<<"$out" && ok || bad "info did not report 0.2.25"
|
|
|
|
step "doctor exits 0"
|
|
run doctor >/dev/null && ok || bad "doctor returned non-zero"
|
|
|
|
step "removed surface stays removed (compare/midstream/index)"
|
|
fail_removed=""
|
|
for c in compare midstream index; do
|
|
# Don't pass --help — Commander will show top-level help instead of the error.
|
|
out=$(npx -y "$PIN" "$c" 2>&1)
|
|
grep -q "unknown command '$c'" <<<"$out" || fail_removed="$fail_removed $c"
|
|
done
|
|
[[ -z "$fail_removed" ]] && ok || bad "still present:$fail_removed"
|
|
|
|
printf "\n%s passed, %s failed\n" "$PASS" "$FAIL"
|
|
[[ $FAIL -eq 0 ]] || exit 1
|