Commit Graph
9 Commits
Author SHA1 Message Date
ruv 8f4b47af16 fix(security): migration-safe hive-mind gating by caller transport (ADR-476, #3338)
Gate hive-mind init/join/leave/spawn/propose/vote/broadcast/shutdown/
memory set+delete/optimize-memory for remote (HTTP/WebSocket) callers only;
local stdio, ruflo mcp exec, the CLI and in-process callers keep working
with no extra step. hive-mind_init never returns hiveToken. Operator secret
from RUFLO_HIVE_BOOTSTRAP_SECRET or a 0600 bootstrap.secret created by the
first local init. state.json is written 0600 atomically (dir 0700).
Constant-time compare. RUFLO_HIVE_REQUIRE_AUTH=1 for bridged stdio.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-10-07 10:18:44 -04:00
Rudy Celekli bc6d654d22 fix(session): round-trip compressed JSON backups
Signed-off-by: Rudy Celekli <rudy@gradiahq.com>
2026-10-06 13:18:04 -04:00
rUv 7d801171d5 feat(hooks): opt-in @ruvector/typesafe task router (CLAUDE_FLOW_ROUTER_TYPESAFE=1) (#3406)
* feat(hooks): opt-in @ruvector/typesafe task router (CLAUDE_FLOW_ROUTER_TYPESAFE=1)

hooks_route can now ask @ruvector/typesafe (local typed decisions over
sentence embeddings) to pick the agent. Off by default; optional peer;
removable (dynamic import, any load/decide error falls back silently).

- src/ruvector/typesafe-router.ts: adapter. Builds choice options from
  TASK_PATTERNS with not_for hints (tester/reviewer/researcher). Gates:
  abstain <= 0.30, lift (top-1 x options) >= 1.2, top-1 margin >= 0.005,
  all env-tunable. Surfaces routedBy, confidence, abstain, calibrated,
  lift; keeps the built-in pick under fallbackRoute; never copies
  uncalibrated confidence into successProbability.
- hooks-tools.ts: hooks_route handler wrapped; body untouched. With the
  flag unset the legacy result object is returned as-is.
- doctor --component typesafe: install + gate status.
- package.json: @ruvector/typesafe ^0.1.0 as an optional peer.
- USERGUIDE: routing section documents flag, gates, limitations.

Co-Authored-By: RuFlo <ruv@ruv.net>

* chore(lock): record optional peer @ruvector/typesafe in v3 pnpm lockfile

v3 sets autoInstallPeers, so the new optional peer must be recorded in
the cli importer or `pnpm install --frozen-lockfile` fails with
ERR_PNPM_OUTDATED_LOCKFILE (verified: fails without this change, passes
with it).

Minimal: only the @ruvector/typesafe importer + package entries (9 lines).
A full `pnpm install --lockfile-only` would also flip @claude-flow/memory
from the registry build to link:../memory; that changes what CI tests the
CLI against and is left out of this PR deliberately.

Co-Authored-By: RuFlo <ruv@ruv.net>

* fix(doctor): keep 'metaharness)' at the end of the --component help list (smoke 17h anchor)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-09-23 14:57:45 +00:00
rUv 87f4f8ab67 fix(mcp): mcp start -t http exits after false-success table + doc drift from #2985 (#2987)
* fix(migrate,mcp): unresolvable remediation command + false-success HTTP server exit

Two independently-reported, freshly-filed defects:

- #2985: `ruflo migrate status`'s ADR-128 removed-agent remediation
  (shipped today via #2973/ADR-382 Part B) printed a command that cannot
  succeed twice over: `ruflo plugins install <plugin>` requires -n/--name
  (not a positional) AND targets the npm-package plugin system, while the
  gap detector's own registry check (installed_plugins.json) is for the
  Claude Code marketplace system entirely. Fixed to print the correct
  `/plugin install <plugin>@ruflo` slash-command flow, with a one-time
  "run /plugin marketplace add ruvnet/ruflo first" hint. Also corrects
  three adjacent doc-drift items the reporter found while verifying:
  README/USERGUIDE's `claude mcp add ruflo` examples (should be the
  canonical `claude-flow` key per #2206 — the exact stray-key duplicate
  #2612's healing logic exists to clean up), README's blanket "MCP server
  registered: No" claim for the plugin path (ruflo-core ships its own
  .mcp.json and does register one), and a stale comment in executor.ts
  conflating the CLI-track's mcp__claude-flow__* tool refs with the
  marketplace plugin binding (mcp__plugin_<plugin>_<server>__*).

- #2984: `ruflo mcp start -t http` printed a full "Status: Running"
  success table — PID, health/RPC URLs — then exited 0 within seconds,
  never actually leaving the port bound. Root cause: bin/cli.js's
  "normal CLI mode" branch (which any explicit non-stdio --transport
  always takes) unconditionally exits once the dispatched command's
  action() promise resolves (#1552's "one-shot command" assumption).
  mcp.ts's `start` action returned immediately after printing the table,
  so the freshly-bound http.Server was torn down within milliseconds of
  the printed success claim. Fixed by blocking in the foreground after a
  successful start (SIGINT/SIGTERM-driven graceful shutdown), matching
  daemon.ts's established `--foreground` pattern — `daemonize` isn't
  currently wired to fork/detach anywhere in MCPServerManager, so every
  successful start via this path is a foreground server regardless of
  the -d flag.

Tests: migrate-agent-detection.test.ts updated for the corrected command
string; new mcp-http-foreground-2984.test.ts spawns the built CLI exactly
like the bug report and asserts the port actually accepts connections
after the success table prints (not just that it printed), then confirms
SIGTERM still produces a clean exit. Both verified via git-stash A/B:
fail against the pre-fix code, pass against the fix.

Full suite otherwise unaffected — same 9 pre-existing sandbox-environment
failures (ruvector/wasm bindings, embedder model downloads) reproduced
identically before this change.

Closes #2985. Closes #2984.

Co-Authored-By: RuFlo <ruv@ruv.net>

* revert: drop migrate-agent-detection changes, superseded by PR #2986

An external contributor (pacphi) independently opened #2986 fixing the
same #2985 with the identical installCommand correction plus a real
`migrate fix --agents` restore command — strictly more complete than
this branch's minimal fix. Dropping the overlapping files here to avoid
a duplicate/conflicting PR; reviewed #2986 and recommended it for merge.

Remaining on this branch: the #2984 mcp start -t http fix and the
doc-drift items #2986 explicitly scoped out (README/USERGUIDE mcp-add
key, executor.ts comment).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-08-12 11:39:24 -04:00
ruv 8037f03671 docs(userguide): #2422 remove unimplemented Weighted/Majority consensus claims
USERGUIDE.md documented three consensus modes — Majority, Weighted (Queen 3x),
Byzantine — and three queen types — Strategic / Tactical / Adaptive. As
filed in #2422 by @sparkling, none of the weighted-voting behavior is wired:

  $ npx @claude-flow/cli@latest hive-mind init -c weighted
  [ERROR] Invalid value for --consensus: weighted.
          Must be one of: byzantine, raft, gossip, crdt, quorum

And \`calculateRequiredVotes()\` in the shipped hive-mind engine is a pure
equal-vote threshold — no queen multiplier exists in the codebase.

Rewrote 4 USERGUIDE locations (lines ~263, 268, 1693, 2437) to document
the actually-shipped 5 modes: byzantine / raft / gossip / crdt / quorum.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-06-23 12:09:01 -04:00
Wietze b8a49cfb82 feat(statusline): configurable cost symbol and hide toggle (#2220)
The session-cost segment was hardcoded to a "$" prefix. Claude Code's
cost.total_cost_usd is a client-side estimate that may differ from the
actual bill and, on subscription plans, does not reflect out-of-pocket
spend, so the "$" can mislead.

Two environment variables customize the segment, default unchanged:
- RUFLO_STATUSLINE_COST_SYMBOL overrides the "$" ("" = number alone)
- RUFLO_STATUSLINE_HIDE_COST (1/true/yes/on) hides the segment

The change lives in the statusline generator (source of truth); the
committed .claude/helpers/statusline.cjs is regenerated to match. Tests
cover the generator contract, runtime rendering, and generator/artifact
drift.
2026-05-28 21:05:33 -04:00
ReuvenandRuFlo 6c14c912e5 docs(userguide): update for v3.7 — substrate upgrades + agentdb delete tools
- Header: v3.5 -> v3.7 reference; surface npx ruflo@latest version
- New "What is new in 3.7" section covering: cli-core split (alpha.5+),
  Thompson sampling router (alpha.5), neural@3.0.0-alpha.8 substrate
  upgrades (persistence / seedable RNG / self-consistency / Flash Attention
  + MoE migration / retrieval-path observability / SEO keywords), and the
  3 new agentdb_*-delete MCP tools (alpha.8)
- AgentDB integration: bumped reference 3.0.0-alpha.10 -> 3.0.0-alpha.13
  and called out the new Cypher-routed delete API

End-user CLI surface unchanged. The "What did not change" callout makes
that explicit so 3.6 users can upgrade without relearning anything.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 10:58:41 -04:00
rUvandReuven 2029c71e6a docs: fix init/MCP drift surfaced in #1744 install study (#1751)
* docs: fix init/MCP drift surfaced in #1744 install study

Two papercuts from @ruvnet's methodical install study (issue #1744):

1. README + USERGUIDE both show `npx ruflo@latest init --wizard` in
   five places. Per the source (`v3/@claude-flow/cli/src/commands/init.ts:445-447`),
   `wizard` is registered as a subcommand: `subcommands: [wizardCommand, ...]`.
   The flag form may parse but the canonical form (and what `init --help`
   surfaces) is `init wizard`. Updated all 5 occurrences.

2. README's MCP add command:
     claude mcp add ruflo -- npx -y @claude-flow/cli@latest
   uses the legacy package name. USERGUIDE.md and `ruflo mcp --help` use
   the canonical:
     claude mcp add ruflo -- npx ruflo@latest mcp start
   Both still work, but having two different commands across docs is
   the kind of "wait, what?" papercut #1744 logged. Updated README.

No CLI behavior changes. Pure doc consistency.

Closes part of #1744.

Co-Authored-By: RuFlo <ruv@ruv.net>

* docs(USERGUIDE): fix one straggler 'init --wizard' in command-mapping table

Companion to the previous commit on this branch. Caught the row at
USERGUIDE.md:7413 that the regex replace_all missed because the table
row had a different surrounding pattern.

Co-Authored-By: RuFlo <ruv@ruv.net>

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-05 09:46:27 -04:00
Reuvenandclaude-flow 81418649c6 feat: add 19 Claude Code native plugins with 64 skills, 25 commands, 21 agents
Complete plugin marketplace for Ruflo with validated Claude Code plugin format:

- ruflo-core: MCP server, status, doctor, plugin discovery
- ruflo-swarm: swarm coordination, Monitor, worktree isolation
- ruflo-autopilot: autonomous /loop completion with learning
- ruflo-intelligence: SONA neural patterns, trajectory learning, routing
- ruflo-agentdb: AgentDB controllers, HNSW vector search, RuVector
- ruflo-aidefence: AI safety scanning, PII detection, prompt defense
- ruflo-browser: Playwright browser automation, testing, scraping
- ruflo-jujutsu: git diff analysis, risk scoring, reviewer recs
- ruflo-wasm: sandboxed WASM agents and gallery sharing
- ruflo-workflows: workflow templates, orchestration, lifecycle
- ruflo-daa: Dynamic Agentic Architecture, cognitive patterns
- ruflo-ruvllm: local LLM inference, MicroLoRA, SONA, chat format
- ruflo-rvf: RVF portable memory, session persistence, transfer
- ruflo-loop-workers: background /loop workers, CronCreate
- ruflo-security-audit: CVE scanning, dependency checks
- ruflo-rag-memory: simple store/search/recall interface
- ruflo-testgen: test gap detection, TDD workflow
- ruflo-docs: doc generation, drift detection
- ruflo-plugin-creator: scaffold, validate, publish new plugins

All 19 pass `claude plugin validate`. Skills auto-discovered from
directory structure (not declared in plugin.json). Each skill wires
to ruflo MCP tools via allowed-tools frontmatter.

Includes: marketplace.json, GitHub Pages storefront, CI validation
workflow, minimalist README with USERGUIDE split.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-04-27 23:07:33 -04:00