1502 Commits
Author SHA1 Message Date
ruvandRuFlo cfc341706a fix(memory): #2120 — accept NULL status in memory_entries (legacy DBs) + 3.7.0 stable
Reporter @alexandrelealbess on WSL2 with alpha.81: `ruflo memory stats`
reported `Total Entries: 0` against a 251-row `.swarm/memory.db`, and
`ruflo status` falsely reported "not initialized". MCP and direct
SQLite queries both confirmed the data was intact and readable.

## Root cause

`WHERE status = 'active'` in both `bridgeListEntries`
(memory-bridge.ts:828) and `listEntries` (memory-initializer.ts:2544+)
excluded rows where the status column was NULL. Legacy DBs created
before the status column existed (or by auto-memory-bridge writes
that didn't set status) end up with NULL status after schema
migration, even though `ALTER TABLE ADD COLUMN ... DEFAULT 'active'`
SHOULD backfill — observed it doesn't in some paths.

`isInitialized()` in status.ts:47 required `.claude-flow/config.yaml`
exclusively — projects that ran only `ruflo memory init` (creates
`.swarm/memory.db` but no config.yaml) were reported as not
initialized.

## Fix (4 parts)

1. **`memory-bridge.ts:bridgeListEntries`** — `WHERE status = 'active'
   OR status IS NULL`. Treats NULL as "legacy-active" since the schema
   default is 'active' for any row inserted after the column existed.

2. **`memory-initializer.ts:listEntries`** — same NULL-acceptance in
   the raw sql.js fallback path (4 SQL prepares updated).

3. **`memory-initializer.ts:ensureSchemaColumns`** — belt-and-suspenders
   backfill: after ALTER TABLE, run `UPDATE memory_entries SET status =
   'active' WHERE status IS NULL`. Safe on already-correct DBs (0 rows
   updated).

4. **`status.ts:isInitialized`** — broadened to accept any of:
   `.claude-flow/config.yaml`, `.claude-flow/config.json`,
   `.swarm/memory.db`, `.claude/settings.json`. A project with any of
   these is meaningfully "initialized" for some flow.

## CI guard

New `scripts/smoke-memory-stats-legacy-db.mjs` builds a 251-row DB with
all-NULL status (mirroring the reporter's setup), runs `listEntries`,
and asserts:
  1. Fixture has 251 NULL-status rows
  2. `listEntries` returns total=251 (not 0)
  3. After listEntries, ensureSchemaColumns has promoted all rows to
     `status='active'`

Wired into `v3-ci.yml` as `memory-stats-legacy-db-smoke` with
path-filter on memory-bridge.ts, memory-initializer.ts, status.ts,
and the smoke itself.

## Version bump policy change

Per CLAUDE.md update on 2026-05-23 (alpha series ended at alpha.81),
this is the **first stable release: 3.7.0** — no more `-alpha.N`
suffixes. Legacy `alpha` + `v3alpha` dist-tags continue to point at
the latest stable for backward compat.

## Verification

- `npm test` in v3/@claude-flow/cli: 1999/2045 pass (46 skipped, 0 fail)
- `node scripts/smoke-memory-stats-legacy-db.mjs`: PASS — 4/4 assertions
- Build clean

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-24 11:13:50 -04:00
ruvandRuFlo a77814807c fix(daemon): #2110 — WSL2 silent-degrade triple fix + alpha.81
Reporter @tatyinandy-commits gave file:line for three compounding bugs
that made the daemon silently run local stubs on WSL2 even with a
working Claude Code CLI.

## 1. isAvailable() no longer caches false (headless-worker-executor.ts:634)

Before: a transient `claude --version` failure (5s timeout on WSL2 cold
start, AV scan, slow shell init) set `claudeCodeAvailable = false` for
the rest of the daemon lifetime. Even after the user fixed the
underlying cause, the daemon kept running local stubs.

After:
  - Only `true` is cached.
  - `false` results clear the cache so the next call re-probes.
  - The `catch` now surfaces the actual error message via `emit('status',
    { available: false, reason })` so operators can distinguish
    timeout/ENOENT/auth-failure.
  - New `CLAUDE_CODE_AVAILABILITY_TIMEOUT_MS` env var lets WSL2 users
    bump the 5s default.

## 2. WSL2 CPU-load gate defaults (worker-daemon.ts:152)

`/proc/loadavg` on WSL maps in Windows-side process counts and reports
values 100-1000x larger than the real Linux load. The default
`cpuCount * 0.8` gate trips every worker as "CPU load too high".

After: new static `WorkerDaemon.isWslEnvironment()` checks
`WSL_DISTRO_NAME`, `WSL_INTEROP`, and `/proc/sys/kernel/osrelease` for
"microsoft" or "wsl". When detected, `smartMaxCpuLoad` floors at 1000
so the gate is effectively disabled (real Linux load rarely exceeds 100
even under heavy contention).

## 3. runWorkerLogic now treats result.success===false as failure (worker-daemon.ts:1047)

`HeadlessWorkerExecutor.execute()` returns `createErrorResult({ success:
false, ... })` when `isAvailable()` is false, instead of throwing. The
previous try/catch never fired in that path; the result got persisted
as `mode: "headless"` despite being a stub. Downstream consumers
(`memory stats`, dashboards) couldn't distinguish a real AI run from
a fallback.

After: explicit `result.success === true` check. If falsy, log warn,
emit `headless:fallback`, and fall through to the local switch
identically to the throw path.

## Verification

- `npm run build` clean
- `WorkerDaemon.isWslEnvironment()` correctly returns `false` on macOS
- Both files re-import without error from dist

Versions bumped to 3.7.0-alpha.81 (cli + umbrella + ruflo wrapper).

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-23 15:18:45 -04:00
rUv 6bcee19adf Merge pull request #2115 from ruvnet/fix/2112-otlp-overrides-on-published-packages
fix(deps): #2112 — opentelemetry pins on published ruflo wrapper (alpha.80)
2026-05-23 13:10:11 -04:00
ruvandRuFlo 6ac3156dca fix(deps): #2112 — opentelemetry transitives overrides on ruflo wrapper (alpha.80)
@crayes reported `npx ruflo@3.7.0-alpha.79 mcp start` crashes with
`npm error Invalid Version:` on npm 11.x. Stack trace pointed at
`@opentelemetry/exporter-trace-otlp-grpc@0.52.1` — same #2018 /
#1921 / #1688 / #1595 / #1147 pattern (optionalDependencies ↔
peerDependencies overlap with empty version string crashes
arborist's `canDedupe` via `new SemVer('')`).

The opentelemetry pins existed in the **root** package.json since
the original fix landed, but the **published `ruflo` wrapper** —
which is what `npm install ruflo` actually consumes — has its own
overrides block and was missing them. End result: anyone following
the documented install path got the broken resolution.

This commit copies the otlp pin block from root to `ruflo/
package.json`, plus the four exporter-base transitives the stack
trace specifically named. 12 new entries total.

Also bumps all 3 packages to 3.7.0-alpha.80.

Could not reproduce on local npm 10.9.4 or npm 11.15.0 — the bug
is sensitive to the specific (npm patch, cache state, transitive
resolution order) triple. Pre-emptive ship under the
'fewer-knobs-for-arborist' policy that worked for the prior 5
recurrences of this pattern.

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-23 13:09:55 -04:00
rUv 0e1d26c11e fix(security): patch CVEs, shell injection, SSRF in ruflo (#2114)
* fix(security): patch CVEs, shell injection, SSRF in ruflo

CWE-78 Shell Injection (9 execSync → execFileSync conversions):
- .claude/helpers/github-safe.js: replace execSync(`gh ${args.join(' ')}`)
  with execFileSync('gh', args) in no-body and non-body code paths; the
  body-with-file path already used a tempfile but still joined args into
  a shell string for the final gh invocation.
- v3/@claude-flow/cli/.claude/helpers/github-safe.js: same fix (init-
  template copy mirrors the dogfood helper).
- v3/@claude-flow/mcp/.claude/helpers/github-safe.js: older variant
  without body-cap; apply execFileSync throughout.
- scripts/audit-supply-chain.mjs: execSync(`npm view "${name}"`) →
  execFileSync('npm', ['view', name, ...]) so a malicious package name
  in the allowlist JSON cannot inject shell commands.
- scripts/track-clones.mjs: execSync(`gh api repos/${repo}/...`) →
  execFileSync('gh', ['api', `repos/${repo}/...`]).
- plugins/ruflo-core/scripts/witness/perf.mjs: six execSync calls in
  benchmark runners (git rev-parse, pnpm pack ×2, npm init, npm pkg
  set, npm install <tarball>, node verify.mjs) converted to
  execFileSync with split argv arrays.
- v3/@claude-flow/browser/tests/e2e/browser-e2e.test.ts: execSync with
  template-literal command string replaced by execFileSync with a
  split-on-whitespace argv array.

CWE-918 SSRF (2 callCloudFunction guards):
- ruflo/src/mcp-bridge/index.js: add assertSafeUrl() before every
  callCloudFunction call — rejects non-HTTPS schemes and private/
  loopback IP ranges (10.x, 172.16-31.x, 192.168.x, 127.x, ::1,
  fc/fd ULA, localhost, *.local).
- ruflo/src/ruvocal/mcp-bridge/index.js: identical guard applied to
  the ruvocal variant of callCloudFunction.

npm audit: 0 vulnerabilities (package.json overrides already cover all
known CVEs; confirmed clean on this audit run).

All 10 github-safe injection smoke tests pass. No new test file failures
introduced vs pre-patch baseline (verified via vitest diff).

Co-Authored-By: claude-flow <ruv@ruv.net>

* fix(supply-chain): use execFileSync instead of undefined execSync in runCveAudit

The import on line 35 only brought in `execFileSync` from `node:child_process`,
but `runCveAudit` called the never-imported `execSync`, causing a ReferenceError
on every audit run and reporting 2 spurious CVE findings (one per audited package).

Replace `execSync('npm audit ...')` with `execFileSync('npm', [...args])` to
match the already-correct pattern used in `runPublisherTrustAudit` (line 303).
This also provides the CWE-78 shell-injection mitigation already documented in
that function's comment.

Full audit now exits 0: 0 CVE, 0 lockfile, 0 allowlist, 0 typosquat findings.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-05-23 04:52:41 -04:00
ruv a75d733f0f chore(release): 3.7.0-alpha.79 — guidance 2.70x quantization win
@claude-flow/guidance@3.0.0-alpha.4 — RaBitQ-style 1-bit signatures +
Hamming popcount. 2.70x retrieval speedup at N=1000, 32x memory
reduction. All 1,331 tests pass.
2026-05-22 07:18:07 -04:00
ruv 8e97433f6c chore(release): publish 3.7.0-alpha.78 — #2042 #2078 fixes 2026-05-21 22:53:01 -04:00
rUv a226f2bcd3 Merge pull request #2102 from ruvnet/fix/2042-agent-execute-provider-routing
fix(mcp): #2042 — agent_execute routes through v3 provider system (Anthropic / OpenRouter / Ollama)
2026-05-21 22:52:52 -04:00
ruvandRuFlo 94b98c90cd fix(mcp): #2042 — agent_execute routes through v3 provider system (Anthropic / OpenRouter / Ollama)
Reporter: @ummcke00. `agent_execute` and the underlying
`executeAgentTask()` runtime hardcoded a `fetch` to
`https://api.anthropic.com/v1/messages` and required
`ANTHROPIC_API_KEY` in the environment — even when the user had
configured OpenRouter, Ollama, or another OpenAI-compatible
endpoint via `.claude-flow/config.yaml`. Result: Ruflo was
unusable for every non-Anthropic deployment.

The companion `callAnthropicMessages()` helper already had a
two-branch dispatch (Anthropic + Ollama via #1725) but
`executeAgentTask()` predated it and never delegated.

## Fix

1. `callAnthropicMessages()` (the router):
   - Add OpenRouter branch detected via `RUFLO_PROVIDER=openrouter`
     or `OPENROUTER_API_KEY` set when Anthropic key absent. Mirrors
     the existing Ollama branch precedence.
   - New `callOpenAICompat()` helper — OpenAI-compat shape with
     `Authorization: Bearer <key>`, OpenRouter analytics headers,
     and logical model name translation (haiku/sonnet/opus →
     anthropic/claude-3.5-haiku/sonnet/3-opus).
   - Updated "no provider configured" error lists all three options.

2. `executeAgentTask()`:
   - Replace the inline Anthropic fetch with `await
     callAnthropicMessages({...})`. The agent registry coupling
     (store load, status updates, lastResult persistence) stays.
   - Surface a #2042-aware remediation pointer when the router
     reports no provider is configured.

3. New CI smoke `scripts/smoke-agent-execute-providers.mjs` (5
   checks):
   - executeAgentTask no longer contains the bypass fetch
   - OPENROUTER_API_KEY env var is referenced
   - callOpenAICompat helper exists
   - No-provider error lists Anthropic + OpenRouter + Ollama
   - Behavioral: OPENROUTER_API_KEY set → dispatch reaches the
     openrouter branch (auth error names openrouter, not Anthropic)

Wired into v3-ci.yml as `agent-execute-providers-smoke` with
path-filter on `agent-execute-core.ts` and the smoke itself.

Local validation (against built dist):
  - No provider set         → "No LLM provider configured..."
  - OPENROUTER_API_KEY only → "openrouter API error 401: Missing
                              Authentication header"
  - RUFLO_PROVIDER=openrouter
    + both keys             → "openrouter API error 401..."
    (Anthropic key is bypassed — explicit RUFLO_PROVIDER wins)

`workflow-tools.ts` `workflow_execute` also calls
`executeAgentTask()` and gets the fix transitively with no
direct edits.

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 22:39:45 -04:00
ruvandRuFlo 6b7d64bcb5 fix(init): #2078 — generated CLAUDE.md rule overrides Claude Code's default Co-Authored-By trailer
ruvnet's response to @shaal on #2078 acknowledges that the
settings-generator opt-in (#2079 → ruflo-bot email) only fixes half
the surface. The other half is the Claude Code Bash tool's built-in
commit-message instructions, which suggest `Co-Authored-By: RuFlo
<ruv@ruv.net>` regardless of project settings. Users have to
explicitly tell Claude to ignore that suggestion.

This patch adds a rule to the generated CLAUDE.md that does exactly
that — every fresh `ruflo init` now writes:

  - NEVER add a `Co-Authored-By` trailer to user commits unless this
    project's `.claude/settings.json` has `attribution.commit` set
    (#2078). The Claude Code Bash tool may suggest one in its default
    commit-message template — ignore it. `Co-Authored-By` is semantic
    authorship attribution under git/GitHub convention; the tool is
    the facilitator, not a co-author.

The agent reads this on every session start, so the Bash-tool default
gets overridden at the project level without the user having to
discover the override themselves.

Settings-level (`attribution.commit`) opt-in path still works for
users who want the trailer.

Verified: `ruflo init --preset default` in a clean tmpdir produces a
CLAUDE.md containing the rule.

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 22:33:58 -04:00
ruv 2bc91f7ccc chore(release): publish 3.7.0-alpha.77 — #2098 #2093 #2085 fixes 2026-05-21 19:22:17 -04:00
ruvandRuFlo ad429d1545 fix(cli,daemon,mcp): #2098 #2093 #2085 — three regressions reported on alpha.75
Three independent bugs across three subsystems, all reproducible on
alpha.76 today. Each fix is small and localized.

#2098A — `--no-global` flag silently ignored (@pierrefuseau)
  The parser handles `--no-foo` by stripping the prefix and storing
  `flags.foo = false` (parser.ts:291-294), not by storing
  `flags['no-foo'] = true`. The consumer at init.ts:190 read the
  wrong key (`flags['no-global']`), so the flag was always undefined
  and the global ~/.claude/CLAUDE.md got modified anyway.
  Fix: read `flags['global'] === false` (the canonical form) AND
  keep accepting the literal-key form for any caller passing flags
  programmatically.

#2098B / #2093 — Daemon subprocess group not killed (@pierrefuseau, @maxstefanakis1114)
  headless-worker-executor.ts spawns `claude --print` without
  `detached: true`. Grandchildren (MCP stdio bridges, plugin tools)
  belong to the parent's process group, so `child.kill()` on
  timeout only signals the head — grandchildren get reparented to
  init and leak. Combined with the queue-file path the alpha.73
  `.processed/` rename already fixed, the surface was 90% closed
  but the residual gap was the missing tree-kill.
  Fix: spawn with `detached: true` (POSIX only — Windows process
  groups don't work the same way), then signal the group with
  `process.kill(-pid, sig)` instead of `child.kill(sig)`. Fallback
  to plain `child.kill` if -pid kill fails for any reason.

#2085 — agent_spawn not in swarm_status.agents (@seo-yas)
  agent_spawn writes only to the agent store (agent-tools.ts:275),
  swarm_status reads only from the swarm store. The two stores are
  never bridged. Every topology is affected, not just hierarchical
  as the reporter assumed. Also the schema never accepted
  `swarmId` — which is why their 5 parameter-shape variants all
  failed identically.
  Fix: add `swarmId` to the agent_spawn input schema (optional;
  defaults to most-recently-created swarm), then after writing the
  agent store, also push the agentId into `swarm.agents`. Idempotent
  so retries don't duplicate. Exports `loadSwarmStore`/
  `saveSwarmStore` from swarm-tools.ts so agent-tools.ts can write
  to the same on-disk store the swarm tools read from.

Build: `npm run build` in v3/@claude-flow/cli — clean.
Existing smokes: init-bundle-invariants + github-safe-injection PASS.

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 19:12:52 -04:00
ruvandRuFlo 1ce81a3e35 chore(release): publish 3.7.0-alpha.76 — ADR-128 init bundle reduce + refactor
ADR-128 (PR #2096, PR #2097) ships:
- 29+ canonical skills now bundled inside @claude-flow/cli npm package
  (closes the source-of-truth gap surfaced by ADR-127)
- 9 forked agents removed from init template (let plugins own them)
- agents.all default flipped true → false; --all-agents opt-in flag
  (default agent count drops 98 → 17)
- 9 truly-orphan flow-nexus/ command files deleted; 78 ambiguous
  ones promoted to first-class COMMANDS_MAP keys
- New smoke-init-bundle-invariants.mjs + CI wiring

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 15:53:10 -04:00
ruv 9a66b2996b feat(ci): #2095 ADR-128 Phase 5 — init-bundle-invariants smoke (no orphans, no plugin-init overlap)
Adds scripts/smoke-init-bundle-invariants.mjs with three assertions:
  1. Every subdir under .claude/{commands,agents}/ has a COMMANDS_MAP or
     AGENTS_MAP entry (zero orphaned dirs).
  2. Every skill in SKILLS_MAP has SKILL.md or README.md in the package
     (catches Phase 1 regression).
  3. No init-template agent shares a basename with a plugin agent (ADR-128
     Phase 2 dedup invariant).

Also copies the 5 remaining SKILLS_MAP-referenced skills that were not in
the 29 Phase-1 core/agentdb/github/v3 set (browser, flow-nexus-neural,
flow-nexus-platform, flow-nexus-swarm, dual-mode) so assertion 2 passes.

Wires the smoke into v3-ci.yml as init-bundle-invariants-smoke job with
path filters on .claude/**, src/init/**, plugins/*/agents|skills|commands/**,
and the smoke itself.

Smoke matrix: init-bundle-invariants=PASS, deprecated-actions=PASS,
github-safe-injection=PASS, github-actions-pins=PASS,
attribution-opt-in=PASS, ruvllm-wasm-auto-init=PASS,
plugin-registry-signature=PASS — no regressions.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 15:41:47 -04:00
ruv 0740b2fa1d feat(init): #2095 ADR-128 Phase 4 — delete 9 orphan command files (unreachable from COMMANDS_MAP)
Deletes commands/flow-nexus/ (9 files) — the only directory the ADR
explicitly marks for deletion. Promotes all remaining orphaned substrate
dirs to first-class COMMANDS_MAP keys: agents, coordination, hiveMind,
memory, swarm, workflows (default true) and pair, training, streamChain,
truth, verify (opt-in, default false). Adds matching CommandsConfig
interface fields and DEFAULT_INIT_OPTIONS entries.

Deviation from task's estimated "87 orphan deletions": the ADR Phase 3
resolution for the other 78 orphaned files is promotion (add COMMANDS_MAP
key), not deletion. Deleting substrate commands like swarm/, memory/,
hive-mind/ would be a regression. Only flow-nexus/ (domain-specific,
plugin-owned) is deleted. Ambiguous-as-substrate files preserved.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 15:37:56 -04:00
ruv 34e7b1e9f6 feat(init): #2095 ADR-128 Phase 3 — opt-in domain-specific agent categories (98 → ~17 by default)
Changes DEFAULT_INIT_OPTIONS.agents: github, hiveMind, v3, optimization
now default false; core, consensus, swarm, sparc, testing remain true.
agents.all flipped from true to false. Adds --all-agents CLI flag to
restore the full set when users explicitly opt in.

Default install now ships ~17 substrate agents instead of 98. Full set
(89 after Phase 2) available via: ruflo init --all-agents

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 15:35:42 -04:00
ruv 865c901af2 feat(init): #2095 ADR-128 Phase 2 — remove 9 forked agents (let plugins own them)
Deletes the 9 init-template agent files that have diverged from their
canonical plugin counterparts. Plugins now own: coder.md (ruflo-core),
researcher.md (ruflo-core), reviewer.md (ruflo-core), tester.md
(ruflo-testgen), memory-specialist.md (ruflo-rag-memory),
security-auditor.md (ruflo-security-audit), sparc-orchestrator.md
(ruflo-sparc), goal-planner.md (ruflo-goals), adr-architect.md
(ruflo-adr). AGENTS_MAP not modified: map values are directory names;
the copy function picks up whatever files remain in those dirs.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 15:33:30 -04:00
ruv c63905e6ae feat(init): #2095 ADR-128 Phase 1 — ship 29 skills inside @claude-flow/cli package
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 15:32:28 -04:00
ruvandRuFlo b4e1776675 fix(github): #2089 — complete Phase 3 (5 init-template agents missed) + strengthen smoke + alpha.75
Post-publish validation of alpha.74 found 5 init-template agents still
shipping `actions/checkout@v3`:

  v3/@claude-flow/cli/.claude/agents/github/release-manager.md
  v3/@claude-flow/cli/.claude/agents/github/swarm-pr.md
  v3/@claude-flow/cli/.claude/agents/github/release-swarm.md
  v3/@claude-flow/cli/.claude/agents/github/repo-architect.md
  v3/@claude-flow/cli/.claude/agents/github/workflow-automation.md

The Phase 3 sed in PR #2094 only scanned `.claude/agents/github/`
(dogfood) and `v3/@claude-flow/cli/.claude/commands/github/` (init
commands). It missed the *init-template agents* subtree at
`v3/@claude-flow/cli/.claude/agents/github/` and the *dogfood commands*
at `.claude/commands/github/`.

`smoke-deprecated-actions.mjs` had the same scan-tree gap, which is
why CI didn't catch this. Smoke now scans all 5 trees:

  .claude/agents/github/
  .claude/skills/
  .claude/commands/github/                                  (added)
  v3/@claude-flow/cli/.claude/agents/github/                (added)
  v3/@claude-flow/cli/.claude/commands/github/

Verified: `npm pack @claude-flow/cli@3.7.0-alpha.74 && grep ... @v3`
showed the 5 missed files in the published tarball.

Versions bumped to 3.7.0-alpha.75 across cli + claude-flow umbrella + ruflo wrapper.

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 14:37:43 -04:00
ruv 1eece3afc0 feat(init): #2089 ADR-127 Phase 4 — attribution opt-in across 19 github command files + last-updated stamps
Remove 13 hardcoded "Generated with Claude Code" attribution strings from
6 github command/agent/skill files (dogfood + init-template copies):
  .claude/agents/github/{release-manager,sync-coordinator,issue-tracker}.md
  .claude/skills/github-project-management/SKILL.md
  v3/@claude-flow/cli/.claude/commands/github/{release-manager,sync-coordinator,issue-tracker}.md

Add <!-- last-updated: 2026-05-21 — ADR-127 --> stamps to the top-level
code-block boundary of each edited file so readers can trace the change
back to this ADR without opening git log.

Export ATTRIBUTION_FOOTER from helpers-generator.ts (ADR-127 §opt-in):
when options.attribution === true, materialise a .claude/helpers/attribution
file during init so PR templates can append it conditionally, without
hard-wiring the emoji into every user's commit history (#1670).

Add scripts/smoke-attribution-opt-in.mjs + github-attribution-opt-in-smoke
CI job: static scan that fails if the 🤖 emoji pattern reappears in the
three github-scoped template trees — prevents copy-paste regression.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 14:19:35 -04:00
ruv 388665d67c feat(ci): #2089 ADR-127 Phase 3 — bump actions/checkout + setup-node to v4 + deprecated-actions smoke
Replace all actions/checkout@v3 and actions/setup-node@v3 refs with @v4
across .claude/agents/github/, .claude/skills/github-*/,
and v3/@claude-flow/cli/.claude/commands/github/ (19 files total).

Add scripts/smoke-deprecated-actions.mjs: static scan that fails if any
of the deprecated refs (checkout@v3, setup-node@v3,
create-release@*, upload-release-asset@*, softprops/action-gh-release@v1)
reappear in scope — preventing copy-paste regression from blog posts or
AI-generated YAML snippets.

Wire github-deprecated-actions-smoke job and path filter into v3-ci.yml
so every future PR touching the github surface re-runs this gate.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 14:11:32 -04:00
ruv 7d2fc001ec feat(security): #2089 ADR-127 Phase 2 — github-safe maxBuffer + agent frontmatter tools: + swarm-pr/issue injection fix
github-safe.js (both copies — dogfood + init-template)
  Adds GITHUB_SAFE_VERSION='1.0.0' constant for smoke assertions.
  Adds explicit 256KB body cap (MAX_BODY_BYTES): rejects oversized bodies
  with exit 1 before any temp-file write, matching the GitHub API body
  field limit documented in ADR-127.  Adds strict error handling: all
  execSync calls wrapped in try/catch, cleanup in finally.  Adds
  GITHUB_SAFE_DRY_RUN=1 env-var for smoke tests to skip gh exec.

github-setup.sh (both copies)
  Prepends set -euo pipefail.  Replaces bare `gh auth status &>/dev/null`
  with a check that parses "Logged in" and "repo" scope from the output.
  Adds security rationale comment explaining why each flag is needed.

Agent frontmatter WebFetch removal (dogfood copies only — init-template
commands don't have frontmatter; the relevant change there is the injection
fix below):
  release-manager.md  — removes WebFetch (keeps Write for CHANGELOG)
  release-swarm.md    — removes WebFetch (keeps Write for CHANGELOG)
  repo-architect.md   — removes WebFetch

All 13 agents already have explicit tools: lines; only the 3 above had
WebFetch.  No agent in scope now has WebFetch in its tools: list.

swarm-pr.md + swarm-issue.md (BOTH dogfood .claude/agents/github/ AND
init-template v3/@claude-flow/cli/.claude/commands/github/):
  Replaces unquoted ${{ github.event.comment.body }} interpolated into
  --comment "..." with mktemp + printf + grep + --comment-file pattern.
  Replaces unquoted ${{ github.event.label.name }} == "swarm-ready" with
  mktemp + printf + grep -qx pattern.  Closes prompt-injection path where
  a PR comment with shell metacharacters could execute attacker-controlled
  shell in a pull_request-triggered workflow.

smoke-github-safe-injection.mjs updated:
  Upgrades the >256KB test case from "note" (Phase 1 red) to "ok" (Phase 2
  green) now that the 256KB cap is enforced.

Acceptance checks:
  node scripts/smoke-github-safe-injection.mjs  → all 5 cases pass
  node scripts/smoke-github-actions-pins.mjs    → ok (no regressions)
  grep -r 'github.event.comment.body.*--comment' .claude/agents/ v3/@claude-flow/cli/.claude/
  → exit 1 (no matches)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-21 14:06:59 -04:00
ruvandRuFlo bc1f587c0f fix(mcp): #2086 — auto-init ruvllm WASM in loadRuvllmWasm + CI regression guard
Reported by @seo-yas. The `loadRuvllmWasm()` helper in
`v3/@claude-flow/cli/src/mcp-tools/ruvllm-tools.ts` did a bare
`import('../ruvector/ruvllm-wasm.js')` and never called
`initRuvllmWasm()`. Result: `_wasmReady` stayed false even after
`ruvllm_sona_create` / `ruvllm_microlora_create` / `ruvllm_hnsw_create`,
which left every downstream `sona_*` / `microlora_*` / `hnsw_*` call
either erroring inside the WASM module or returning empty.

`ruvllm_status` reported `wasm.available=true, wasm.initialized=false`
forever because nothing triggered `initSync({ module: wasmBytes })`.

Fix: fold `await mod.initRuvllmWasm()` into `loadRuvllmWasm()`. The
init function is idempotent (early-returns on `_wasmReady`), so the
cost after the first call is one boolean check. `ruvllm_status`
deliberately uses a separate `loadRuvllmWasmModule()` helper so the
diagnostic path stays callable when init has not been attempted (a
diagnostic that triggers the very thing it diagnoses is worse than
useless).

CI guard: `scripts/smoke-ruvllm-wasm-auto-init.mjs` statically asserts
all 12 invariants the fix relies on. Wired into v3-ci.yml as
`ruvllm-wasm-auto-init-smoke` with path filters on the two source files
and the smoke itself, so future refactors that drop the `await
mod.initRuvllmWasm()`, reroute `ruvllm_status` through the auto-init
loader, or add a new `ruvllm_*` tool that bypasses `loadRuvllmWasm()`
without an instance lookup will fail the check before merge.

Versions bumped to 3.7.0-alpha.73 (cli, claude-flow umbrella, ruflo).

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 12:36:22 -04:00
ruvandRuFlo 10db8e4595 docs(readme): add RuFlo Agentic Appliance banner linking to cognitum.one/appliance
Place above the ruFlo Summit badge in the three customer-facing READMEs
(repo root, ruflo wrapper package, @claude-flow/cli package). Same
hosting pattern as the summit asset.

Co-Authored-By: RuFlo <ruflo-bot@users.noreply.github.com>
2026-05-21 00:57:59 -04:00
ruvandruflo-bot 7bdcd58dba fix(init): #2078 — use no-reply bot email for opt-in Co-Authored-By
The opt-in attribution feature (#1670) used `ruv@ruv.net`, a personal
email that GitHub maps to the maintainer's contributor graph. When
users opt in (or have legacy `.claude/settings.json` from before #1670),
the trailer silently adds ruvnet as a contributor to their repos.

Switch to `ruflo-bot <ruflo-bot@users.noreply.github.com>` — GitHub's
no-reply convention excludes the address from contributor graphs and
maps it to a tool identity rather than a person.

The default (no `--attribution` flag) still writes no trailer at all
per #1670. This is purely about what's written when the user opts in.

Also updates the same trailer format in three sibling locations that
hardcoded the personal email:
- v3/@claude-flow/cli/.claude/settings.json (this repo's local settings,
  eating our own dog food)
- v3/@claude-flow/codex/src/generators/agents-md.ts (codex AGENTS.md
  template generator)
- v3/@claude-flow/codex/AGENTS.md (the generated AGENTS.md, regenerated
  to match the template change)

Out of scope: the harness portion of #2078 (Claude Code runtime trailer)
is a separate concern handled by the Claude Code itself, not by ruflo.

Refs #2078

Co-Authored-By: ruflo-bot <ruflo-bot@users.noreply.github.com>
2026-05-20 16:21:57 -04:00
ruv fa790f0963 chore(release): publish 3.7.0-alpha.72 — #2073 memory export/retrieve fix
Bumps @claude-flow/cli, claude-flow, ruflo to 3.7.0-alpha.72 carrying
the fix for #2073 (memory export returned null values; new --value-only
pipe-friendly retrieve flag).

Published:
- @claude-flow/cli@3.7.0-alpha.72 (tags: alpha, latest, v3alpha)
- claude-flow@3.7.0-alpha.72 (tags: alpha, latest, v3alpha)
- ruflo@3.7.0-alpha.72 (tags: alpha, latest, v3alpha)

Verified against the published artifact: `npx @claude-flow/cli@3.7.0-alpha.72
memory export -o out.json -f json -n test` now writes the real entry
value as a parseable JSON string (was null in alpha.71).

Refs #2073

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-20 09:38:18 -04:00
ruv 0c31cbad48 fix(memory): #2073 — export returns real value + --value-only pipe-friendly retrieve
Two related fixes for the cost-tracker reporting pipeline:

1. `memory export -f json` now writes the real entry value instead of
   null. Root cause: the export tool used `(e as { value?: unknown }).value`
   but `listEntries` only returned metadata — the SELECT pulled `content`
   from SQL but the result-mapping dropped it. Fix: `listEntries` /
   `bridgeListEntries` now accept `includeContent: true` to opt into
   returning the full content string, and `memory_export` passes that
   flag + writes `e.content` to the exported `value` field.

2. `memory retrieve --value-only` emits ONLY the raw value to stdout —
   no box, no banner, no decoration — designed for piping into JSON.parse
   without any cleanup. Closes the third suggested fix from #2073.

3. `memory retrieve --format json` was already wired in the handler but
   wasn't discoverable through `--help`. Removed dead per-command option
   override (the global --format from parser.ts:78 already handles it
   with choices: ['text','json','table']) and documented it in a comment.

Backward compat: when callers don't pass `includeContent`, listEntries
omits the field entirely (no behavior change for the 14 existing
call sites that just want metadata). When `includeContent: true`, the
returned id is no longer truncated to 20 chars — exporters need the
full id for round-trip via memory_import.

Verification (against the fixed dist):

  $ node bin/cli.js memory store -n test -k x \
      --value '{"sessionId":"abc","byTier":{"opus":1.23}}'
  $ node bin/cli.js memory retrieve -n test -k x --value-only \
      | node -e "console.log(JSON.parse(require('fs').readFileSync(0,'utf8')))"
  { sessionId: 'abc', byTier: { opus: 1.23 } }                       # ✅

  $ node bin/cli.js memory export -o out.json -f json -n test
  $ jq -r '.entries[0].value | fromjson' out.json
  { "sessionId": "abc", "byTier": { "opus": 1.23 } }                 # ✅

Refs #2073. Restores the ruflo-cost-tracker reporting pipeline
(cost summary / report / conversation / budget / export / federation /
optimize — all of which depend on a working memory read path).

Closes #2073

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-20 09:34:49 -04:00
ruv 27e91c7fb5 chore(release): publish 3.7.0-alpha.71 + @claude-flow/memory@3.0.0-alpha.18
Bumps @claude-flow/cli, claude-flow, ruflo to 3.7.0-alpha.71 and
@claude-flow/memory to 3.0.0-alpha.18. This release ships ADR-125
end-to-end — `@claude-flow/memory` consolidation across both PR A
(#2062, phases 1+2+6+7) and PR B (#2063, phases 3+4+5).

Published artifacts:
- @claude-flow/cli@3.7.0-alpha.71 (tags: alpha, latest, v3alpha)
- claude-flow@3.7.0-alpha.71 (tags: alpha, latest, v3alpha)
- ruflo@3.7.0-alpha.71 (tags: alpha, latest, v3alpha)
- @claude-flow/memory@3.0.0-alpha.18 (tags: alpha, latest, v3alpha)

ADR-125 delivered:
- Canonical MemoryService entry point (UnifiedMemoryService deprecated)
- Real HybridBackend default wired (ADR-009 fulfilled)
- Persistent HNSW with snapshot/restore on close + every Nth write
- MemoryConsolidator (sweepExpired + dedup + compactHnsw + autoRun)
- Graceful retrieval degradation + FTS5 keyword fallback
- Runnable benchmarks with measured baseline
- RuVector boundary cleanup + no-stray-DB CI smoke

Test count: 367 → 378 (PR A) → 403 (PR B) across 15 test files.
All 8 ADR-125 acceptance criteria locked in.

Closes #2061

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-19 18:47:16 -04:00
ruv 4de8846c75 chore(release): publish 3.7.0-alpha.70 — CWE-347 security fix
Bumps @claude-flow/cli, claude-flow, ruflo to 3.7.0-alpha.70 and
publishes to npm. This release ships the CWE-347 plugin-registry
signature verification fix landed in #2060 (Closes #1922).

Published artifacts:
- @claude-flow/cli@3.7.0-alpha.70 (tags: alpha, latest, v3alpha)
- claude-flow@3.7.0-alpha.70 (tags: alpha, latest, v3alpha)
- ruflo@3.7.0-alpha.70 (tags: alpha, latest)

Also includes #2056 — agentic-flow ^2.0.12 → ^2.0.13 (Windows
onnxruntime lazy-load fix from upstream PR ruvnet/agentic-flow#155).

Verification:
- 13-check CWE-347 regression smoke green
- Root npm audit: 0 vulnerabilities
- Supply-chain audit (5 layers): no hard-fail findings
- All 65 CI checks green on PR #2060 pre-merge

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-19 16:54:09 -04:00
ruvandAeon 82edec30f9 fix(security): #1922 — verify plugin-registry Ed25519 signature properly (CWE-347)
The plugin-registry signature verifier in
`v3/@claude-flow/cli/src/plugins/store/discovery.ts` was a stub that
returned `true` whenever the served `registryPublicKey` field started
with `"ed25519"`. The call site only `console.warn`ed on failure and
continued to use the unverified registry. With `requireVerification:
true` (the default), a network adversary on the path to an IPFS
gateway could swap the served registry and have a user install
attacker-controlled plugin tarballs with filesystem+network+hooks
permissions.

Patch (originally proposed in #1922 by @aaronjmars; CWE-347):
- Import `verifyEd25519Signature` from `transfer/ipfs/client.ts` (the
  real Ed25519 verifier already lived there, just wasn't wired in).
- Replace the stub with an async verifier that mirrors `signRegistry()`
  in `scripts/publish-registry.ts:127-151`: strip `registrySignature` +
  `registryPublicKey` from the registry copy, `JSON.stringify`, verify
  signature against `expectedPublicKey`.
- Pin verifier to the caller-supplied `expectedPublicKey` (the trusted
  pinned key from `DEFAULT_PLUGIN_STORE_CONFIG`), NOT the self-asserted
  `registry.registryPublicKey` (which an attacker can swap too).
- Update call site to `await` the now-async verifier AND fail closed
  (return demo registry on failure rather than warn+continue).

CI guards (this commit):
1. `scripts/smoke-plugin-registry-signature.mjs` — 13-check regression
   smoke covering: (a) static contract on discovery.ts (correct import,
   canonicalization, pinned-key call, no stub revival), (b) Ed25519
   crypto round-trip matching signRegistry()'s scheme (valid passes,
   tampered fails, empty fields fail, swapped served key cannot defeat
   the trusted pin), (c) call-site byte check (await + fail-closed).
2. `plugin-registry-signature-smoke` job in `v3-ci.yml` runs the smoke
   on push + PR (including from forks now that pull_request branches
   include `develop`).
3. Path filters added for `discovery.ts`, `transfer/ipfs/client.ts`,
   `publish-registry.ts`, and the smoke itself so any future drift in
   the signing scheme triggers re-verification.

Acceptance:
- `node scripts/smoke-plugin-registry-signature.mjs` → 13/13 pass
- Build of `@claude-flow/cli` clean (no new typecheck errors)
- Root npm audit: 0 vulnerabilities
- Supply-chain audit (5 layers): no hard-fail findings

Sibling `verifyRegistrySignature` stub at
`transfer/store/registry.ts:278` is dead code today; tracked as a
follow-up (delete-if-dead or rewrite when wired up).

Co-Authored-By: Aeon (aaronjmars) <aeon@aaronjmars.com>
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-19 16:39:54 -04:00
ruv 9a8c9c464f fix(supply-chain): #2046 — eliminate all root-level HIGH/CRITICAL CVEs
Before:
  Root npm audit: 13 HIGH/CRITICAL across 25 vulns
  @claude-flow/browser fresh install: similar transitive chain
  Audit script reported 0 unaccepted only because it correctly scopes
  to direct deps — but transitive surface was hostile

Changes:

1. Bump agentdb to 3.0.0-alpha.14 (was alpha.10/13 across repo)
   - 3.0.0-alpha.14 dropped @opentelemetry/sdk-node from its
     dependencies block (still in optionalDependencies; overrides handle
     that). Eliminates the @opentelemetry/sdk-node CVE chain via direct
     dep replacement.
   - Updated: v3/@claude-flow/memory, v3/@claude-flow/cli, root.

2. Bump agentic-flow 2.0.7 → 2.0.11 (root) and ^2.0.3 → ^2.0.11
   (v3/@claude-flow/browser). Latest 2.x; closer to a Xenova-clean
   release when upstream ships it.

3. Add npm overrides at the root + at v3/@claude-flow/browser package
   (overrides do not cascade across separate npm projects, so browser
   needs its own block for standalone publish):
     @opentelemetry/sdk-node              >= 0.218.0  (was <0.217.0 CVE)
     @opentelemetry/auto-instrumentations >= 0.75.0
     @opentelemetry/exporter-prometheus   >= 0.217.0
     axios                                >= 1.13.2
     fast-uri                             >= 3.1.0
     vite                                 >= 6.4.6
     ws                                   >= 8.18.4

   Plus the existing browser-package overrides for hono / undici / tar /
   minimatch / picomatch / flatted / etc. — copied from root to keep
   the standalone npm-published install clean.

After:
  Root npm audit: 0 vulnerabilities (13 HIGH/CRITICAL → 0)
  Supply-chain audit: PASS (0 unaccepted direct-dep findings)
  Browser tests:  230/230 passing
  Graph-intel tests: 104/104 passing

One CVE remains in v3/@claude-flow/browser's STANDALONE fresh install
(end-user `npm install`): @xenova/transformers via agentic-flow direct
dependency. Cannot fix without upstream agentic-flow shipping a Xenova-
free release. agentic-flow@3.0.0-alpha.2 still has it. Documented in
accepted-findings.json under cve[] with:
  tracking: ADR-121 Phase 4
  expiresAt: 2026-08-19 (audit re-fails if upstream still hasn't shipped)
  rationale: browser package does not invoke embedding code paths

This is the right level of triage. The audit doesn't lie about it — it
just doesn't block our shipping while we wait for upstream.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-19 08:34:23 -04:00
ruv 5b71c7ac13 release(alpha.43+44): pin neural→sona@0.1.5, republish modules w/ standalone READMEs, add npm download badges everywhere (#2022)
This commit closes the chain started in ca0a6fa5c (standalone use recipes
landed in repo but never reached npm because no version bumps shipped).

## Changes

### Module version bumps (alpha.43)
- @claude-flow/memory     → 3.0.0-alpha.17  (republish standalone use README)
- @claude-flow/embeddings → 3.0.0-alpha.18  (republish standalone use README)
- @claude-flow/security   → 3.0.0-alpha.8   (republish standalone use README)
- @claude-flow/neural     → 3.0.0-alpha.9   (pin @ruvector/sona to 0.1.5,
                                             republish standalone use README)
- @claude-flow/cli        → 3.7.0-alpha.43  (repin to new modules above)
- claude-flow             → 3.7.0-alpha.43  (umbrella)
- ruflo                   → 3.7.0-alpha.43  (umbrella)

### Umbrella bump (alpha.44) — npm download badges
- @claude-flow/cli        → 3.7.0-alpha.44
- claude-flow             → 3.7.0-alpha.44
- ruflo                   → 3.7.0-alpha.44

### Neural sona pin (root fix for #2022)
@claude-flow/neural alpha.8 had `"@ruvector/sona": "latest"`, and
@ruvector/sona@0.1.6 (current latest on npm) shipped as an empty publish
— README + package.json only, no index.js or native bins. So every
fresh `npm install @claude-flow/neural@alpha.8` broke at import time
with `Cannot find package '.../node_modules/@ruvector/sona/index.js'`.

Alpha.9 pins to the exact known-good 0.1.5 (which has index.js + 7
platform-specific .node bins). Will revert to a range once
@ruvector/sona@0.1.7+ ships with content (tracked in #2022).

### npm download badges across every published package README
Added `shields.io/npm/dm/<pkg>` (monthly downloads) badges to:
  - claims, cli-core, plugins (had no npm badges at all)
  - plugin-agent-federation, plugin-iot-cognitum (no npm badges)
  - browser, codex, mcp (had version badge, missing downloads)
  - umbrella root README (now badges both `ruflo` + `claude-flow`)
The ruflo/README.md and v3/@claude-flow/cli/README.md auto-copy from
root via prepublishOnly, so they inherit the new badges on publish.

Packages that already carried downloads badges (aidefence, deployment,
embeddings, guidance, hooks, integration, memory, neural, performance,
providers, security, shared, swarm, testing) are unchanged.

## Live functional check on the published artifacts

  - Fresh `npm install @claude-flow/neural@3.0.0-alpha.9`:
    sona resolves to 0.1.5; `import('@claude-flow/neural')` returns
    A2CAlgorithm, BalancedMode, BaseModeImplementation, BatchMode,
    CuriosityModule, ... (was broken before alpha.9).
  - Standalone use sections from ca0a6fa5c now visible on npmjs.com for
    memory@alpha.17, embeddings@alpha.18, security@alpha.8, neural@alpha.9.
  - npm dm/ badges resolve and render the current weekly download count.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-16 16:46:34 -04:00
ruv 9056720219 fix(browser): #2015 round 2 — strip bogus --kind flag, ship alpha.42
Round 1 (alpha.41) added the required --dimension flag to
`ruvector rvf create` but left the equally bogus `--kind browser-session`
in place. ruvector@0.2.25's `rvf create` accepts only:

  -d, --dimension <n>    (required)
  -m, --metric <metric>  (optional, default cosine)

Commander's required-option check fires before its unknown-option
check, so the original bug report (#2015) only surfaced the dimension
error. The fresh live regression check after publishing alpha.41
exposed the second-layer bug: `error: unknown option '--kind'`.

This round:
- Strip `--kind browser-session` from all 5 call sites (TS source,
  compiled dist via rebuild, replay-spike.sh, browser-agent.md,
  browser-record/SKILL.md). Also fixed the ADR prose example.
- Tighten the smoke (scripts/smoke-browser-rvf-create-flags.mjs):
  - Switch from rg-based content scan to an explicit PATHS_IN_SCOPE
    list (the original `--kind browser-session` anchor is gone, so
    we can no longer identify call sites by content).
  - Police BOTH invariants per line:
      * --dimension / -d is present
      * --kind is ABSENT (since ruvector@0.2.25 rejects it)
  - Skip quoted-string false positives ('rvf create failed' log lines).

Versions:
  @claude-flow/cli    3.7.0-alpha.42
  claude-flow         3.7.0-alpha.42
  ruflo               3.7.0-alpha.42
  @claude-flow/memory 3.0.0-alpha.16  (unchanged, #2019 fix already live)

Post-publish live functional check (everything green):
- ruvector rvf create --dimension 384 (no --kind): exit 0, .rvf file
  written. Reproduces what the MCP tool now invokes.
- Published CLI dist:113 carries '--dimension','384', no --kind.
- #2019 vectorBackend / graphAdapter functional test from
  alpha.41 still passes against published memory@3.0.0-alpha.16.
- verify.mjs precondition contract still holds.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-16 09:02:08 -04:00
ruv e4bd9bbcbe fix(verify+memory+browser): #1880, #2019, #2015 — three precondition/contract fixes + CI guards
Three small but recurring bugs ship together because they share the
same anti-pattern: a try/catch (or a missing flag) silently turned a
clear precondition failure into a vague "verification failed" /
"controller disabled" / "rvf create failed" outcome that downstream
consumers couldn't act on.

#1880 — witness verify exits 1 on source-only checkouts
  - The 12h scheduled verification has been filing a duplicate
    "HIGH — verification broken" issue every cron run since 2026-05-10
    because the runner does a source-only checkout (no @noble/ed25519
    install, no `npm run build`) and verify.mjs lumped that into the
    same exit-1 bucket as a real signature regression.
  - verify.mjs now reserves exit 2 strictly for precondition misses:
      * @noble/ed25519 not installed                → exit 2
      * every manifest entry missing AND manifest   → exit 2
        references /dist/ paths (= "dist not built")
    Real failures (signature invalid, specific marker regressed)
    keep exit 1. The scheduled runner can now distinguish
    "needs install/build" from "we broke something".
  - New CI guard: scripts/smoke-witness-verify-precondition.mjs
    drives all three shapes (missing dep, all-files-missing,
    built tree) and asserts the exit code contract.
  - Wired into v3-ci.yml as witness-verify-precondition-smoke and
    into witness-verify's `needs:` so a contract break blocks publish.

#2019 — vectorBackend controller permanently disabled
  - @claude-flow/memory's controller-registry.ts calls
    agentdb.getController('vectorBackend'). agentdb@3.0.0-alpha.14's
    getController switch only handles memory/reflexion/skills/causal
    and throws `Unknown controller: vectorBackend` for everything else
    — silently swallowed, leaving the controller `enabled: false`
    even though `agentdb.vectorBackend` is a real field on the
    instance (assigned in AgentDB.initialize()).
  - Registry now probes `agentdb[name]` directly first, falls back to
    getController only when the field is absent. Applied to all three
    accessor paths (initializeController, get, isEnabled).
  - RuntimeConfig gains an optional `agentdb` injection field so
    tests and consumers with a pre-built AgentDB can govern it via
    the registry.
  - Two new tests in controller-registry.test.ts cover both branches
    (direct property wins; falls back to getController when absent).
  - Full controller-registry suite stays green (67 tests).

#2015 — ruflo-browser session_record fails every call
  - ruvector@0.2.25 makes `-d, --dimension <n>` required on
    `rvf create`. The browser_session_record MCP tool wrapper invoked
    `rvf create … --kind browser-session` WITHOUT the flag, so every
    call returned `{ success: false, error: "rvf create failed" }`.
  - All five call sites updated to pass `--dimension 384` (matches
    MiniLM-L6 / AgentDB index default):
      v3/@claude-flow/cli/src/mcp-tools/browser-session-tools.ts
      plugins/ruflo-browser/scripts/replay-spike.sh
      plugins/ruflo-browser/agents/browser-agent.md
      plugins/ruflo-browser/skills/browser-record/SKILL.md
      plugins/ruflo-browser/docs/adrs/0001-browser-skills-architecture.md
  - New CI guard: scripts/smoke-browser-rvf-create-flags.mjs
    statically scans every `rvf create … --kind browser-session`
    invocation across the repo (TS, dist, shell, markdown) and
    fails if any is missing --dimension / -d.
  - Wired into v3-ci.yml as browser-rvf-create-flags-smoke and into
    witness-verify's `needs:` so a regression blocks publish.

Cases covered by guards: source-only checkout (no deps), source-only
checkout with build, built tree, missing dimension flag on TS/dist/
shell/markdown call sites. The smokes are independent jobs so the CI
summary names the specific contract that broke.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-16 08:44:51 -04:00
Reuven d5dbfa4b92 fix(hooks): #2017 — defensive pre-bash + new CI gate against silent-swallow shape
The pre-bash PreToolUse hook in .claude/helpers/hook-handler.cjs is a
security gate that refuses dangerous commands. In 3.6.30 it read the
wrong stdin field (`toolInput` object instead of `toolInput.command`
string), `.toLowerCase()` threw TypeError, the global safety-timer
try/catch swallowed it, and the handler printed misleading
"[OK] Command validated" while exiting 0 — letting `rm -rf /` through.

The bind-the-string fix already landed in alpha.39 via #1944. This
commit adds:

1. Belt-and-suspenders defensive coding — wrap with String(... || '')
   so any future regression that re-binds command to null/undefined/an
   object can no longer throw and silently exit 0.

2. New dedicated CI job `pre-bash-hook-smoke` (#2017) that drives real
   Claude-Code-shaped PreToolUse JSON into BOTH handler copies and
   fails on any of:
     - dangerous command + exit 0 (the security bypass)
     - "[OK] Command validated" on a dangerous input (misleading log)
     - "[WARN] Hook X encountered an error" anywhere (silent-swallow)
   Wired into witness-verify's needs:, so the gate now blocks publish.

3. Path filters extended: '**/.claude/helpers/hook-handler.cjs' triggers
   the smoke whenever either handler copy changes.

Cases covered: dangerous rm -rf /, fork-bomb, format c:, null command
field (defensive), empty payload, snake_case tool_input.command shape
(the exact #2017 reproduction), innocuous ls -la.

Ships as 3.7.0-alpha.40 to all three packages.
2026-05-15 22:29:21 -04:00
Reuven 1430b4c76e fix(embeddings): #2018 — drop @huggingface/transformers from optionalDependencies (npx Invalid Version)
Same failure shape as #1147: `npx @claude-flow/cli@latest` crashes with
`npm error Invalid Version: ` on npm 11.x / Node 24+.

Root cause: @claude-flow/embeddings declared @huggingface/transformers in
both `optionalDependencies` AND `peerDependencies` (with
peerDependenciesMeta.optional = true). When npm 11.x arborist runs
PlaceDep.pruneDedupable → Node.canDedupe → semver.eq, the overlap plus a
"-dev." prerelease transitive (onnxruntime-web@1.26.0-dev.…) trips the
empty-version crash inside @npmcli/arborist.

Fix:
- @claude-flow/embeddings: keep only the optional peerDependency, drop
  the duplicate optionalDependencies entry. Bumped to 3.0.0-alpha.17.
- @claude-flow/cli: pin embeddings to ^3.0.0-alpha.17 so existing
  lockfiles re-resolve to the fixed version. Bumped to 3.7.0-alpha.39.

Regression guards (so this can't recur):
- scripts/audit-package-dep-overlap.mjs — static check that no package
  declares the same name in BOTH optionalDependencies and
  peerDependencies. Wired into v3-ci.yml as part of the
  plugin-package-audit job.
- scripts/smoke-cli-npx-install.mjs — behavioural smoke: pack the CLI
  tarball, install it into a scratch project with optionals enabled,
  fail if `npm install` prints "Invalid Version:" or exits non-zero.
  New v3-ci.yml job `cli-npx-install-smoke` runs on Node 22 + 24
  (Node 24 ships npm 11.x, where the bug surfaces) and gates witness-verify.

Verified end-to-end:
  $ npx -y @claude-flow/cli@3.7.0-alpha.39 doctor
  ✓ MCP Servers, AIDefence, Disk Space, TypeScript … 10 passed
2026-05-15 21:44:39 -04:00
rUvandReuven 29ea78f21e chore(release): 3.7.0-alpha.38 — ADR-120 Step 3 (Rust peer crate) + Step 2 path update (#2010)
Cuts alpha.38 covering #2009 (Rust peer crate + midstreamer@0.3.1 path
update). Tests: cargo (3/3), vitest (555/555), audit (31/31).

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 23:01:35 -04:00
rUvandReuven 6e0ced7935 chore(release): 3.7.0-alpha.37 — ADR-119 + ADR-120 + Step 2 loader (#2008)
Cuts the alpha.37 release covering the three midstream-related PRs
merged today:

  #2005 — ADR-119 — midstreamer adoption assessment (decision: wait)
  #2006 — ADR-120 — cross-port plan (Steps 1-3)
  #2007 — ADR-120 Step 2 — midstream-aware federation transport loader

Source changes are TS-only + audit guards; no native build surface
change. The midstream-aware loader is opt-in via MIDSTREAMER_QUIC_NATIVE
and falls through transparently to the agentic-flow loader otherwise,
so behavior on the published package is unchanged today.

  • audit-fix-invariants.mjs: 27 invariants across 16 files (was 25/14)
  • Federation plugin tests: 555/555 passing
  • Type-check: clean

Bumps all 3 packages (@claude-flow/cli, claude-flow umbrella,
ruflo umbrella) to 3.7.0-alpha.37.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 22:29:40 -04:00
rUvandReuven 91657b9fce chore(release): 3.7.0-alpha.36 — 10 fixes + audit guard update (#2001)
Cuts the alpha.36 release covering today's 10 PRs (#1992-#2000):

  #1989 statusline RFE1 cascade        (#1992)
  #1987 memory stats HNSW persistent    (#1993)
  #1973 Windows install README          (#1994)
  #1948 platform-aware statusLine cmd   (#1995)
  #1937 memory_import_claude excl.      (#1996)
  #1921 @opentelemetry/core override    (#1997)
  #1910 MCP stdio stdout protection     (#1998)
  #1880 verify.mjs actionable error     (#1999)
  #1872 SwarmCoordinator (2 of 5)       (#2000)
  #1990 runtime-smoke gate count

Plus 9 new invariants added to `scripts/audit-fix-invariants.mjs`
covering the source-side fixes (statusline magic-bytes, page-count
clamp, memory-stats persistent count, platform-aware statusLine,
exclusion-patterns flag, otel pin, MCP stdio mode + uncaught
handler, scaleAgents target semantics, executeTask try/catch).

Result: `node scripts/audit-fix-invariants.mjs`
  → 25 invariants across 14 file(s), all present.

Bumps all 3 packages (@claude-flow/cli, claude-flow umbrella,
ruflo umbrella) to 3.7.0-alpha.36.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 21:38:14 -04:00
rUvandReuven 0873f81463 fix(mcp): protect stdout from stray console.log in stdio MCP mode (#1910) (#1998)
A broad MCP tool smoke test bricked the transport mid-batch: after
hooks_pre_task ran, every subsequent hooks_* / mcp_* call returned
`Transport closed`, including mcp_status. Root cause is stdout
protocol corruption — Codex closes the MCP transport the moment it
sees a non-JSON line on fd 1, and one or more of the modules that
hooks_route lazy-loads (@ruvector/router, @claude-flow/neural,
transformers.js/ONNX, semantic-router init) emits a diagnostic via
console.log into the JSON-RPC stream.

Defense in three layers, all in `startStdioServer()`:

1. **Hijack console.log/info/debug → stderr.** As the first thing
   the server does, replace those three methods with stderr writers
   prefixed `[stdout→stderr]`. Any subsequent module that calls
   `console.log(...)` (lazy-loaded or otherwise) goes to stderr
   instead of corrupting the protocol. `console.error` is
   unchanged.

2. **`writeFrame()` helper for JSON-RPC.** All three
   server-originated frames (`server.initialized`, the
   `Request too large` error, and tool responses) go through a
   dedicated helper that calls `process.stdout.write(...)`
   directly. The hijack above can't redirect protocol frames
   because they bypass `console.log` entirely.

3. **uncaughtException + unhandledRejection handlers.** Previously
   only SIGINT/SIGTERM were caught — an unhandled rejection in a
   lazy-loaded module's init (very common during the hooks
   semantic-router race the issue describes) crashed the server
   silently. Now those go to stderr with the full stack and the
   process stays up.

Plus: sets `process.env.MCP_STDIO_MODE = '1'` so downstream code
that wants to behave differently in stdio mode can probe a single
flag.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 21:04:17 -04:00
rUvandReuven ced2abc200 feat(memory): excludeFilePatterns/excludeFiles for memory_import_claude (#1937) (#1996)
`memory_import_claude` only had `allProjects: true/false` granularity.
Voice-fidelity-aware operators (named-persona content, PII-aware
hygiene) couldn't bulk-import without contaminating the unified
`claude-memories` namespace with the subset of files they had to
exclude. The current workaround was to halt imports entirely.

Two new params:

  excludeFilePatterns: string[]
    Glob patterns matched against the absolute file path. Files
    matching ANY pattern are skipped. Supports:
      `**`  any chars including path separators
      `*`   any chars except path separators
      `?`   exactly one char except a path separator
    Example: ["**/voice-*.md", "**/persona-*.md"]

  excludeFiles: string[]
    Absolute file paths to skip verbatim. Faster than a pattern when
    the operator already has a list captured.

Both apply to either branch (`allProjects: true` or single-project).
The response gains an `excludedByPattern` counter so callers can
verify the exclusion ran.

A minimal `globToRegex` helper is added (anchored, escapes regex
metas, handles `**` / `*` / `?`). Verified four representative
cases pass; the unrelated regex escapes the issue's voice-fidelity
patterns need.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 20:36:37 -04:00
rUvandReuven 1f8971d16b fix(init): platform-aware statusLine command (#1948) (#1995)
The statusLine command was hardcoded as
`sh -c 'D="${CLAUDE_PROJECT_DIR:-.}"; … exec node "$D/<script>"'`
on every platform. On native Windows (cmd / PowerShell, no
Git-Bash) `sh` either isn't on PATH or its quoting gets mangled.
Symptom in #1948: spurious files like `0)` or
`toastr.error('ESD...` appearing in the repo root because misparsed
shell tokens leak back into the file system as filenames.

Fix: detect `process.platform === 'win32'` at init time and emit a
shell-free command instead — a `node -e "…"` one-liner that
resolves the script path internally using `process.env`. No shell
quoting hazards because the resolution happens inside Node, not in
the shell.

  Windows: node -e "const fs=require('fs'),p=require('path');
    const d=process.env.CLAUDE_PROJECT_DIR||'.';
    const f=p.join(d,'.claude/helpers/statusline.cjs');
    const h=p.join(process.env.USERPROFILE||process.env.HOME||'.', '.claude/helpers/statusline.cjs');
    require(fs.existsSync(f)?f:h);"

  POSIX:   unchanged (sh -c with project-dir / HOME fallback)

Verified both branches emit valid JSON when generated through the
real settings-generator path on each platform.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 20:14:14 -04:00
rUvandReuven 6b9250ea8c fix(memory): memory stats HNSW count reads persistent DB (#1987) (#1993)
`memory stats` always reported `HNSW Index: active (0 entries)` even
when `memory store` had just stored a vector and `memory search`
successfully retrieved it. Root cause: the rendered count was
`hnsw.entryCount`, which is the live in-process JS state
(`hnswIndex?.entries.size`). A fresh `memory stats` invocation has
never initialized HNSW in this Node process, so the in-process
counter is always 0 — even when the persistent .swarm/memory.db has
many entries with embeddings.

Fix: prefer the persistent count from the `memory_stats` MCP tool,
which already computes `entriesWithEmbeddings` by listing the DB's
real rows. Fall back to the live counter when persistent count
isn't available. When both are non-zero, take the max (covers the
edge case where the live process has indexed more entries than the
persisted store has flushed).

Behavior matrix:

  hnsw.available  persisted  live    →  rendered
  false           any        any     →  "not active"   (unchanged)
  true            0          0       →  "available but not initialized"
  true            N>0        any     →  "active (max(N,live) entries)"
  true            0          M>0     →  "active (M entries)"    (unchanged)

Adds `entriesWithEmbeddings?: number` to the stats result type so
TypeScript is happy. The MCP tool already returns this field; this
just teaches the consumer to read it.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 19:44:08 -04:00
rUvandReuven 4680a2c044 fix(statusline): guard SQLite header read on encrypted memory.db (#1989) (#1992)
Resolves #1989. When encryption at rest is enabled, `.swarm/memory.db`
becomes an RFE1-magicked ciphertext blob rather than a SQLite
database. The statusline-generator's "page count at offset 28"
fallback read ciphertext bytes as a uint32 and rendered
3,367,093,602 patterns, which then cascaded into fake DDD 5/5 /
100% / intelligence 100% downstream.

Three defense layers, all in `statusline-generator.ts` (the template
that `ruflo init` writes to `.claude/helpers/statusline.cjs`):

  1. **Magic-bytes check** -- compare the first 16 bytes against the
     literal "SQLite format 3\\0" before interpreting any subsequent
     bytes. Encrypted, empty, or non-SQLite files are skipped.

  2. **Page-count sanity clamp** -- reject pageCount > 1,000,000
     (~4GB DB). Catches future regressions or genuinely corrupt
     headers even on plaintext SQLite.

  3. **Defensive consumer clamps** in `getV3Progress` and
     `getSystemMetrics` -- `Number.isFinite` + range check on
     `learning.patterns` before deriving domainsCompleted /
     intelligencePct. If any future regression in the reader returns
     a wild value, the downstream displays stay honest.

Verified with a fake RFE1-headered `memory.db` matching the
forensic bytes from the issue:

  Before: DDD Domains 5/5 / 100% / patterns=3367093.6k / 🧠 100%
  After:  DDD Domains 0/5 /   0% / patterns=0          / 🧠   0%

The `\\0` in the SQLite-magic string is intentional: the
statusline-generator emits via a JS template literal, so the
source-level `\\\\0` resolves to `\\0` in the generated .cjs which
JS then parses as the null byte.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-14 19:40:10 -04:00
ReuvenandRuFlo 4a19793e52 chore(release): 3.7.0-alpha.35 — ships #1974 mitigation
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.7.0-alpha.35.

Fixes:
- #1974 — neural-trader@2.7.1 has a malicious-by-accident `install`
  lifecycle script that recursively invokes `npm install` from inside
  the install hook → unbounded process recursion → ~120 GB RAM + 3,049
  stuck processes on macOS Apple Silicon. The plugin's docs told users
  to run the dangerous command verbatim. Now every documented install
  uses `npm install --ignore-scripts neural-trader` (the linux-x64
  binary is hardcoded inline in the upstream tarball, so the package
  still works on that platform after `--ignore-scripts`). 9 files
  patched + new `scripts/audit-neural-trader-safety.mjs` CI guard in
  the `hook-command-audit` job. Merged via #1976.

Also closed #1975 (recruiter outreach, not a bug) and asked #1973 for
specific repro details (vague "Windows install + bash + wiki" report
without a failing command or error).

Published to npm with all dist-tags updated:
- @claude-flow/cli  3.7.0-alpha.35  (alpha, latest, v3alpha)
- claude-flow       3.7.0-alpha.35  (alpha, latest, v3alpha)
- ruflo             3.7.0-alpha.35  (alpha, latest)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-14 08:05:04 -04:00
ReuvenandRuFlo c29ed99637 chore(release): 3.7.0-alpha.34 — ships #1968 fix + #1946/#1943/#1940 closeouts
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.7.0-alpha.34.

Code fix:
- #1968 — daemon start --workers map silently dropped the flag when the
  launcher forked the foreground child, so the daemon came up with the
  full default worker set regardless of the user's selection. Threaded
  --workers / --headless / --sandbox through the same validation +
  forwarding path the resource thresholds already use. Merged via #1970.

Issue-tracker closeouts (no new code — these were fixed in earlier alphas
but the issues weren't auto-closed by the PRs that resolved them):
- #1946 — doctor "Not initialized" — fixed in alpha.29 (#1959)
- #1943 — global-install hook MODULE_NOT_FOUND — fixed in alpha.28 (#1957)
- #1940 — bridge_status totalEntries:0 — fixed in alpha.31 (#1963)

Published to npm with all dist-tags updated:
- @claude-flow/cli  3.7.0-alpha.34  (alpha, latest, v3alpha)
- claude-flow       3.7.0-alpha.34  (alpha, latest, v3alpha)
- ruflo             3.7.0-alpha.34  (alpha, latest)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-13 21:57:26 -04:00
rUvandReuven 8a4803020f fix(daemon): forward --workers / --headless / --sandbox to forked child (#1968) (#1970)
`daemon start --workers map` (and `--headless` / `--sandbox`) were
accepted by the launcher but silently dropped when it forked the
foreground child — so the daemon came up with the full default worker
set (`map,audit,optimize,consolidate,testgaps`) regardless of what the
user asked for.

Root cause: `startBackgroundDaemon()` only accepted resource thresholds
(`--max-cpu-load` / `--min-free-memory`) and forwarded just those plus
`--workspace` to the forked child. `--workers` / `--headless` /
`--sandbox` were read by `ctx.flags.*` but never passed through.

Fix: thread the three additional flags through the launcher and add
them to the forked child's argv, gated by the same kind of strict
input validation the existing thresholds use:

  - `--workers <list>`  — `/^[a-z][a-z0-9_-]*(,[a-z][a-z0-9_-]*)*$/`
  - `--headless`        — boolean
  - `--sandbox <mode>`  — one of `strict|permissive|disabled`

Anything that fails validation is dropped silently — same posture as
the existing thresholds. Forced through the same `forkArgs.push()`
path so the child sees them in argv (which both the daemon's own arg
parser AND `killStaleDaemons` rely on for workspace identification).

Behaviour now (matching the user's repro from #1968):

  $ ruflo daemon start --workers map --max-cpu-load 1000 --min-free-memory 0
  $ ruflo daemon status
  Workers Enabled: 1
  map         enabled

Build verified clean (tsc).

Resolves #1968.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-13 21:56:25 -04:00
ReuvenandRuFlo 40e94434ff chore(release): 3.7.0-alpha.33 — 14 critical fixes since alpha.27
Cumulative batch release closing out the issue-triage cycle that started
at alpha.27. Bumps @claude-flow/cli, claude-flow, and ruflo to alpha.33;
each prior bump (.28→.32) shipped its fix-set immediately but had no
GitHub Release writeup. This commit + tag closes the loop.

Fixes shipped since alpha.27 (resolved-issue list):

Memory layer:
- #1947  vector_indexes schema dim 768→384 (default model is 384-dim)
- #1942  Bridge search index 768 vs imported 384-dim — same root cause
- #1952  Windows: memory store ok, search returns 0 — same root cause
- #1945  CLI memory store didn't persist on non-default memory paths
         (bridge ignored CLAUDE_FLOW_MEMORY_PATH / config)
- #1946  doctor reported DB "Not initialized" on a valid DB at
         data/memory/memory.db (same cwd-path-hardcode root cause)
- #1941  memory_search returned 0 for non-default namespaces — every
         store path now provisions per-namespace vector_indexes rows
- #1940  memory_bridge_status reported totalEntries:0 — used
         entries.length (page size) instead of .total (row count)
- #1939  Win32 cwd didn't resolve to Claude Code's on-disk slug —
         drive-colon / backslash / whitespace now normalised to `-`
- #1947 RC2  embeddings index -a build required `-c` — now optional

Hooks layer:
- #1944  pre-bash TypeError on every Bash call — toolInput (object)
         was used as the prompt string fallback; switched to .command
- #1943  global-install hooks fired MODULE_NOT_FOUND — settings paths
         now probe project-local first, fall back to $HOME

UI / statusline:
- #1953  hooks_pretrain extracted 0 patterns on md-heavy repos — used
         a code-file budget + code-dir-first traversal
- #1951  statusline hardcoded V3.5 — now probes plugin install path
         first, falls back to npm install / source checkout

Verification:
- #1949  federation plugin install 403 on cookies@0.9.1 — added
         scripts/verify-federation-plugin.sh that pins cookies@0.9.0
         at the verification harness root. Workaround until upstream
         pipenet/koa chain ships a non-blocked release.

CI regression guards (so these don't come back):
- scripts/audit-vector-dim.mjs        — #1947 dim guard
- scripts/audit-hook-handler-prompt.mjs — #1944 toolInput guard

Published to npm with all dist-tags updated:
- @claude-flow/cli  3.7.0-alpha.33  (alpha, latest, v3alpha)
- claude-flow       3.7.0-alpha.33  (alpha, latest, v3alpha)
- ruflo             3.7.0-alpha.33  (alpha, latest)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-13 13:33:44 -04:00
ReuvenandRuFlo 0cdad108b9 chore(release): 3.7.0-alpha.32 — ships #1947 RC2 fix
Bumps @claude-flow/cli, claude-flow, and ruflo to 3.7.0-alpha.32.

Fixes:
- #1947 RC #2 — `embeddings index -a build` REQUIRED `-c` and the docs
  suggested `-c default`/`-c documents`/etc., so users who stored entries
  under a non-default namespace ended up with `Vector Count: 0`. The HNSW
  index has always been a single global structure across all namespaces;
  `-c` is informational only. Make it optional, treat omitted `-c` as
  "(all namespaces)", and print a helpful hint when the resulting count
  is 0. Merged via #1964.

Also posted an investigation comment on #1949 — the federation plugin
install 403 is genuinely upstream-only (cookies@0.9.1 arrives transitively
via `agentic-flow`, which is third-party; npm `overrides` in a non-root
package.json aren't honored when consumers install the plugin as a dep).
Documented why and what the actual fix path looks like, so the issue
isn't lost.

Published to npm with all dist-tags updated:
- @claude-flow/cli  3.7.0-alpha.32  (alpha, latest, v3alpha)
- claude-flow       3.7.0-alpha.32  (alpha, latest, v3alpha)
- ruflo             3.7.0-alpha.32  (alpha, latest)

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-13 10:44:32 -04:00
rUvandReuven a5a6389852 fix(embeddings-index): make -c optional for build/rebuild (#1947 RC2) (#1964)
The HNSW index is a single global structure that indexes every
namespace's embeddings — `-c` was always informational. But the earlier
code REQUIRED `-c` for `build`/`rebuild` and the examples showed
`-c documents`/`-c patterns`/`-c default`, so users who stored entries
under a non-default namespace (e.g. `project`, `claude-memories`) hit
"Collection is required" on plain `-a build`, then re-ran with `-c default`
and got `Vector Count: 0` because that namespace was empty.

Drop the required check. When `-c` is omitted, label the result `(all
namespaces)`, run the same global rebuild, and print a helpful follow-up
if the resulting vector count is 0. Update help text + examples so the
intent is clear ("Omit to build for all namespaces"). No runtime
behavior change for callers passing `-c` — still indexes globally, just
labels the box with whatever they passed.

Build verified clean (tsc).

Resolves #1947 RC #2.

Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
2026-05-13 10:42:30 -04:00