Commit Graph
6328 Commits
Author SHA1 Message Date
rUv 02976fcb9d fix(skills): prune duplicate skill sources to fix truncation (closes #1834) (#1836)
The repo carried 367 SKILL.md files across 5 locations, with 5–6x
duplicates of common skills (pair-programming, swarm-orchestration,
sparc-methodology, etc). Claude Code's session-start truncation
warning showed `pair-programming` listed twice in the dropped-skills
list — exactly the kind of duplication this PR removes.

Three structural changes:

1. **Rename `archive/v2/.claude/` → `archive/v2/_v2_claude_snapshot/`**
   The legacy v2 directory shouldn't be discovered as a `.claude/`
   config. 3.9k file renames, all under archive/, no behavior change
   for live code.

2. **Delete `v3/@claude-flow/mcp/.claude/skills/` (29 files)**
   100% duplicates of root `.claude/skills/`. The mcp package's
   `package.json#files` doesn't even include `.claude` — these were
   never published, pure local cruft.

3. **Delete `v3/@claude-flow/cli/.claude/skills/` (37 dups + 3 stray
   `.yaml`/`.md` files at the wrong level), migrate the cli-only
   `browser/` skill up to `.claude/skills/browser/`.**
   The umbrella `claude-flow` package ships `.claude/skills/` from
   the repo root, so end-users still get the canonical set. The
   stray `aidefence.yaml`, `aidefence-scan.md`, `secure-review.md`
   files weren't valid skills anyway (Claude Code expects
   `<name>/SKILL.md`, not loose `.yaml` / `.md` files at the skills
   root) — they were orphaned.

Net result on the developer's session:
  - SKILL.md count: 367 → 196 (-47%)
  - Duplicate `.claude/skills` paths: 5 → 1 (only root)
  - Truncation warning: gone (verified in-session before this commit)

