Files
ruflo/plugins/ruflo-intelligence/scripts/smoke.sh
T
ReuvenandRuFlo 78e5658dfd feat(ruflo-intelligence): v0.3.0 — surface completeness, 4-step pipeline, IPFS transfer, namespace coordination
Implements ADR-0001 for ruflo-intelligence. Plugin previously documented
~14 of 29 intelligence-related MCP tools and never operationalized the
4-step pipeline (RETRIEVE → JUDGE → DISTILL → CONSOLIDATE) that CLAUDE.md
treats as the V3 framing. IPFS-based cross-project pattern transfer
(hooks_transfer) was completely invisible despite being a real
differentiator.

Verified surface (29 tools across 5 families):
- 6 neural_* (incl. neural_compress, previously undocumented)
- 10 hooks_intelligence_*-family (incl. _attention, _learn, _stats,
  -reset — all previously undocumented)
- 6 routing/meta hooks (hooks_route, hooks_explain, hooks_pretrain,
  hooks_build-agents, hooks_metrics, hooks_transfer — last 5
  previously undocumented)
- 3 hooks_model-* (Tier 1/2/3 routing)
- 4 ruvllm_sona_* + ruvllm_microlora_* (MicroLoRA previously undocumented)

Changes:
- bump 0.1.0 → 0.3.0; new keywords (microlora, ewc, attention, moe,
  pattern-transfer, model-routing, mcp)
- ADR-0001 (Proposed): documents drift, decisions, smoke contract,
  namespace coordination with ruflo-agentdb
- README: full rewrite with tool inventory + 4-step pipeline (each phase
  mapped to specific tool calls) + cross-project IPFS transfer + hook
  integration table + namespace coordination (defers to ruflo-agentdb
  ADR-0001) + EWC++ explanation (no longer phantom feature) + MoE mode
  enumeration + Compatibility section
- intelligence-specialist agent: tool routing matrix (29 entries),
  pipeline responsibility table, namespace contract, MoE mode selection,
  EWC++ in practice, cross-project transfer flow
- /intelligence command: real dashboard (stats + metrics + model-stats
  + neural-status + hooks_explain on --why)
- /neural command: adds neural_compress dispatch
- intelligence-route skill: adds hooks_explain rationale step
- neural-train skill: adds MicroLoRA section, EWC++ via consolidate flag,
  hooks_pretrain + hooks_build-agents bootstrap, hooks_intelligence-reset
  for testing
- NEW intelligence-transfer skill: walks the IPFS workflow end-to-end
  (store / load / from-project), Pinata prerequisite documented
- scripts/smoke.sh: 16 structural checks (3 doc invariants + 13 contract)

Verification:
  bash plugins/ruflo-intelligence/scripts/smoke.sh
  → 16 passed, 0 failed

Coordinates with prior ADRs:
- ruflo-agentdb ADR-0001 §"Namespace convention" — pattern (singular)
  vs patterns (plural) gotcha referenced inline
- ruflo-ruvector ADR-0001 — trajectory hooks land in ruvector substrate
- ruflo-browser ADR-0001 — consumes trajectory hooks for replay

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-04 19:39:44 -04:00

153 lines
5.9 KiB
Bash
Executable File