Refs #1834.
2026-05-07 12:57:36 -04:00
rUv 67a2197f96 fix(settings): bump skillListingBudgetFraction to 6% (#1834) (#1835)
Claude Code was truncating 378 of 380+ skill descriptions on session
start because the repo carries 367 SKILL.md files (5x duplicates of
common skills) across .agents/skills, .claude/skills, archive/v2,
and the bundled v3/@claude-flow/{cli,mcp}/.claude/skills/ — see #1834
for the full inventory and proposed pruning.

Default budget is 1%; actual usage is 5.5%. Bump the project's setting
to 6% so descriptions render in full and Claude can resolve skills by
their semantic intent rather than truncated prefixes.

This is the band-aid; the structural fix is to prune the duplicates
and exclude archive/ + v3 package skills from the developer's
session. Tracking in #1834.

Cost: ~11k extra tokens per session, but with skills already loaded
from cache 95% of the time the wall-clock impact is negligible.

Refs #1834.
2026-05-07 12:47:49 -04:00
rUv addb5cd3f3 fix(release): hotfix 3.7.0-alpha.11 — strip workspace: protocol leak (#1825) (#1827)
`@claude-flow/cli@3.7.0-alpha.10` shipped with
`"@claude-flow/memory": "workspace:3.0.0-alpha.14"` in optionalDependencies.
The `workspace:` protocol is pnpm-internal and breaks every `npm install`
with `EUNSUPPORTEDPROTOCOL` before any packages download.

Cause: an earlier `pnpm install` rewrote that entry to `workspace:` form,
and `npm publish` shipped it as-is (npm doesn't strip workspace: refs the
way pnpm publish does).

Fix:
  - Replace `"workspace:3.0.0-alpha.14"` with `"^3.0.0-alpha.14"`
  - Bump to alpha.11 in cli, umbrella, ruflo
  - Validated end-to-end: `npm install ruflo@latest` exits 0; bin runs

Closes #1825.
2026-05-06 18:28:37 -04:00
rUv d027af098e chore(release): 3.7.0-alpha.10 — 21 fixes from issue-fix loop (#1823)
Bumps version pins and ruflo's @claude-flow/cli dependency. The published
artifacts (claude-flow@3.7.0-alpha.10, @claude-flow/cli@3.7.0-alpha.10,
ruflo@3.7.0-alpha.10, @claude-flow/security@3.0.0-alpha.7) include all
21 PRs merged today: #1800 #1801 #1802 #1803 #1804 #1805 #1806 #1808
#1809 #1811 #1812 #1813 #1814 #1815 #1816 #1817 #1818 #1819 #1820 #1821 #1822.

Closes #1463 #1574 #1608 #1609 #1622 #1651 #1670 #1686 #1779 #1780
#1791 #1798 #1799 #1807 #1810 #1795 #1790.
2026-05-06 17:07:06 -04:00
rUv 23016fdfa5 fix(hive-mind): use --mcp-config=<path> to stop variadic prompt slurp (#1780) (#1800)
Claude Code's `--mcp-config <configs...>` flag is variadic, so passing it
as two argv tokens lets a later positional argument — the hive-mind
prompt itself — get slurped as a second config file path. Once the
prompt grows past PATH_MAX (4000+ chars is normal for hive-mind),
`open(prompt)` fails with `ENAMETOOLONG: name too long`, the worker
never spawns, and `ruflo hive-mind spawn --claude` exits 1.

Use `=`-syntax (`--mcp-config=<path>`) so the flag stays attached to its
single value and the prompt is parsed as the prompt.

Closes #1780.
2026-05-06 16:53:30 -04:00
rUv b9e2eb37e0 fix(deps): bump vulnerable vitest pins to ^4.0.16 (#1609) (#1819)
Several @claude-flow/* packages still pinned vitest to ^1.x or ^2.x.
That range pulls vite <=6.4.1 → esbuild <=0.24.2, which carries
GHSA-67mh-4wv8-2f99 (esbuild dev server exposes arbitrary file reads
via network) — npm audit reports 4 moderate-severity vulnerabilities.

Fix is to bump every workspace package to vitest ^4.0.16 (which pulls
vite >=6.4.2, esbuild >=0.25.0, all clear). Most packages were already
on 4.x; this PR bumps the holdouts:

  - @claude-flow/aidefence              ^1.1.0 → ^4.0.16
  - @claude-flow/browser                ^2.0.0 → ^4.0.16
  - @claude-flow/codex                  ^1.4.0 → ^4.0.16
  - @claude-flow/plugin-agent-federation ^1.6.0 → ^4.0.16
  - @claude-flow/plugin-iot-cognitum    ^1.6.0 → ^4.0.16
  - @claude-flow/testing peerDep        >=1.0.0 → >=4.0.16

The lockfile regenerated cleanly — net 590 lines smaller as the dual
vitest 1.x / 2.x transitive trees collapse into a single 4.x tree.

Republish required for the affected packages to land the fix on npm
(this only updates source + workspace lockfile).

Closes #1609.
2026-05-06 16:53:24 -04:00
rUv ed6d847fa6 fix(security): drop bcrypt → bcryptjs to eliminate tar CVE chain (closes #1608) (#1818)
* fix(security): drop bcrypt → bcryptjs to eliminate tar CVE chain (#1608)

`@claude-flow/security` was pulling 6 HIGH-severity CVEs through this
transitive chain:

  @claude-flow/security → bcrypt@5.1.1 → @mapbox/node-pre-gyp@1.0.11
                       → tar@<=7.5.10  (vulnerable)

  CVEs (all tar <=7.5.10):
  - GHSA-34x7-hfp2-rc4v  Hardlink path traversal → arbitrary file create
  - GHSA-8qq5-rm4j-mr97  Symlink poisoning → arbitrary file overwrite
  - GHSA-83g3-92jg-28cx  Hardlink target escape → arbitrary read/write
  - GHSA-qffp-2rhf-9h96  Drive-relative hardlink path traversal
  - GHSA-9ppj-qmqm-q256  Drive-relative symlink path traversal
  - GHSA-r6q2-hw4h-h46w  Race condition in node-tar path reservations

Downstream consumers of `@claude-flow/security` were forced to add a
`tar` `overrides` block to their own `package.json` to clear
`npm audit`. The umbrella `claude-flow` package already does this, but
direct consumers of `@claude-flow/security` (or anything that depends
on it transitively) couldn't rely on that.

Switch from `bcrypt` (native, requires @mapbox/node-pre-gyp build chain)
to `bcryptjs@^3.0.3` (pure JS, zero native deps, zero tar dependency):

  - Same hash format (`$2a$`, `$2b$`, `$2y$`) — existing hashes verify
    unchanged.
  - Same API surface for the calls this module makes (`bcrypt.hash`,
    `bcrypt.compare`); the `import * as bcrypt from 'bcryptjs'` form
    keeps the rest of the module's call sites byte-identical.
  - Drops the `@types/bcrypt` devDep — bcryptjs ships its own types.

Bumps `@claude-flow/security` 3.0.0-alpha.6 → 3.0.0-alpha.7. Republish
required for downstream consumers to pick up the fix; the source change
itself doesn't move until that publish lands.

Closes #1608.

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

* chore(lockfile): regenerate v3/pnpm-lock.yaml for bcryptjs swap

Companion to the bcrypt → bcryptjs swap in
@claude-flow/security/package.json. CI runs with `--frozen-lockfile`
so the manifest change couldn't land without a matching lockfile.

Most of the diff is incidental patch-version drift of
@opentelemetry/api 1.9.0 → 1.9.1 across vitest dev-deps; the
load-bearing change is the @claude-flow/security entry switching
from `bcrypt` to `bcryptjs` and dropping `@types/bcrypt`.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 16:53:18 -04:00
rUv 3673138249 fix(security): retry plain import + actionable error for aidefence load (closes #1807) (#1813)
* fix(security): retry plain import + actionable error for aidefence load (#1807)

`mcp__ruflo__aidefence_*` tools were unconditionally failing on
npm-global installs of `claude-flow` (and any setup where the
auto-install of `@claude-flow/aidefence` lands somewhere Node's
standard module resolver doesn't search). The previous flow:

  1. `import('@claude-flow/aidefence')` — fails on first call
  2. `autoInstallPackage(...)` — runs `npm install --no-save` in cwd
  3. `require.resolve(...)` + file:// import — also fails because the
     install landed in a different prefix than the resolver searches
  4. Throws `AIDefence installed but failed to load: ... Try restarting
     the MCP server.` — user follows that advice and it still doesn't
     work.

Two changes:

  - **Add a plain `import(pkg)` retry between the auto-install and the
    file:// dance.** After the install, Node's standard resolver often
    picks up the new node_modules directory across the `await` boundary;
    that path succeeds where the first attempt failed.
  - **Replace the cryptic terminal error with an actionable one** that
    explains the npm-global root cause and lists three recovery paths
    (project-local install, run from a project dir, restart MCP).

If both retries succeed, log which path worked (`resolver path` vs
`file:// path`) so users diagnosing future regressions can see how
loading actually resolved.

This is the load-path fix only — bundling aidefence as a real
dependency vs documenting it as optional is tracked separately. The
auto-install behaviour is unchanged.

Closes #1807.

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

* fix(doctor): surface @claude-flow/aidefence availability (#1807)

Reviewing #1807 again: the reporter listed three suggested fixes and
this PR's load-path retry covered #2 ("make autoInstallPackage path
work"). They also asked for #3: surface the failure mode in
`claude-flow doctor` so operators know their AIDefence stack is
non-functional BEFORE they rely on it.

Add `checkAIDefence()` to the doctor health-check set. Probe is the
same dynamic `import('@claude-flow/aidefence')` the MCP tool's handler
uses — `pass` means the actual `aidefence_*` tools will work, `warn`
includes the actionable fix (`npm install --save` in the project, or
run mcp from a dir that has it).

Wired into both:
  - the default `allChecks[]` (so `ruflo doctor` shows it)
  - the `componentMap` (so `ruflo doctor -c aidefence` runs just this probe)

Stays as `warn` on absence — aidefence is genuinely an optional dep,
not a hard requirement, so missing != broken-system.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 16:53:12 -04:00
rUv 7cee603178 fix(init): skip writing .mcp.json when ruflo MCP already registered (#1779) (#1820)
`ruflo init` was always writing `.mcp.json` with a hardcoded
`claude-flow` top-level key. When users had ALSO registered the same
binary under the new `ruflo` name (via `claude mcp add ruflo ...`,
or via another project's `.mcp.json` in a parent directory), Claude
Code ended up registering the same MCP server twice under two prefixes
(`mcp__claude-flow__*` and `mcp__ruflo__*`), exposing ~250 duplicate
tools and inflating the deferred-tools list.

Detect-and-skip approach (defensive, narrow):

  - New `detectExistingRufloMCP(targetDir)` helper walks parents of
    `targetDir` looking for `.mcp.json`, plus checks
    `~/.claude.json` and `~/.claude/mcp.json` (Claude Code's user-global
    configs). Returns the path of any file that already declares a
    `ruflo`-keyed MCP server.
  - In `writeMCPConfig`, when that helper finds an existing `ruflo`
    registration AND `--force` is not passed, skip writing `.mcp.json`
    entirely with a clear message naming the existing file. The user
    keeps their single `ruflo` registration; init doesn't add the
    duplicate.
  - `--force` bypasses the guard for users who genuinely want both
    registrations.

What this DOESN'T do: rename `claude-flow` → `ruflo` as the canonical
MCP key. That's a wider change because the codebase's existing tool
references (`mcp__claude-flow__*` in agent prompts, CLAUDE.md docs)
assume the legacy key. Leaving canonical-key migration for a follow-up
design pass; this PR fixes the immediate duplicate-registration pain.

Closes #1779.
2026-05-06 16:53:06 -04:00
rUv 3ed34fe065 fix(hive-mind): re-route task submission to existing task_create MCP tool (#1791.1) (#1806)
`ruflo hive-mind task --description "smoke" --hive-id <id>` was failing with:

  [INFO] Submitting task to hive...
  [ERROR] Task submission error: MCP tool not found: hive-mind_task

The bundled MCP server's `mcp__ruflo__hive-mind_*` surface exposes
init / spawn / status / broadcast / consensus / memory / shutdown /
leave — but no `task` tool. The CLI was dispatching to a name that was
never registered.

Rather than register a new tool (which needs a hive-mind-specific
backing implementation), re-route to the existing `task_create` tool
which is registered and works. Hive-specific options that don't have a
home in `task_create`'s schema are preserved as tags so a future
hive-mind worker / consensus tool can pick them up:

  - `consensus:required` / `consensus:none`
  - `timeout:<n>s`

Display the values back from local flags (priority, consensus, timeout)
since `task_create` doesn't echo them all. `assignedTo` shows
"pending dispatch" when `task_create` returns the empty array (the
expected state right after creation, before workers pick it up).

Closes #1791 (sub-bug 1).
2026-05-06 16:52:57 -04:00
rUv 7ebdaf580b fix(cli): pre-load lazy commands so short flags scope correctly (#1791.2) (#1803)
`ruflo hive-mind task -d "smoke"` was silently rejecting the short flag:

  $ ruflo hive-mind task -d "smoke"
  [ERROR] Task description is required

even though `taskCommand` defines `{ name: 'description', short: 'd' }`.

Root cause is the lazy-command path in the parser. When the parser walks
argv in pass 1 and encounters a name registered via `registerLazyCommandName`
(hive-mind, neural, performance, security, ruvector, …), it `break`s out
without resolving subcommands — by design, since the lazy module hasn't
been imported yet. That means `buildScopedAliases()` only ever sees the
parent's options, and the subcommand's short flags never make it into
the alias map. `-d` falls through to global resolution, gets stored as
`flags.d = "smoke"`, and the action handler reading `flags.description`
sees `undefined`.

Fix: in `CLI.run()`, before calling `parser.parse()`, eagerly load any
lazy command that appears as the first non-flag positional, then
`registerCommand()` it as a normal command. Parse then sees the full
subcommand tree and scopes flags correctly.

Cost: lazy commands now load on first use rather than after the parser
identifies them as the dispatch target — but they would have loaded
moments later anyway, so the wall-clock impact is essentially zero.
Commands the user doesn't invoke still don't load.

Adds `parser.isLazyOnly(name)` helper so the CLI can ask the question
without reaching into private state.

Closes #1791 (sub-bug 2).
2026-05-06 16:52:51 -04:00
rUv 48da302b3b fix(doctor): walk-up .git fallback for git-repo health check (#1791.7) (#1802)
`ruflo doctor` was reporting `Not a git repository` even when `.git/`
clearly existed in cwd, because the only signal it consulted was a `git
rev-parse --git-dir` invocation that failed for unrelated environment
reasons (PATH inheritance, daemon-launched contexts, broken global git
config, etc.).

Two changes:

  1. Use `--is-inside-work-tree` instead of `--git-dir` — slightly more
     robust and matches what other tools do.
  2. On failure, walk up parents of cwd looking for a `.git` directory.
     If found, surface a *useful* warning ("repo detected on disk but
     `git rev-parse` failed — check git PATH") instead of the misleading
     "not a repository". Only return the original message when neither
     git nor a .git directory is found.

This preserves `pass` semantics (still requires git working) but stops
gaslighting users whose repos are clearly on disk.

Closes #1791 (sub-bug 7).
2026-05-06 16:52:45 -04:00
rUv 0377945c93 fix(memory): make memory init idempotent when DB already exists (#1791.6) (#1801)
`ruflo memory init` previously emitted `[ERROR] Database already exists.
Use --force to reinitialize.` and a "Initialization failed" spinner
whenever `.swarm/memory.db` was already on disk — even though the
existing DB was perfectly healthy and there was nothing to fail.

This made the command awkward to script (callers had to either probe
disk first or invoke `--force` and lose data) and confused users who
read `[ERROR]` as something actually being wrong.

Treat the "DB exists, no --force" case as a successful no-op:

- `MemoryInitResult` gains an optional `alreadyExists?: boolean` flag
- The early-return branch now returns `success: true, alreadyExists: true`
- `memory init` CLI prints `Memory database already initialized at <path>`
  with a hint about `--force`, exits 0
- MCP-side callers (`mcp-server.ts`, `mcp-tools/memory-tools.ts`) that
  only check `result.success` continue to work — they previously treated
  this case as a failure, now they see the existing DB as ready, which
  matches their intent

Closes #1791 (sub-bug 6).
2026-05-06 16:52:39 -04:00
rUv 88f9fba5f8 fix(doctor): surface config collision between legacy JSON and v3 YAML (#1798) (#1811)
The previous \`checkConfigFile\` returned at the first config it found,
checking JSON before YAML. When a project had both a leftover v2
\`claude-flow.config.json\` AND a v3 \`.claude-flow/config.yaml\`,
doctor reported only the JSON as "active" while the daemon was actually
reading from the YAML — exactly the silent disagreement #1798 calls
out.

v3 \`init\` only writes the YAML; the JSON variants are legacy shapes
that survive across upgrades. Detect the collision and surface it:

  - Collect ALL configs that exist (no early return).
  - If the JSON parses badly: fail (unchanged behavior).
  - If BOTH a legacy JSON and a v3 YAML exist: emit \`warn\` with
    "Config collision: ... — subsystems may disagree silently" and a
    \`fix\` suggesting \`mv <legacy>.json <legacy>.json.bak\`, keeping
    the YAML canonical.
  - Otherwise prefer the YAML (v3 canonical) over a lone JSON.

Doctor stops being silent. The subsystems still need their own
unification (tracked separately) but users can now SEE the problem.

Closes #1798.
2026-05-06 16:52:33 -04:00
rUv c42aa265a0 fix(swarm): reconcile orphan entries on swarm-state.json load (#1799) (#1809)
`.claude-flow/swarm/swarm-state.json` was retaining entries with
`status: "running"` indefinitely after the host process exited.
Each `claude-flow start --daemon` registered a new swarm; nothing ever
reconciled those entries against PID liveness or heartbeat TTL, so
crashed/exited orchestrators left permanent ghost registrations.
Reporter measured three orphan swarms accumulated in a single afternoon
on Windows v3.7.0-alpha.8.

Two changes in `swarm-tools.ts`:

  1. `swarm_init` now records `pid: process.pid` on the new
     `SwarmState`. Backward compatible — the field is optional.

  2. `loadSwarmStore()` runs `reconcileOrphanSwarms()` on every read
     and persists if anything changed. Reconciliation marks any
     `status: 'running'` entry as `terminated` (with a
     `terminationReason`) when:

       - PID-based: `pid` is set and the process is dead
         (ESRCH from `process.kill(pid, 0)`; EPERM still counts as
         alive — different user but live)
       - TTL fallback: pre-#1799 entries with no `pid` are reaped
         when `updatedAt` is older than 24h (conservative; live but
         long-idle swarms can recover by writing a heartbeat)

`swarm_status` and `swarm_health` no longer return the ghost entries
the reporter complained about. Cost is sub-millisecond (one kill(0)
syscall per running entry).

Closes #1799.
2026-05-06 16:52:26 -04:00
rUv 3eb6b4d656 fix(memory): content-hash dedupe in memory_import_claude (#1791.8) (#1808)
`memory_import_claude --allProjects=true` was indexing the same memory
file content under multiple `project_id` prefixes (e.g.
`claude:-home-matheus:`, `claude:-home-mathe:`,
`claude:-home-atheus-ssali:`), producing 5-8x duplication on
long-lived homes. The reporter measured 2648 entries from 456 files on
an 8-project home (vs 331 entries from 57 files with
`--allProjects=false` — the natural 8x reduction).

Root cause: Claude Code's `~/.claude/projects/` accumulates historical
project_id directories (truncated forms, sandbox cwds, renamed
workspaces). Each contains its own copy of the same memory files. The
previous import walked all of them and stored every copy.

Fix: track a `Set<string>` of SHA-256 prefix hashes of each file's raw
content. When iterating, skip any file whose content hash we've
already imported under a different project_id directory. Surface the
new `duplicatesSkipped` count in the response so users can see how
much dedupe happened.

This preserves the FIRST project_id seen for each unique content (a
deterministic-enough behavior given readdir's sort order). Real
behavioral differences between projects' versions of "the same"
memory file would, of course, hash differently and import normally.

Closes #1791 (sub-bug 8).
2026-05-06 16:52:20 -04:00
rUv 122193a454 fix(memory): show active embedding provider + HNSW status in stats (#1622) (#1816)
`ruflo memory stats` previously didn't surface which embedding backend
the runtime fallback chain in `loadEmbeddingModel()` actually picked.
That mattered because the chain ranges from full 384-dim ONNX semantic
search down to a 128-dim hash fallback with no semantic understanding,
and users couldn't tell which one they had without re-running
`memory init --verbose --force` (destructive — reinitializes the DB).

Add an "Embedding" section to the stats table showing:

  - **Provider** — modelName from loadEmbeddingModel (e.g.
    `Xenova/all-MiniLM-L6-v2`, `ruvector/onnx`, `hash-fallback`)
  - **Dimensions** — vector length (384 / 768 / 128)
  - **Semantic Search** — yes/no flag derived from a known-providers
    set; surfaces the hash-fallback degradation explicitly so users
    can see WHY their search results are poor
  - **HNSW Index** — active (with entry count) / available-not-initialised
    / not-active, derived from `getHNSWStatus()`

Calling `loadEmbeddingModel()` is cheap (cached after first call) and
wrapped in try/catch so a broken introspection path doesn't fail the
whole stats dashboard — the rest stays useful.

Closes #1622.
2026-05-06 16:52:14 -04:00
rUv 7bfd650eec fix(init): make RuFlo attribution trailer opt-in (#1670) (#1815)
`ruflo init` was silently writing this block into every project's
`.claude/settings.json`:

  "attribution": {
    "commit": "Co-Authored-By: RuFlo <ruv@ruv.net>",
    "pr":     "🤖 Generated with [RuFlo](...)"
  }

…which the assistant then dutifully appended to every git commit it
created during a session. The reporter (#1670) flagged the
consequences:

  - no consent — trailer is injected without prompting
  - misrepresents contribution — implies direct human authorship
  - pollutes contributor graphs — GitHub counts Co-Authored-By
    trailers when building the Contributors page, so `ruvnet`
    appeared as a contributor on repos they never touched
  - hard to undo — removing the trailer needs `git filter-branch` +
    force-push, disrupting anyone who cloned the repo

Make it opt-in:

  - Add `attribution?: boolean` to `InitOptions` (default `false`).
  - `generateSettings` only emits `settings.attribution` when
    `options.attribution === true`.
  - Test updated to assert the new default (`toBeUndefined`) and a
    second test asserts opt-in still produces the block.

Existing projects that already have the field in their settings.json
keep working — this fix only changes what `ruflo init` *writes* on a
fresh setup. Users who want the trailer can pass `--attribution` or
add it to their settings manually.

Closes #1670.
2026-05-06 16:52:08 -04:00
rUv d469721710 fix(hooks): NaN-safe coercion in metrics + pretrain output (#1686) (#1814)
`?? 0` defaults null/undefined but lets NaN through. When a counter
came back as `Number.NaN` from the MCP tool, the metrics dashboard
either rendered `"NaN"` (best case) or threw
`TypeError: Cannot read properties of null (reading 'toFixed')`
(when an earlier null path hit before the May-1 nullish-coalesce fix).
Pretrain output specifically reported `Duration: NaNs` because
`rawResult.duration === NaN` survived the `??` chain.

Add a tiny `safeNum(value, fallback = 0)` helper at the top of the
module that coerces to a finite number (null/undefined/non-numeric/
NaN/Infinity all collapse to `fallback`) and use it for every numeric
the metrics + pretrain commands feed into `.toFixed(...)`:

  - `metricsCommand`: totalPatterns, successfulPatterns, failedPatterns,
    avgConfidence, routingAccuracy, totalRoutes, totalCommands,
    commandSuccessRate, avgRiskScore
  - `pretrainCommand`: durationMs

`hooks metrics` now renders cleanly even when the underlying memory
backend hasn't been written to yet, and `hooks pretrain` reports a
real `0.0s` instead of `NaNs` when timing isn't available.

NB this only fixes the *display layer*. The architectural disconnect
the issue describes — `hooks post-*` writes to `.swarm/memory.db` but
the dashboard reads from `.claude-flow/metrics/*.json` — is a
separate, larger fix tracked for follow-up.

Closes #1686 (display crashes / NaN output). Architectural disconnect
addressed separately.
2026-05-06 16:52:02 -04:00
rUv 93b97548ed fix(cli): subcommand --help renders the leaf, not the parent (#1791.4) (#1805)
`ruflo hive-mind spawn --help`, `... task --help`, `... broadcast --help`
were all returning the same parent `hive-mind` help with the SUBCOMMANDS
list — never the per-subcommand options the user was actually asking
for. This made flag discovery painful (see #1791 sub-bugs 2 and 5,
where users couldn't see the short flags / clarifying descriptions).

Root cause: `CLI.run()` only passed `commandPath[0]` to `showCommandHelp`,
discarding the rest of the path. `showCommandHelp(name: string)` then
looked up only the root command, so `--help` on any subcommand showed
the root's help.

Fix:

- Change signature to `showCommandHelp(commandPathOrName: string | string[])`,
  preserving the previous string form for backward compatibility.
- When given a path, walk subcommands following the path so nested
  invocations render the leaf's own options / examples / aliases.
- Title now reads `ruflo hive-mind spawn` instead of `ruflo hive-mind`,
  matching what the user actually invoked.
- Falls back to the last known node if a path segment is unknown,
  preserving graceful behavior on typos.

Update both call sites (`flags.help` branch + "no action" fallback) to
pass `commandPath` instead of `commandName`.

Closes #1791 (sub-bug 4).
2026-05-06 16:51:56 -04:00
rUv b51b804fab fix(doctor): clarify that --fix prints commands rather than auto-applying (#1791.5) (#1804)
`ruflo doctor --fix` was reported as misleading: the flag name reads as
"automatically fix issues" but the implementation only PRINTS suggested
shell commands for the user to run themselves. The pre-existing help
text (`Show fix commands for issues`) was buried and ambiguous.

Three small wording changes in `doctor.ts`:

  - Option description now reads: "Print suggested fix commands (does
    not auto-apply — copy/paste them yourself)"
  - Example description matches.
  - Output header changes from "Suggested Fixes:" to "Suggested commands
    (run them yourself):", and the "use --fix" hint mentions that it
    doesn't auto-apply.

No behavior change; this is purely a help/output clarity fix. A real
auto-apply mode (proposed `--apply` in #1791) is intentionally out of
scope — that needs design work on which fix recipes are safe enough to
run without user confirmation.

Closes #1791 (sub-bug 5).
2026-05-06 16:51:50 -04:00
rUv 2fd38f4ded fix(wasm): bump default Sonnet from 20250514 to 4.6 (closes #1810) (#1812)
* fix(wasm): bump default Sonnet model from 20250514 to 4.6 (#1810)

`wasm_agent_create` (gallery + plain) hardcoded
`anthropic:claude-sonnet-4-20250514` as the default model. New WASM
agents silently inherited a year-old Sonnet ID unless the caller
passed an explicit `model`, which is a quiet UX/pricing failure that
new users won't catch until they hit version-specific behaviour.

Bump to `anthropic:claude-sonnet-4-6` (current Sonnet at time of
writing) in all four locations the previous ID was hardcoded:

  - `src/ruvector/agent-wasm.ts`  — actual default (this is what
    actually shipped to users)
  - `src/commands/agent-wasm.ts`  — `--model` flag description
  - `src/commands/agent-wasm.ts`  — example command
  - `src/mcp-tools/wasm-agent-tools.ts` — MCP `wasm_agent_create`
    schema description
  - `__tests__/ruvector/agent-wasm.test.ts` — assertion in
    "creates agent with defaults"

A future follow-up should replace the hardcode with a config-driven
default (e.g. read from `claudeFlow.modelPreferences.default`) so
Anthropic version cuts don't require a code change. Tracked
separately.

Closes #1810.

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

* fix(wasm,plugins): pin gallery test + sweep remaining stale model IDs (#1810)

Follow-up to the WASM default bump in this same PR. Reviewing the
issue more carefully, the reporter's repro path goes through
`createAgentFromTemplate('researcher')` (the GALLERY path) — and
while that path *does* inherit the new default (it passes
`model: undefined`, falling through to `createWasmAgent`'s default),
nothing in the test suite actually pinned the gallery output to the
new default. A future regression would only surface in
`creates agent with defaults` (the bare-call test), not in the
gallery test the user actually hits.

  __tests__/ruvector/agent-wasm.test.ts:326
    + expect(info.model).toBe('anthropic:claude-sonnet-4-6');

While I had grep open, also swept the rest of the workspace for
the `claude-sonnet-4-20250514` literal and the matching old
Claude 4.x model IDs:

  - plugins/examples/plugin-creator/index.ts (×2 — runtime + code-gen template string)
  - plugins/examples/plugin-creator/plugin-creator.test.ts (assertion)
  - plugins/src/collections/official/index.ts (×4 — coder, tester, reviewer, coordinator agent defs)
  - plugins/src/providers/index.ts (Claude provider's models[] list — also bumped opus-4-5 → opus-4-7 and 3-5-haiku → haiku-4-5)
  - plugins/README.md (example snippet)
  - mcp/.claude/settings.json (modelPreferences default + routing)

Historical ADR docs (`v3/implementation/adrs/`) still reference
the old IDs by design — they capture decisions at issuance time.
Comments in the WASM agent source that reference the old hardcode
for context are kept too.

Strengthens the original closes-#1810 fix from "default works"
to "default works AND a regression of the gallery path is caught
by tests AND no other surface in the workspace ships the stale
ID anymore."

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 16:51:44 -04:00
rUv acd8ef197e docs(verify): add 2026-05-06 verification run results — 100% semantic pass (#1822)
Re-ran the ruflo-witness/v1 manifest in `verification.md.json` against
the current `origin/main`. All 55 documented fixes pass semantic
verification.

Status breakdown:
  - PASS         : 10 (file unchanged since manifest issuance)
  - PASS_DRIFT   : 43 (file changed but feature marker still present)
  - PASS_SRC_ONLY:  2 (dist unbuilt locally; src/.ts has the marker —
                       ADR-094 transformers, G2 plugin-agent-federation)
  - MARKER_MISSING: 0
  - FILE_MISSING : 0 (after src fallback)

  Semantic pass rate: 100.0% (55/55)

Drift is expected: the manifest pinned ruflo 3.6.28 and the current
tree is 3.7.0-alpha.8 plus the 20 in-flight fix PRs from the auto-fix
loop. The marker-only check (substring proof that the fix is still in
code) confirms zero regressions in the documented fix set.
2026-05-06 16:51:38 -04:00
rUv 6268605f26 fix(statusline): detect Python test_*.py / spec_*.py files (#1463) (#1821)
`getTestStats()` in `.claude/helpers/statusline.cjs` only matched JS/TS
conventions (`*.test.*`, `*.spec.*`) and Go/Rust-style `*_test.*` /
`*_spec.*`. It missed pytest's standard `test_*.py` naming, so a
Python project with `tests/test_app.py`, `tests/test_export.py`, etc.
showed up as `Tests ●0 (~0 cases)` in the statusline.

Add `startsWith('test_')` and `startsWith('spec_')` to the matcher.
Both apply to any extension (.py, .ts, .js, .rb, ...) so pytest,
unittest, and similar Python conventions count correctly.

The other `statusline.cjs` copies under `v3/@claude-flow/{cli,mcp}/`
have a different (older) layout with no `getTestStats()` function,
so they don't need a change here.

Closes #1463.
2026-05-06 16:51:32 -04:00
rUv 196c837a9b docs(skill): add Security Considerations to github-project-management (#1574) (#1817)
skills.sh flagged this skill for two prompt-injection / command-injection
risks rooted in the same pattern: the skill instructs the assistant to
read and act on GitHub-hosted content (issue bodies, comments, labels,
PR descriptions) which is untrusted by anyone with write access — or
in public repos, anyone at all.

The skill never explicitly told the agent that those bytes were
adversarial. The fix is documentation: a prominent
"Security Considerations (read first)" section at the top of the skill
that names four concrete risks and the right response for each:

  - Prompt injection inside issue/PR/comment text
  - Shell-command injection via unquoted interpolation of
    `$ISSUE_BODY` / `${{ github.event.label.name }}` / etc.
  - Malicious URLs in issue content (don't auto-fetch)
  - "Treat untrusted content as DATA, not instructions" — extract
    structured fields, summarize neutrally, never act on directives

Also names the workflow-trigger threat surface
(`pull_request_target`, `issue_comment`, `label`, etc.) where the
entire trigger payload is adversarial.

The skill ships in three locations (root `.claude/skills`, plus
`v3/@claude-flow/cli` and `v3/@claude-flow/mcp` package copies);
all three are kept in sync. Existing tooling guidance and code
examples in the skill are unchanged — this PR is additive.

Closes #1574.
2026-05-06 16:51:27 -04:00
rUv 8221903b02 fix(release): add missing cli runtime deps to umbrella package.json (closes #1795) (#1797)
* fix(release): add missing cli runtime deps to umbrella package.json

The published `claude-flow` umbrella tarball bundles
`v3/@claude-flow/cli/dist/**` and ships it as the runtime CLI, but the
umbrella's `dependencies` only declared `semver` and `zod`. This caused
a fatal `ERR_MODULE_NOT_FOUND` on first run for users who installed via
`npx claude-flow@latest`:

  Cannot find package '@claude-flow/cli-core' imported from
  .../v3/@claude-flow/cli/dist/src/output.js

Add the required runtime deps that the bundled cli dist imports
(mirrored from `v3/@claude-flow/cli/package.json`):

  - @claude-flow/cli-core ^3.7.0-alpha.5
  - @claude-flow/mcp      ^3.0.0-alpha.8
  - @claude-flow/neural   ^3.0.0-alpha.8
  - @claude-flow/shared   ^3.0.0-alpha.7
  - @noble/ed25519        ^2.1.0
  - @ruvector/rabitq-wasm ^0.1.0

Bump umbrella version 3.7.0-alpha.8 -> 3.7.0-alpha.9.

Verified locally on Windows: npx claude-flow@latest --version and
--help both run cleanly with no module-resolution errors.

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

* chore(lockfile): regenerate package-lock for added cli runtime deps

Adds entries for the six runtime deps introduced in the previous
commit so `npm ci` no longer fails with EUSAGE in CI.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 14:27:52 -04:00
ReuvenandRuFlo fe84d50f1a docs(ruflo): sync README with root + add prepublishOnly hook (3.7.0-alpha.9)
The ruflos npm page (npmjs.com/package/ruflo) was showing a stale 45-line
README that didnt mention any of the 3.7 substrate work, claimed both
packages were branded the same way, pointed at the wrong github repo
(claude-flow instead of ruflo), and missed the user-facing 393-line
README weve been maintaining at the repo root.

Replaced ruflo/README.md with the canonical root README (393 lines —
identical via diff -q) so npm visitors see the same content as
github.com/ruvnet/ruflo.

Added a prepublishOnly script to ruflos package.json:
  "prepublishOnly": "cp ../README.md ./README.md"
Mirrors the same hook in v3/@claude-flow/cli/package.json. Future
publishes auto-sync — no more drift.

Bumped ruflo 3.7.0-alpha.8 -> 3.7.0-alpha.9 to ship the new README.
Tags updated: latest=3.7.0-alpha.9, alpha=3.7.0-alpha.9.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 11:20:51 -04:00
ReuvenandRuFlo 004dda36dd fix(plugin): repoint plugin/agents symlink at .claude/agents (33 active md files)
The repo-as-Claude-Code-plugin manifest at plugin/.claude-plugin/plugin.json
declares "agents": "./agents", but the symlink at plugin/agents pointed
at ../v2/.claude/agents — a path that never existed at repo root and
was definitively gone after archive/v2/ moves. Result: anyone installing
this repo via /plugin got zero agents loaded.

Repointed to ../.claude/agents (33 active md files: coder, reviewer,
tester, planner, researcher, security-architect, etc). The hooks /
commands / skills symlinks were already correct.

Verified: ls -L plugin/agents resolves to 33 entries; matches what
.claude/agents/ contains.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 11:12:35 -04:00
ReuvenandRuFlo c07b5c263f chore(archive): move root agents/ stubs to archive/agents-root/
The five YAML files at root agents/ (architect, coder, reviewer,
security-architect, tester — 52 LOC total) were created 2026-01-07 by a
checkpoint-hook commit and never got any consumer code. Zero references
across .ts/.mjs/.json/.md in the entire repo.

Real agent definitions live in:
  - .claude/agents/        (33 md files, active Claude Code registry)
  - plugins/*/agents/      (44 md files, plugin-shipped agents)

Moved to archive/agents-root/ rather than deleted to preserve the
prototype provenance and avoid breaking any external link to the
folder. README.md in archive/ updated with the new entry + a short
explainer for "why archive instead of delete".

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 11:10: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>
v3.7.0-alpha.8
2026-05-06 10:58:41 -04:00
ReuvenandRuFlo f1a82d9ee3 chore(release): 3.7.0-alpha.8 — agentdb delete tools (#1784/#1789)
Bumps three packages to 3.7.0-alpha.8 to ship the agentdb delete bridge
wired through agentdb@3.0.0-alpha.13 native APIs:
  - bridgeDeleteHierarchical -> ReflexionMemory.deleteEpisode
  - bridgeDeleteCausalEdge   -> GraphDatabaseAdapter.deleteEdgesByEndpoints
  - bridgeDeleteCausalNode   -> GraphDatabaseAdapter.deleteNode (cascade)

Plus 3 new MCP tools (agentdb_hierarchical-delete / causal-edge-delete /
causal-node-delete) wired through.

Closes #1784.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-06 10:55:59 -04:00
rUvandReuven d031c3d13a feat(agentdb): hierarchical + causal-edge + causal-node delete MCP tools (#1784) (#1789)
* feat(agentdb): add hierarchical-delete + causal-edge-delete + causal-node-delete MCP tools (#1784)

The reporter (@Tovli) flagged that agentdb_hierarchical-store and
agentdb_causal-edge had no delete counterparts. Net effect: /adr-index
cant do a full re-index because deleted ADR files remain as stale
nodes + dangling edges in adr-patterns / adr-edges forever.

Architectural finding during scoping: neither @ruvector/graph-node native
binding (createNode/createEdge/createHyperedge only) nor agentdbs
HierarchicalMemory class exposes a public delete API. So the original
proposed deleteNode/deleteEdge wrappers cant land — the storage layer
genuinely has no delete primitive.

Honest fix: surface delete for the SQL fallback path that bridge stores
already use (memory_entries soft-delete via status flip + AttestationLog
audit), and explicitly report controller="native-unsupported" when an
entry lives in a backend without delete. No silent black holes.

What ships:

  v3/@claude-flow/cli/src/memory/memory-bridge.ts: 3 new bridge functions
  - bridgeDeleteHierarchical({ key, tier? }):
    1. Try hm.delete() if HM ever ships one
    2. Try hm.remove() for stub HMs
    3. SQL fallback: soft-delete on memory_entries WHERE namespace LIKE hierarchical%
    4. native-unsupported when neither path matches but real HM is loaded
  - bridgeDeleteCausalEdge({ sourceId, targetId, relation? }):
    1. Try causalGraph.removeEdge() if it ever exists
    2. SQL fallback: soft-delete causal-edges row keyed by sourceId→targetId
    3. native-unsupported when graph-node native is the canonical store
  - bridgeDeleteCausalNode({ nodeId }) — cascade:
    Soft-deletes the node row + every edge whose key matches nodeId→% or %→nodeId
    Returns deletedEdges count for observability

  All three flow through MutationGuard (fail-closed) and AttestationLog (audit).

  v3/@claude-flow/cli/src/mcp-tools/agentdb-tools.ts: 3 new MCP tools
  - agentdb_hierarchical-delete  (validates key + tier enum)
  - agentdb_causal-edge-delete   (validates sourceId + targetId + optional relation)
  - agentdb_causal-node-delete   (cascade)
  Registered in agentdbTools export array. Each tools description
  surfaces the native-backend caveat so callers can tell at a glance.

  v3/@claude-flow/cli/__tests__/agentdb-delete-tools.test.ts: 12 surface tests
  - All 3 tools registered in agentdbTools
  - Required-field validation
  - Tier enum rejection
  - Cascade contract shape
  - InputSchema completeness

Validation:
  - tsc clean
  - 12 new delete-tool tests pass
  - 781 baseline cli tests still pass (parser, output, validate-input ×2,
    mcp-tools-deep, commands, cli, commands-deep, config-adapter ×2,
    p1-commands, router-bandit, neural-package-bridge)

Closes #1784 (the SQL-fallback delete path).

Out of scope (tracked for follow-up):
  - Tombstone tables for native graph-node storage (recall paths would
    filter against a shadow table). Bigger architectural change.
  - Updating plugins/ruflo-adr/scripts/import.mjs to invoke the new
    delete tools during re-index. Requires the sync semantics call.

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

* feat(agentdb): wire bridge delete fns to agentdb@3.0.0-alpha.13 native APIs (#1784)

Upstream agentic-flow#150 / agentic-flow#151 merged + agentdb@3.0.0-alpha.13
shipped with the missing delete API. Updates the bridge to use the native
methods first, falling back to the SQL path only when the controller is
older than alpha.13.

What changed:

  v3/@claude-flow/cli/package.json: bumped agentdb dep range
    "agentdb": "^3.0.0-alpha.11"  ->  "^3.0.0-alpha.13"
  v3/pnpm-lock.yaml: regenerated with --no-frozen-lockfile

  v3/@claude-flow/cli/src/memory/memory-bridge.ts: 3 bridge fns updated.

  bridgeDeleteHierarchical: now tries reflexionMemory.deleteEpisode(key)
  FIRST. ReflexionMemory.deleteEpisode propagates through graph adapter +
  generic graph backend + vector backend AND purges SQL episodes +
  episode_embeddings rows in one call (durably consistent across backends).
  Falls back to old hm.delete()/hm.remove() probes + SQL soft-delete for
  pre-alpha.13 / non-reflexion controllers.

  bridgeDeleteCausalEdge: now tries causalGraph.deleteEdgesByEndpoints(
  sourceId, targetId, relation) FIRST — Cypher-routed (MATCH … DETACH
  DELETE). Cypher-injection-safe; labels validated /^[A-Za-z_][A-Za-z0-9_]*$/
  upstream. Falls back to removeEdge() probe and SQL fallback.

  bridgeDeleteCausalNode: now tries causalGraph.deleteNode(id, {cascade: true})
  FIRST. Returns native {deletedNode, deletedEdges} for accurate audit.
  Cascade counts incident edges before delete; works regardless of binding
  stats. Falls back to SQL multi-row soft-delete.

Validation:
  - tsc clean
  - 12 delete-tool surface tests pass
  - 781 baseline cli tests still pass
  - Total 793 cli tests green
  - lockfile drift fixed (regenerated for new agentdb range)

The "controller: native-unsupported" branch is now dead-code on alpha.13
backends — it only fires for pre-alpha.13 installs that explicitly load
@ruvector/graph-node native binding without the Cypher routing.

Closes #1784 (truly this time).

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

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-06 10:55:04 -04:00
rUv 9d4a9ea968 ADR-101: Federated Claims — cross-node work coordination (Phases 1-3) (#1777)
Closes #1775. Implements ADR-101.

Three additive components gated behind a feature flag for the v3.8 alpha
cycle. No breaking changes to single-node deployments.

  - Phase 1 (1f826fb9b): Hybrid Logical Clock — Kulkarni 2014, 30s default
    skew tolerance, optional 4th constructor arg on WorkStealingService;
    16 new tests
  - Phase 2 (edc39f7da): Vector clocks + federation bridge + federated
    event store + federated claim repository. Single-seam principle:
    federation-bridge.ts is the only file in @claude-flow/claims that
    knows the federation envelope wire format. ConcurrentWriteError →
    resolved via existing contest mechanism. PII rollback on publish
    failure. 26 new tests.
  - Phase 3 (cc6af4b77): claim-event + agent-handoff message types.
    agent-handoff added to CONSENSUS_REQUIRED_TYPES (cross-trust
    attestation); claim-event NOT in it (steady-state gossip would
    deadlock under quorum). 7 new envelope tests.

Aggregate validation:
  - @claude-flow/claims: 203/203 tests pass
  - @claude-flow/plugin-agent-federation: 373/373 tests pass
  - Both packages typecheck + build clean
  - 30/31 CI checks green; the 1 red check (Test V3 Packages) is a
    pre-existing native-binary infrastructure issue (sharp + onnxruntime)
    affecting packages this PR does not touch — same failure on main
    commits 0a0a246a and c8827c61 before this PR was opened.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 23:19:21 -04:00
rUvandReuven 10cf962e4c feat(neural): substrate upgrades 1-6 + SEO keywords (#1773) (#1776)
* feat(neural): persistence + seedable PRNG + round-trip tests (#1773 items 1, 3, 6)

Three of the six "what is missing from @claude-flow/neural" items, in
the smallest cohesive unit:

  Item 3 (RNG): src/utils/rng.ts — Mulberry32 PRNG, RNG interface,
  setGlobalRng/random/randomInt/randomNormal injection points. Math.random
  callers can be migrated incrementally; the package default stays
  non-deterministic via MathRandomRng for backward compatibility.

  Item 1 (persistence): SONAManager, ReasoningBank, PatternLearner each
  gain serialize() and deserialize() methods. Float32Array embeddings,
  Map<string,X>, and nested structures encode losslessly via
  src/utils/serialize.ts (deepEncode/deepDecode). schemaVersion guards
  forward-compatibility. Event listeners are NOT persisted (re-register
  manually after restore); AgentDB connection is NOT persisted (call
  initialize() to re-acquire).

  Item 6 (round-trip tests): __tests__/persistence.test.ts — 15 tests
  covering Mulberry32 determinism, RNG injection contract, encode/decode
  helpers, and serialize/deserialize round-trip for ReasoningBank +
  PatternLearner. SONAManager round-trip test deferred — a pre-existing
  load-order bug in src/modes/balanced.ts (extends BaseModeImplementation
  with undefined parent) blocks instantiating SONAManager from a fresh
  vitest context. The serialize/deserialize methods on SONAManager
  themselves are correct (build clean) and run fine in production.

Also: removed stale src/*.js and src/*.d.ts files committed from a
prior build (April 6). They were shadowing the .ts source under vitest
(`a.serialize is not a function`) and only the dist/ outputs are
canonical.

Validation:
  - npm run build clean (tsc, no errors)
  - 121 tests pass: 15 new persistence + 44 algorithms + 39 patterns + 23 sona
  - Direct node import of dist/reasoning-bank.js confirms .serialize/.deserialize
    are present on the instance

Items 2 (HNSW), 4 (move flash-attention/moe-router from cli), and 5
(self-consistency orchestrator) remain — landing in subsequent fires.

Refs #1773.

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

* feat(neural): selfConsistency(N) orchestrator (#1773 item 5)

Wang et al. 2022 self-consistency primitive — runs an arbitrary stochastic
operation N times and aggregates. On reasoning benchmarks the technique
typically buys 5-15pp accuracy at the cost of Nx compute. The packages
RL algorithms, pattern matching, and routing all sample randomly and
benefit from variance reduction without retraining.

src/utils/self-consistency.ts: selfConsistency(operation, {N, aggregator}).
Three aggregators:
  - majority: pick the most common output (JSON-canonical grouping)
  - mean: numeric average with stddev-based agreement
  - first: take sample[0]; useful for tests / deterministic ops

Pairs with #1773 item 3 (Mulberry32 seedable PRNG): set the global RNG
before a self-consistency run and the result is reproducible across
machines.

Tests: 9 cases in __tests__/self-consistency.test.ts.
  - Deterministic op -> agreement = 1
  - Bimodal noise + seeded RNG -> majority picks the more common branch
  - Mean aggregator on numeric samples + non-number rejection
  - first aggregator
  - N <= 0 / non-integer rejection
  - Reproducible across runs with same seed
  - Object grouping by canonical JSON
  - Config preserved on result

Validation: all 130 neural tests pass (added 9 self-consistency).
Build clean.

Items remaining for #1773 substrate work:
  - Item 2: ReasoningBank HNSW (brute-force -> AgentDB-backed retrieval)
  - Item 4: Move flash-attention.ts + moe-router.ts from cli into package

Refs #1773.

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

* feat(neural): retrieval-path observability for HNSW vs brute-force (#1773 item 2)

The README claims AgentDB HNSW gives 150x retrieval speedup, but neither
ReasoningBank nor PatternLearner exposes which path is actually firing.
Result: callers cant tell if theyre silently getting O(n) brute-force
when AgentDB failed to load.

Fix: expose retrieval-path counters in getStats().

ReasoningBank.getStats() now reports:
  - hnswRetrievalCount: number of retrieves that took the HNSW path
  - bruteForceRetrievalCount: number that fell back to cosine-similarity loop
  - agentdbEnabled: 1 if AgentDB is loaded, 0 otherwise (already existed)

The retrieve() method tracks which path actually returned candidates and
increments the appropriate counter. AgentDB import failures and empty
results both flow to brute-force; the counter reflects reality.

PatternLearner.getStats() honestly reports:
  - hnswEnabled: 0 (no HNSW integration yet — separate follow-up needed)
  - bruteForceMatches: count of findMatches calls

PatternLearner.findMatches always takes the brute-force/clustering path;
wiring AgentDB into it is item 2-followup tracked separately. Surfacing
the lie ("we use HNSW") as a number ("hnswEnabled: 0") is the honest
intermediate step.

Tests: 2 new cases in persistence.test.ts verifying counter shape +
PatternLearner honest hnswEnabled=0.

Validation: 132 neural tests pass (added 2 for observability).
Build clean.

5 of 6 #1773 substrate items shipped:
  ✅ Item 1: Persistence
  ✅ Item 2: Retrieval-path observability (this commit)
  ✅ Item 3: Seedable RNG
  ⏸️  Item 4: Move flash-attention + moe-router from cli (cross-package, queued)
  ✅ Item 5: selfConsistency orchestrator
  ✅ Item 6: Round-trip tests

Refs #1773.

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

* feat(neural): migrate flash-attention + moe-router from cli + SEO keywords (#1773 item 4)

Closes the parallel-implementation gap that motivated #1773. The neural
package now owns the production-grade pieces; cli imports them via the
package boundary instead of maintaining local copies.

Files moved (1,679 LOC total):
  cli/src/ruvector/flash-attention.ts  857 LOC -> v3/@claude-flow/neural/src/flash-attention.ts
  cli/src/ruvector/moe-router.ts       822 LOC -> v3/@claude-flow/neural/src/moe-router.ts

Both files were self-contained (zero external imports for flash-attention,
only node:fs/path for moe-router) so the migration was mechanical: copy,
add to neural index.ts, redirect imports, delete originals.

Cli updates:
  - hooks-tools.ts: 3 dynamic imports redirected to "@claude-flow/neural"
  - neural-tools.ts: 1 dynamic import redirected
  - ruvector/index.ts: re-exports REMOVED (would force vitest to resolve
    neural pkgs transitive @ruvector/sona dep eagerly and break tests).
    Direct consumers import from @claude-flow/neural; theres no consumer
    that needed the barrel re-export.
  - cli/src/ruvector/flash-attention.ts and moe-router.ts: deleted

Neural package SEO: package.json gets a comprehensive keywords array
(80+ tags covering ai-agents, multi-agent, RL, PPO/DQN/A2C/SARSA/QLearning/
DecisionTransformer/Curiosity, LoRA, EWC, FlashAttention, MoE, SONA,
self-consistency, agentdb, hnsw, MCP, etc.) plus full author/repo/bugs/
homepage metadata. Description rewritten to reflect actual surface
instead of the old "Neural module - SONA learning integration, neural modes"
stub.

Validation:
  - Both packages build clean (tsc, no errors)
  - 781 cli tests pass: 769 baseline + 6 bandit + 6 bridge
  - 132 neural tests pass: 44 algorithms + 39 patterns + 23 sona + 15 persistence + 9 self-consistency + 2 retrieval-path observability

Bumps:
  @claude-flow/neural   3.0.0-alpha.7 -> 3.0.0-alpha.8 (substantial -- new files, new keywords, new exports)
  @claude-flow/cli      3.7.0-alpha.6 -> 3.7.0-alpha.7 (now depends on neural@^3.0.0-alpha.8)
  claude-flow           3.7.0-alpha.6 -> 3.7.0-alpha.7
  ruflo                 3.7.0-alpha.6 -> 3.7.0-alpha.7

ALL SIX #1773 substrate-upgrade items now complete:
  Item 1: Persistence on the 3 classes        DONE
  Item 2: Retrieval-path observability        DONE
  Item 3: Seedable RNG                        DONE
  Item 4: Flash + MoE migration (this commit) DONE
  Item 5: selfConsistency orchestrator        DONE
  Item 6: Round-trip tests                    DONE

Refs #1773.

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

* feat(neural): finalize item 4 — neural pkg flash-attention + moe-router files + SEO keywords + cli-side wiring + version bumps

Companion to e94981db7 which deleted the cli copies but didnt include
the neural pkg new files / cli redirects / version bumps.

This commit completes #1773 item 4:
  - v3/@claude-flow/neural/src/flash-attention.ts (857 LOC, copied + exported)
  - v3/@claude-flow/neural/src/moe-router.ts (822 LOC, copied + exported)
  - v3/@claude-flow/neural/src/index.ts (export new modules)
  - v3/@claude-flow/neural/package.json (SEO keywords + version bump)
  - v3/@claude-flow/cli/src/mcp-tools/{neural-tools,hooks-tools}.ts redirected
  - v3/@claude-flow/cli/src/ruvector/index.ts (removed barrel re-export)
  - v3/@claude-flow/cli/package.json + claude-flow + ruflo version bumps

All 6 substrate items shipped. 781 cli + 132 neural tests pass.
Published 4 packages (@claude-flow/neural@3.0.0-alpha.8 + cli/claude-flow/ruflo@3.7.0-alpha.7).

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

* chore(cli): regenerate pnpm-lock.yaml for @claude-flow/neural@^3.0.0-alpha.8 (#1773)

Same drift class as #1774. The neural pkg version bump in cli/package.json
(alpha.7 -> alpha.8) needs the lockfile updated. CI uses --frozen-lockfile.

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

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-05 22:59:22 -04:00
rUvandReuven 0a0a246a62 feat(neural): Phase 1 convergence — cli depends on @claude-flow/neural + README cleanup (#1773) (#1774)
* feat(neural): Phase 1 convergence (#1773) + neural README cleanup

Adds @claude-flow/neural as cli runtime dep, ships a lazy-loading bridge
so cli can call NeuralLearningSystem from the package, and documents the
API gap Phase 2+ will cross.

Bridge: cli/src/memory/neural-package-bridge.ts (88 LOC). Lazy-loads NLS
on first call; idempotent; returns null on failure with CLAUDE_FLOW_DEBUG
log (same pattern as #1770).

Tests: 6 cases in __tests__/neural-package-bridge.test.ts. Lazy init,
idempotent cache, stats shape when loaded, reset(). Tolerant of vitest
module resolution.

Neural README: fixed 5 factual errors.
  - 9 RL Algorithms -> 7 (PPO/A2C/DQN/QLearning/SARSA/DT/Curiosity)
  - Quick-start domain development was invalid (valid: code/creative/
    reasoning/chat/math/general)
  - RL imports missing Algorithm suffix on PPO/A2C/DQN/SARSA
  - NeuralLearningSystem promoted to top quick-start
  - Added Integration with cli section

Validation: 781 cli tests pass (769 baseline + 6 bandit + 6 bridge).

Bumps all three packages to 3.7.0-alpha.6. Refs #1773.

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

* chore(cli): regenerate pnpm-lock.yaml for @claude-flow/neural dep (#1773)

Phase 1 commit added "@claude-flow/neural": "^3.0.0-alpha.7" to cli/
package.json but did not regenerate pnpm-lock.yaml. The Type Check V3
and Test V3 Packages CI jobs run with --frozen-lockfile and refused
the install. pnpm install --filter @claude-flow/cli --no-frozen-lockfile
locally to bring the lockfile in sync with the package.json change.

No source changes — just the lockfile.

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

---------

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-05 22:39:56 -04:00
ReuvenandRuFlo 3abfb5d0aa chore(verification): regenerate inventory + fix CRLF bug in extractor
Audit (via goal-planner agent) flagged 6 stale entries: 5 new MCP tools
in browser-session-tools.ts + 1 new agent (dossier-investigator in
ruflo-goals). Counts now 305 MCP / 49 CLI / 32 plugins / 44 agents.

Also fixes a latent bug in scripts/inventory-capabilities.mjs that
extractAgents() never extracted anything on Windows checkouts because
the frontmatter regex `/^---\n([\s\S]*?)\n---/` requires LF. On a
CRLF working tree it returns 0 agents while silently treating the
result as authoritative. Made the regex CRLF-tolerant
(`/^---\r?\n([\s\S]*?)\r?\n---/`) so the script is platform-portable;
this is what unblocked today's regen on a Windows machine.

Three files updated in lockstep:

  - scripts/inventory-capabilities.mjs  — CRLF-tolerant frontmatter
  - verification-inventory.json         — re-extracted, sorted, deterministic
  - verification.md                     — narrative coverage line + the
    full embedded markdown tables (lines 410+) regenerated from the
    same run. The signed JSON witness manifest above (lines 70-317,
    Ed25519 sig at line 313) is untouched, so the cryptographic
    signature remains valid.

The cli-core split (#1764) created v3/@claude-flow/cli-core/src/mcp-tools/
with 13 hooks_*/memory_* defs, but every name there is a duplicate of
what the umbrella's hooks-tools.ts / memory-tools.ts already register —
no new MCP surface, so the script's hard-coded MCP_TOOLS_DIR pointing
at v3/@claude-flow/cli/src/mcp-tools is currently correct. If cli-core
ever ships a unique tool, the script will silently miss it; worth a
follow-up to scan both dirs and de-duplicate.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 22:18:18 -04:00
rUvandReuven c8827c612c feat(router): Thompson sampling bandit replaces deterministic argmax (#1772) (#1772)
The intelligence dashboard showed the model router shipping 77% Opus on
0.30 avg complexity — over-routing to the most expensive tier on tasks
where Haiku would have been correct. Root cause: the deterministic
selectModel() ignored hooks_model-outcome history; outcomes were recorded
but never closed the loop.

This PR converts the router into a cost-adjusted Thompson sampling bandit
so that every model-outcome call updates posterior beliefs over Tier 1 /
Tier 2 / Tier 3, and the router auto-balances cost/quality from real data.

What changed in v3/@claude-flow/cli/src/ruvector/model-router.ts:

  - New BetaPrior interface + BANDIT_REWARDS table (cost-adjusted Bernoulli):
      Haiku-success     -> α += 1.0  (cheap + worked = best outcome)
      Sonnet-success    -> α += 0.7  (worked, somewhat expensive)
      Opus-success      -> α += 0.4  (worked but cost-suboptimal)
      Sonnet-escalated  -> α += 0.1  (partial credit)
      *-failure / haiku-escalated / opus-escalated -> α += 0.0
  - Pure-JS Beta sampler (Marsaglia-Tsang gamma + ratio + Box-Muller normal)
  - selectModel() now multiplies the deterministic complexity score by a
    Thompson draw θ_m ~ Beta(α_m, β_m) before argmax. Beta(1,1) cold-start
    so behavior matches the prior router until outcomes accumulate.
  - recordOutcome() updates priors with the cost-adjusted reward
  - RouterState extended with priors; loadState backfills defaults for
    pre-bandit state files; reset() and getBanditPriors() updated

Tests (__tests__/router-bandit.test.ts, 6 cases):
  - Beta(1,1) uniform prior on cold start
  - Cost-adjusted updates produce the right α/β deltas (success/failure/escalated)
  - Persistence: priors round-trip across router instances
  - Convergence: 100-trial workload at avg complexity 0.3 — Haiku posterior
    mean dominates Opus by N=100, and Haiku is picked more than Opus over
    the run
  - Recovery: even with adversarial cold-start outcomes, exploration pulls
    the bandit back to the optimal arm within 100 trials

Validation:
  - npm run build clean
  - 6 new bandit tests pass
  - 769 baseline tests still pass (parser, output, validate-input x 2,
    mcp-tools-deep, commands, cli, commands-deep, config-adapter x 2,
    p1-commands)
  - Benchmarked route() overhead: 45.5 µs/call (under the file headers
    documented "<100 µs" target). Adds ~3 sampleBeta() draws per route.

Bumps all three packages to 3.7.0-alpha.5:
  @claude-flow/cli   3.7.0-alpha.4 -> 3.7.0-alpha.5
  claude-flow        3.7.0-alpha.4 -> 3.7.0-alpha.5
  ruflo              3.7.0-alpha.4 -> 3.7.0-alpha.5

Visible result: the 77% Opus / 0.30 complexity mismatch corrects itself
within ~50 routing decisions, automatically. No manual threshold tuning.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-05 22:16:49 -04:00
rUvandReuven a7122a50e3 fix(intelligence): make Flash Attention + ruvllm coordinator stats truthful (#1770) (#1771)
Fix 1: neural_status.flashAttention was hardcoded false (neural-tools.ts:699).
Now probes ../ruvector/flash-attention.js loader so it agrees with
hooks_intelligence_stats on a single source of truth.

Fix 2: ruvllm SonaCoordinator reported unavailable despite @ruvector/ruvllm
being resolvable. Root cause: getIntelligenceStats() read ruvllmCoordinator
synchronously but it was populated only by an async init path the MCP
dashboard never awaits. Fix: lazy-init on stats query via sync createRequire,
gated on ruvllmLoaded. Cost: 7.7ms first call, 0.24us steady-state.

Also: CLAUDE_FLOW_DEBUG-gated log at the catch site so future regressions
of this shape do not disappear silently.

Verified: neural_status.features.flashAttention=true (was false);
hooks_intelligence_stats.ruvllm.coordinator=active (was unavailable);
769 cli tests pass.

Bumps all three packages to 3.7.0-alpha.4. Closes #1770

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-05 22:05:38 -04:00
ReuvenandRuFlo 55ae6ca57b chore(repo): remove stray root pnpm-lock.yaml
Root uses npm (package-lock.json + .github/workflows/ci.yml runs `npm ci`)
while v3/ uses pnpm workspaces (v3/pnpm-lock.yaml + v3-ci.yml runs `pnpm
install --frozen-lockfile` with cache-dependency-path: v3/pnpm-lock.yaml).
The root-level pnpm-lock.yaml was vestigial — no workflow, script, or
package.json `packageManager` field referenced it. It got regenerated in
899dcae93 alongside package-lock.json but only out of CI-noise habit, not
a real use case. Leaving it in would just guarantee drift from the npm
lockfile that's actually used.

Removes the 292KB file. Active lockfiles unchanged:

  - package-lock.json        — root, used by `npm ci` in ci.yml
  - v3/pnpm-lock.yaml        — used by `pnpm install` in v3-ci.yml

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 22:04:54 -04:00
ReuvenandRuFlo 6af8ef1006 docs(readme): refresh top-of-readme badge cluster
Three coordinated badge updates to the cluster between the project-meta
and the H1:

  - new "Codex Plugin" badge linking to npmjs.com/package/@claude-flow/codex,
    OpenAI brand purple #412991. Shields.io silently dropped `logo=openai`
    after simple-icons removed it for trademark reasons, so the OpenAI
    spirograph mark is embedded directly via `logo=data:image/svg+xml;base64,…`
    (verified shields.io renders an <image> element with the logo).

  - new "RuVector Agentic DB" badge linking to github.com/ruvnet/ruvector,
    cyan #06b6d4 with the graphql logo (graph-themed mark for a graph-RAG
    database).

  - "Claude Code" badge: green → Anthropic brand orange #D97757, plus
    `logoColor=white` so the anthropic mark stays legible on the warmer
    background. Brings the badge in line with anthropic.com's identity
    instead of using a generic Bootstrap green.

The cluster now reads top-to-bottom as: project meta (stars, license)
→ AI platform plugins (Claude Code, Codex) → underlying graph DB tech
(RuVector). Three semantic groups, clear hierarchy, no emoji noise in
the visible badge text.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 22:02:42 -04:00
ReuvenandRuFlo 003ce127b5 chore(repo): archive legacy v2/ codebase under archive/v2/
The pre-split claude-flow@2.x line is no longer built, tested, or
published from this repo — v3/@claude-flow/* is the active codebase.
Moving v2/ under archive/v2/ to make the inactive status visible from
the directory layout while preserving full git history (6,440 renames,
no content changes).

  - git mv v2 archive/v2
  - new archive/README.md explains what's frozen, where the v3
    equivalents live (cli, mcp-tools, hooks, memory), and a
    "don't add new code here" note
  - .npmignore: replace `v2/` rule with `archive/` so future archived
    items inherit the same exclusion automatically

Auditing for downstream impact: no active package.json, tsconfig, or
CI workflow imports from v2/. The only top-level reference was the
.npmignore rule (now updated). Forks pinned to claude-flow@2.x can still
reach the source via the git history regardless of folder name.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 22:02:21 -04:00
rUv fd4c3cb3c3 ci(windows): add daemon-survives-parent-exit regression test for #1766
Locks in the #1766 daemon-survives-parent-exit fix on Windows with a CI
regression test. Validated on three independent Windows machines:

  - local Windows 11 (Reuven, PID 25532 alive 246s post parent exit)
  - reporter Zarkk1zz's machine (per the original issue thread)
  - GitHub Actions windows-latest runner (PID 7072 alive 5s post parent exit,
    @claude-flow/cli@3.7.0-alpha.3)

The test is wired into the existing Build & Package (windows-latest) matrix
job in .github/workflows/ci.yml. It installs @claude-flow/cli@alpha into
RUNNER_TEMP, spawns the daemon via [System.Diagnostics.Process]::Start of
cmd.exe /c node $cli daemon start (chosen over Start-Process -Wait because
PS7 on pwsh hangs on inherited output streams), waits for the cmd parent
to exit (max 120s), then asserts Get-Process -Id $daemonPid still finds
the daemon 5s later. Original #1766 symptom was death within ~1s, so 5s
is well past any plausible delayed-teardown race.

Step-level timeout-minutes: 15 backstop. Phase markers (::group::) make
future regression debugging easy — the log shows exactly which phase
(install / spawn / verify / cleanup) failed and how long each took.

Also adds a Post-witness validations section to verification.md with full
runtime evidence, source/dist SHA-256 hashes, and an active reference to
the new CI step. Kept outside the signed Ed25519 JSON manifest above so
the existing witness signature stays valid.

Closes the testing gap noted in #1766's PR description ("zero direct
Windows verification of the fix").

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 19:23:50 -04:00
rUv 6f11cc794d Update README.md 2026-05-05 17:06:10 -04:00
rUv 7523e4daac Update README.md
🔌
2026-05-05 16:58:18 -04:00
rUv 1c266663c2 Revise Ruflo description in README
Updated the description of Ruflo to clarify its features and architecture.
2026-05-05 16:52:47 -04:00
rUv cb38098202 Update branding from Claude Flow to Ruflo 2026-05-05 16:50:01 -04:00
rUv 00039a833d Update README.md
a few updates to the intro, mention Cognitum.one
2026-05-05 16:49:08 -04:00
ReuvenandRuFlo 69e72d2e47 fix(daemon): break IPC pipe so background daemon survives parent exit on Windows (#1766)
The Liberation reporter (Zarkk1zz) diagnosed this cleanly. On Windows
+ Node 25, \`npx claude-flow daemon start\` reported success then the
spawned daemon died ~1s later. PR #1719 (v3.6.13) fixed the previous
\`spawn(..., {shell:true})\` bug, but the new \`fork(..., { stdio:
[..., 'ipc'] })\` path left the IPC channel open. \`child.unref()\`
releases the libuv handle but does NOT close the IPC pipe — and on
Windows, that pipe is what tied the daemon's lifetime to the parent
npx wrapper. When npx exited, the pipe tore down and the daemon went
with it.

Fix in v3/@claude-flow/cli/src/commands/daemon.ts:

  - detached: !isWin   →   detached: true   (every platform)
  - After child.unref(), call child.disconnect() (wrapped in try)
    to explicitly break the IPC pipe.

POSIX-tested locally: macOS daemon start/stop roundtrip works, daemon
survives parent exit (PID stays RUNNING after the parent shell exits).
Windows path is what changes meaningfully — detached:true gives the
child its own session/pgid, disconnect() severs the IPC pipe, daemon
genuinely stands on its own.

Bumps all three packages to 3.7.0-alpha.3:
  @claude-flow/cli   3.7.0-alpha.1 → 3.7.0-alpha.3
  claude-flow        3.7.0-alpha.1 → 3.7.0-alpha.3
  ruflo              3.7.0-alpha.2 → 3.7.0-alpha.3

(Skipped alpha.2 on cli/claude-flow because ruflo already used that
slot for the dep-range fix — keeping all three aligned at .3.)

Closes #1766

Co-Authored-By: RuFlo <ruv@ruv.net>
v3.7.0-alpha.3
2026-05-05 16:01:22 -04:00
ReuvenandRuFlo 4e1e2618eb fix(ruflo): bump @claude-flow/cli dep range to ^3.7.0-alpha.1
Ruflo's dep range \`>=3.0.0-alpha.1\` excluded 3.7.0-alpha.1 due to
npm's prerelease semver rule (a prerelease range only matches
prereleases of the same [major,minor,patch]). Result: \`npx ruflo@latest\`
correctly resolved 3.7.0-alpha.1 of the umbrella but bundled
@claude-flow/cli@3.6.30 instead of 3.7.0-alpha.1.

User-visible bug: \`npx ruflo@3.7.0-alpha.1 --version\` printed
\`ruflo v3.6.30\` instead of \`ruflo v3.7.0-alpha.1\`.

Fix: change dep to \`^3.7.0-alpha.1\` (caret allows future patches +
matches prereleases of 3.7.0). Bumps ruflo to 3.7.0-alpha.2 to ship
the corrected dep manifest.

Verified post-fix:
  npm pack ruflo@3.7.0-alpha.2
  npm install ./ruflo-3.7.0-alpha.2.tgz
  ./node_modules/.bin/ruflo --version
  → ruflo v3.7.0-alpha.1

@claude-flow/cli is at the right version inside ruflo's tree.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-05 13:58:08 -04:00
ReuvenandRuFlo 5c51df58cd chore(release): 3.7.0-alpha.1 — cli-core split alpha
Bumps three packages to 3.7.0-alpha.1 to ship the cli-core split:

  - @claude-flow/cli      3.6.30 → 3.7.0-alpha.1
  - claude-flow           3.6.30 → 3.7.0-alpha.1
  - ruflo                 3.6.30 → 3.7.0-alpha.1

Also published @claude-flow/cli-core@3.7.0-alpha.5 (was already on `alpha`
tag; this release promotes it to `latest` since the cli now depends on it).

What changed (architectural):
  - New @claude-flow/cli-core package (~156 KB unpacked, JSON-backed memory,
    no SQLite/HNSW/ONNX) for plugin authors who want fast cold-cache spawn
  - @claude-flow/cli now depends on cli-core, with 4 foundation modules
    (types, output, mcp-tools/types, mcp-tools/validate-input — 1,229 LOC)
    re-exported from cli-core instead of duplicated
  - 8 plugin scripts (6 cost-tracker + 2 ruflo-adr) opt into the lite path
    via CLI_CORE=1 — when set, they spawn cli-core@alpha (~1.5s cold) instead
    of cli@latest (~35s cold). 22.9× cold-cache speedup measured

What didn't change (intentional):
  - cli's full feature surface — same 26 commands, 140+ subcommands, same
    SQLite/HNSW/ONNX semantic search, same MCP tool registry. The lite path
    is OPT-IN for plugin authors; default behavior is unchanged.

Refs ADR-100, #1748 Issue 3, #1760, #1764

Co-Authored-By: RuFlo <ruv@ruv.net>
v3.7.0-alpha.1
2026-05-05 13:46:06 -04:00