#!/usr/bin/env bash
# Structural smoke test for ruflo-intelligence v0.3.0.
# Per ADR-0001 §6 Verification: 13 contract checks + 3 doc invariants.
# Offline-safe; no live MCP calls.
set -u
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
REPO_ROOT="$(cd "$ROOT/../.." && 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)); }
# Doc invariants
step "INV1: README has the 4-step intelligence pipeline section"
grep -q "4-step intelligence pipeline" "$ROOT/README.md" \
&& grep -qE "RETRIEVE.+JUDGE.+DISTILL.+CONSOLIDATE" "$ROOT/README.md" \
&& ok || bad "missing pipeline section or 4-step phase enumeration"
step "INV2: intelligence-transfer skill references hooks_transfer"
grep -q "hooks_transfer" "$ROOT/skills/intelligence-transfer/SKILL.md" \
&& ok || bad "intelligence-transfer skill missing hooks_transfer"
step "INV3: README mentions IPFS pattern transfer"
grep -qE "IPFS.+pattern|pattern.+IPFS|Pinata" "$ROOT/README.md" \
&& ok || bad "README missing IPFS / Pinata transfer docs"
# 1. plugin.json bump + new keywords
step "1. plugin.json declares 0.3.0 with new keywords"
v=$(grep -E '"version"[[:space:]]*:' "$ROOT/.claude-plugin/plugin.json" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1)
if [[ "$v" != "0.3.0" ]]; then
bad "expected 0.3.0, got '$v'"
else
miss=""
for k in microlora ewc attention moe pattern-transfer model-routing; do
grep -q "\"$k\"" "$ROOT/.claude-plugin/plugin.json" || miss="$miss $k"
done
[[ -z "$miss" ]] && ok || bad "missing keywords:$miss"
fi
# 2. README sections present
step "2. README has all required sections (inventory, pipeline, IPFS, hook integration, namespace, EWC++, MoE)"
F="$ROOT/README.md"
miss=""
grep -q "## Tool inventory" "$F" || miss="$miss inventory"
grep -q "## The 4-step intelligence pipeline" "$F" || miss="$miss pipeline"
grep -q "## Cross-project pattern transfer" "$F" || miss="$miss ipfs"
grep -q "## Hook integration" "$F" || miss="$miss hook-table"
grep -q "## Namespace coordination" "$F" || miss="$miss namespace-coord"
grep -q "## EWC++ consolidation" "$F" || miss="$miss ewc"
grep -q "## MoE" "$F" || miss="$miss moe"
[[ -z "$miss" ]] && ok || bad "missing:$miss"
# 3. All 6 neural_* tools referenced
step "3. all 6 neural_* tools referenced in plugin docs"
miss=""
for t in neural_train neural_predict neural_patterns neural_compress neural_status neural_optimize; do
grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
done
[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
# 4. All 10 hooks_intelligence-family tools referenced
step "4. all 10 hooks_intelligence-family tools referenced"
miss=""
for t in hooks_intelligence hooks_intelligence-reset hooks_intelligence_trajectory-start hooks_intelligence_trajectory-step hooks_intelligence_trajectory-end hooks_intelligence_pattern-store hooks_intelligence_pattern-search hooks_intelligence_stats hooks_intelligence_learn hooks_intelligence_attention; do
grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
done
[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
# 5. All 6 routing/meta hooks referenced
step "5. all 6 routing/meta hooks referenced (route, explain, pretrain, build-agents, metrics, transfer)"
miss=""
for t in hooks_route hooks_explain hooks_pretrain hooks_build-agents hooks_metrics hooks_transfer; do
grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
done
[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
# 6. All 3 hooks_model-* tools referenced
step "6. all 3 hooks_model-* tools referenced"
miss=""
for t in hooks_model-route hooks_model-outcome hooks_model-stats; do
grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
done
[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
# 7. SONA + MicroLoRA tools (4) referenced
step "7. all 4 SONA + MicroLoRA tools referenced"
miss=""
for t in ruvllm_sona_create ruvllm_sona_adapt ruvllm_microlora_create ruvllm_microlora_adapt; do
grep -rq "$t" "$ROOT" --include='*.md' || miss="$miss $t"
done
[[ -z "$miss" ]] && ok || bad "undocumented:$miss"
# 8. 4-step pipeline names all four phases
step "8. 4-step pipeline section names all four phases"
F="$ROOT/README.md"
miss=""
for phase in RETRIEVE JUDGE DISTILL CONSOLIDATE; do
grep -q "$phase" "$F" || miss="$miss $phase"
done
[[ -z "$miss" ]] && ok || bad "phases not all named:$miss"
# 9. intelligence-transfer skill exists with proper allowed-tools
step "9. intelligence-transfer skill exists with allowed-tools enumerated"
F="$ROOT/skills/intelligence-transfer/SKILL.md"
if [[ -f "$F" ]] \
&& grep -qE "^allowed-tools:" "$F" \
&& grep -q "hooks_transfer" "$F"; then
ok
else
bad "intelligence-transfer skill missing or incomplete"
fi
# 10. Pluralization gotcha referenced (defers to ruflo-agentdb)
step "10. pluralization gotcha (pattern vs patterns) documented"
F="$ROOT/README.md"
if grep -q '`pattern`' "$F" \
&& grep -q '`patterns`' "$F" \
&& grep -qiE "pluraliz|distinct namespace" "$F"; then
ok
else
bad "pluralization gotcha not surfaced (must contrast pattern vs patterns)"
fi
# 11. No skill grants wildcard tool access
step "11. no skill grants wildcard tool access"
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"
# 12. ADR exists, status Proposed
step "12. ADR-0001 exists with status Proposed"
ADR="$ROOT/docs/adrs/0001-intelligence-surface-completeness.md"
if [[ -f "$ADR" ]] && grep -qE "^status:[[:space:]]*Proposed" "$ADR"; then
ok
else
bad "ADR missing or status != Proposed"
fi
# 13. Compatibility section pins to v3.6
step "13. Compatibility section pins @claude-flow/cli to v3.6"
if grep -qE "@claude-flow/cli.*v3\.6|v3\.6.*claude-flow/cli" "$ROOT/README.md"; then
ok
else
bad "Compatibility pin to v3.6 missing"
fi
printf "\n%s passed, %s failed\n" "$PASS" "$FAIL"
[[ $FAIL -eq 0 ]] || exit 1