doctor.ts's API-key health check tested process.env.CLAUDE_CODE, but
Claude Code actually sets CLAUDECODE (no underscore) — the check could
never detect a real Claude Code session via that variable. Add the
correct CLAUDECODE check alongside the existing fallbacks (#3023).
getNeuralStoreStats() in neural-tools.ts always reads/writes
.claude-flow/neural/models.json but self-reported its source as
patterns.json — a separate file owned by the ReasoningBank store in
memory/intelligence.ts. Corrected the label and removed the unused
PATTERNS_FILE constant that caused the confusion (#3025).
Fixes#3023, Fixes#3025
Auto-generated by .github/workflows/clone-tracker.yml.
Source: GitHub Traffic API (14-day rolling window).
Co-Authored-By: ruflo-bot <ruflo-bot@users.noreply.github.com>
* fix(security): compare candidate and prefix in the same canonical form (#3010)
`validate()` resolved the candidate with `fs.realpath` but the allowed
prefixes were only `path.resolve()`d, so the two sides were compared in
different forms and nothing under a prefix reached through a symlink could
ever match. On macOS that is every temp directory — `os.tmpdir()` is
`/var/folders/...` and `/var` is a symlink to `/private/var` — so
`ruflo proxy install` rejected the binary it had just signature-verified.
Linux is unaffected because `/tmp` is real, which is why CI stayed green.
Keep both forms of every prefix and compare against the one matching how
the candidate was resolved. Canonicalizing the prefixes outright would have
broken `validateSync()` / `isWithinAllowed()`, which are documented as
lexical-only, in the mirror direction.
When the candidate's leaf does not exist, canonicalize its longest existing
ancestor instead of falling back to the lexical path — otherwise
`allowNonExistent` (the default) would regress under a symlinked prefix.
That also closes a hole this exposed: `<allowed>/escape/not-written-yet`,
where `escape` symlinks outside the prefix, was previously accepted because
`realpath` threw ENOENT on the missing leaf.
Escapes stay blocked, and the regression tests construct the symlink
explicitly rather than relying on the macOS quirk, so they hold on every
platform. 3 of the 6 fail without this change.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(security): keep root prefixes usable and leave strict results untouched
Three defects found by an adversarial review of the previous commit.
`allowNonExistent: false` was still canonicalizing the candidate on ENOENT.
The call already fails, so the only effect was rewriting the `resolvedPath`
and `matchedPrefix` reported back — a silent shape change for any caller
reading those off a rejected result. Canonicalize only when non-existent
paths are actually allowed.
A root prefix (`/`, `C:\`, a UNC share root) already ends in a separator, so
anchoring the boundary as `prefix + path.sep` searched for `//` and rejected
every descendant. Pre-existing at all three comparison sites — this change
only widened how a prefix can end up being a root, since one can now
canonicalize to it. Extracted `isWithinPrefix`, which keeps the boundary
anchored so `/srv/app-secrets` is still outside `/srv/app`.
The guarded symlink tests returned early instead of skipping, so they
reported as passed on a host that cannot create links, and the flag was
never reset between cases. They now skip properly and reset per case.
Also documents that prefixes are canonicalized once, at construction: the
allowlist keeps denoting what it named when configured, rather than handing
whoever can rewrite a link the ability to redirect it later.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: RuFlo <ruv@ruv.net>
The Ruflo Nightly Dream Cycle cloud routine (trig_01HpEqAcEP7wzrxy3TzakrQ2)
was updated to v2: parallel research via the Task tool, claude-sonnet-5,
expanded toolset (TodoWrite/Skill/MultiEdit/BashOutput/KillBash), and a new
STEP 3.5 that attempts a real Flywheel evaluation (metaharness bench/evolve)
for harness-shaped findings instead of always stopping at a docs-only PR.
This file is the durable cross-night memory the new STEP 1 reads before
touching gh at all -- a fresh cloud checkout otherwise has zero continuity
beyond a gh issue list grep, which is what v1 relied on for 80 nights.
Backfilled from the full issue history: 4 shipped (5%), 1 rejected, 75
(94%) never touched, some >2.5 months stale. v2 uses this to bias toward
attempting evaluation over another research-only proposal when the
trailing merge rate is 0.
PathValidator.validate() canonicalizes the candidate path through
fs.realpath (when resolveSymlinks is on, the default), but the constructor
only ever path.resolve()d the allowed prefixes — never realpath'd them. On
any platform where a prefix is itself reached through a symlink (e.g.
macOS os.tmpdir() under /var, itself a symlink to /private/var), the
realpath'd candidate can never match the non-realpath'd prefix, and every
path under that prefix — including the prefix's own contents — is
rejected as "outside allowed directories".
This broke `ruflo proxy install` on macOS: the download and Ed25519
signature verification both succeed, then the defense-in-depth path check
in proxy/install.ts fails on the extracted binary, which lives under a
workDir created via os.tmpdir().
Fix: realpath the prefixes at construction time too, with the same
ENOENT-tolerant fallback to path.resolve() that validate() already uses
for candidates (a prefix directory that doesn't exist yet degrades
gracefully instead of throwing).
* fix(agent): propagate explicit provider/model config into agent execution (#2962)
`providers configure` and `agent spawn --provider/--model` persisted user
intent but the execution path (callAnthropicMessages, executeAgentTask,
determineAgentModel) only ever consulted env vars and a 5-alias model list,
silently discarding both. A local Ollama/OpenRouter setup with explicit
config would either fail closed or fall back to whatever provider the
env vars happened to select.
- determineAgentModel(): treat any non-alias config.model string as an
explicit selection via the existing modelId fast-path, instead of
falling through to task-based routing / agent-type defaults.
- agent_spawn: forward config.provider to the stored (and returned) agent
record when it's an unambiguous explicit choice ('ollama'/'openrouter';
'anthropic' is excluded since the CLI silently defaults to it when
--provider isn't passed).
- callAnthropicMessages(): accept an optional provider param and consult
the persisted `agents.providers` config for baseUrl/apiKey/model when
env vars are absent. A self-hosted Ollama baseUrl no longer requires
the undocumented OLLAMA_API_KEY='local' sentinel.
- executeAgentTask(): forward agent.provider into the first dispatch call.
Precedence: explicit per-agent flag > env vars > persisted config >
key-presence inference (unchanged, last resort).
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(ci): update #2042 smoke to match the widened OpenRouter branch shape
The #2042 regression smoke statically matched the literal token sequence
`useOpenRouter && openrouterKey`. #2962 widened that condition to
`if (useOpenRouter) { const apiKey = openrouterKey || persistedOpenRouter?.apiKey; ... }`
so a persisted `agents.providers` config can supply the key when no env
var is set — the smoke's ordering guarantee (OpenRouter branch reachable
before the Anthropic-key early-return) still holds, only the literal
pattern needed updating.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(intelligence): stamp contentFingerprint in consolidate()'s graph write too
consolidate() (the session-end path) rebuilt graph-state.json unconditionally
per the #2920 fix in v3.38.6, but its write never included the
contentFingerprint field that init()'s cache-hit gate checks — only init()'s
own write set it. So every init() immediately following a consolidate saw
nodeCount match but contentFingerprint undefined !== a real hash, missed the
cache, and did a full rebuild even with zero content changes. Fail direction
was safe (extra rebuilds, never stale data) so it didn't block the v3.38.6
release, but it meant the 60s graph cache never actually fired across a
consolidate/restart boundary.
* fix(memory): stop misreporting bridge brute-force search as HNSW-accelerated (#2922)
getHNSWStatus() reported `available: true` whenever the AgentDB v3 bridge
was loaded, on the theory that "AgentDB v3 is HNSW-equivalent" — but the
bridge's actual default search path is a full-table SELECT + brute-force
cosine similarity loop over every embedding row. It never touches
@ruvector/core or an HNSW index, regardless of whether ruvector-core is
installed and resolvable. Same issue in bridgeGetHNSWStatus (unconditional
available: true) and in three misleadingly-named functions that do no HNSW
work at all: bridgeSearchHNSW, bridgeAddToHNSW, bridgeGetHNSWStatus.
- getHNSWStatus(): available=false + new algorithm field
('hnsw' | 'brute-force-cosine') when the bridge is the active path,
instead of a blanket available=true that implied acceleration that
was never in the request path.
- memory-bridge.ts: bridgeGetHNSWStatus -> bridgeGetVectorSearchStatus
(adds algorithm: 'brute-force-cosine' to its return shape),
bridgeSearchHNSW -> bridgeSearchBruteForceCosine,
bridgeAddToHNSW -> bridgeAddEmbedding. No behavior change — call sites
updated in memory-initializer.ts, no other source callers existed.
- memory-tools.ts: the `backend: 'sql.js + HNSW'` field on 7 MCP tool
responses (memory_store, memory_retrieve, memory_search, etc.) was a
hardcoded literal regardless of which path actually ran. Replaced with
describeBackend(), which reports the real algorithm via the fixed
getHNSWStatus() probe.
Actually wiring AgentDBBackend's HNSW into the bridge's default search
path (the issue's broader architectural question) is out of scope here —
this fixes the status/naming layer lying about what's already true, not
the search path itself.
consolidate() (the session-end path) rebuilt graph-state.json unconditionally
per the #2920 fix in v3.38.6, but its write never included the
contentFingerprint field that init()'s cache-hit gate checks — only init()'s
own write set it. So every init() immediately following a consolidate saw
nodeCount match but contentFingerprint undefined !== a real hash, missed the
cache, and did a full rebuild even with zero content changes. Fail direction
was safe (extra rebuilds, never stale data) so it didn't block the v3.38.6
release, but it meant the 60s graph cache never actually fired across a
consolidate/restart boundary.
#2998 wrapped 15 plain npm ci call sites with the retry composite
action but deliberately left ci.yml and verification-pipeline.yml's
two Linux/non-Linux --omit=optional fallback blocks untouched, on the
assumption they were a separate concern. That gap was real: PR #2999's
Test Verification (ubuntu-latest, Node 20) job hit the exact same
sharp/libvips "socket hang up" flake on the untouched Linux branch of
this exact block within hours of #2998 merging.
These two steps can't call the composite action directly — they need
the OS branch to choose between a plain npm ci and the
--omit=optional/--force fallback chain — so this wraps the existing
logic in the same 3-attempt/15s-backoff retry inline instead.
initializeWorkerStates()'s restoration guard only checked
`originalConfig` (the constructor arg) before restoring
resourceThresholds from a saved daemon-state.json — a value explicitly
set via .claude-flow/config.json (e.g. minFreeMemoryPercent: 0, a
workaround for Darwin's os.freemem() undercounting reclaimable memory)
was not covered by that guard, so a stale daemon-state.json from
before the override existed kept winning on every restart. Same bug
class as #2661 (aiWorkersEnabled), which already documents the
"deliberately not restored from stale state" pattern this now follows
for resourceThresholds too — per-field, so an unrelated field with no
explicit source can still legitimately restore from saved state.
Also fixes a secondary diagnostic bug reported in the same issue:
readDaemonConfigFromFile() logged "Daemon config loaded from ..." via
this.log(), but runs from the constructor before this.config (and
therefore this.config.logDir) is assigned — the log() call threw
inside its own try/catch and the line never reached daemon.log,
making "is the config file even being read?" impossible to answer
from the log alone. The chosen path (or a YAML-parser-unavailable
warning) is now returned and logged once this.config exists.
Does not address this issue's primary Darwin os.freemem() memory-gate
bug — that needs vm_stat/memory_pressure-based measurement, a larger,
platform-specific change left for a follow-up.
* fix(intelligence): same-ID content edits were cached/dropped instead of refreshed (#2920)
Two related staleness bugs in the intelligence helper's graph/store
caching, both keyed on entry count instead of content:
- init()'s graph-cache-hit gate compared only graphState.nodeCount to
the deduped store length. Hand-editing a MEMORY.md section's body
while its heading (and therefore generated ID) stays the same
changes neither the count nor the ID set, so the stale cache kept
being served and ranked-context.json was never refreshed.
- consolidate()'s STORE_PATH persist gate
(`newEntries > 0 || store.length < preDedupCount`) only fired on
insight creation or a dedup-driven shrink. Any other in-memory
content change — e.g. assigning an id to a previously id-less entry
while building the graph — left entry count and the dedup outcome
unchanged, so the update was silently never written back to disk.
Fix: add a `storeFingerprint()` helper that folds every entry's own
content fingerprint into one aggregate value, used to (1) gate the
init() cache hit alongside nodeCount, and (2) make consolidate()
always persist the store — trivial cost given GRAPH_PATH and
RANKED_PATH are already rewritten unconditionally on every call.
Regenerated and re-signed helpers.manifest.json (ADR-174) for the
changed intelligence.cjs content via scripts/sign-helpers.mjs.
* fix(intelligence): re-sign helpers manifest with the correct auto-memory-hook.mjs hash
The previous commit's manifest captured a transient, incorrect hash for
auto-memory-hook.mjs — a file this change never touches — because a
concurrent Claude Code session briefly overwrote it with stale content
at the exact moment sign-helpers.mjs ran (the known helper-drift race
documented in CLAUDE.md). Re-signed with a before/after git-status
check bracketing the signing step to confirm no file changed underneath
it this time.
Confirmed across at least 8 unrelated PRs this session (#2988, #2989,
#2991, #2994, #2995, #2996, #2997, and this one): npm ci intermittently
fails during sharp's postinstall with "socket hang up" fetching a
prebuilt libvips binary from GitHub Releases. It's a direct HTTPS
download outside npm's own package cache, so actions/setup-node's
npm cache doesn't help — every occurrence required a manual
`gh run rerun --failed`.
Add a local composite action (.github/actions/npm-ci-retry) that
retries npm ci up to 3 times with a 15s backoff, and switch every
plain `npm ci --legacy-peer-deps` / `npm ci --no-audit --no-fund
--legacy-peer-deps` call site (15 of them, across ci.yml,
integration-tests.yml, verification-pipeline.yml, v3-ci.yml) to use it.
Left untouched: the three rollback-manager.yml invocations (separate,
low-traffic rollback-validation path) and the two existing
Linux/non-Linux --omit=optional fallback blocks in ci.yml and
verification-pipeline.yml, which already have their own resilience
logic for a different failure mode (optional native deps on
macOS/Windows) — not this flake.
DualModeOrchestrator spawned both Claude and Codex workers with
stdio: ['pipe', 'pipe', 'pipe'] but never wrote to or closed proc.stdin.
Both platforms receive their prompt positionally/via flag, never over
stdin — claude -p ignores the open pipe, but codex exec blocks in
resolve_root_prompt waiting for stdin EOF that never arrives, hanging
every real Codex worker until the orchestrator's own multi-minute
timeout kills it.
Close stdin immediately after spawn for both platforms.
Regression test spawns a real child process standing in for codex exec
(waits for stdin EOF before exiting) and asserts the worker completes
well under a short configured timeout instead of failing via timeout.
The 20-char floor after the sk-/sk_live_/sk_test_ prefix missed
shorter-but-real keys, and the quote-adjacency anchor required a
quote literally next to the prefix, missing the common
`Authorization: "Bearer sk_live_..."` shape where the quote sits
next to "Bearer", not the key. Lookaround boundaries match the
prefix as a standalone token wherever it appears, with a lower
(but still non-trivial) length floor.
owner/repo were validated but never passed to gh, so `gh` silently
resolved the target repository from the cwd's git remote instead of
the caller-specified one. A caller supplying owner/repo expecting the
issue to land there had no guarantee it did, even on the "real"
gh-backed success path.
* fix(ruflo-adr): skip .brain when walking for ADRs (#2911)
ruvnet-brain clones ~50 external repos under .brain/repo/clones/,
many carrying their own docs/adr/. Without .brain in SKIP_DIRS,
findAdrs() picked up hundreds of foreign ADRs alongside the
project's own — and since .brain sorts before docs, the project's
ADRs landed dead last in the walk order.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(ruflo-adr): smoke step 22 should not hard-code the test-file count
Was `-eq 3`, breaking every time a new *.test.mjs file is added to
__tests__/ even when the new tests themselves pass. `-ge 3` keeps the
"regression tests exist and run" guarantee without re-breaking on
growth — caught by this PR's own new test file (skip-brain-dir-2911).
Co-Authored-By: RuFlo <ruv@ruv.net>
Ships #2989 (init --all-agents/--skip-claude/--only-claude/--cloud-mcp
were dead kebab-case flag reads) and #2991 (CLI hooks post-task
dropped the ADR-130 reinforced-by graph edge due to an unawaited
fire-and-forget write racing process.exit(0)).
Co-Authored-By: RuFlo <ruv@ruv.net>
`hooks post-task` (CLI) reliably dropped the "reinforced-by" graph
edge on every successful call. The write was a fire-and-forget async
IIFE the handler never awaited — invisible from the long-running MCP
server, but the CLI is a one-shot process that calls process.exit(0)
immediately after the command action resolves (#1552), killing the
still-pending write before its first tick, every time.
`--all-agents`, `--skip-claude`, `--only-claude`, and `--cloud-mcp` were
silent no-ops. Every long-flag write path in the parser normalizes
kebab-case to camelCase before storing (`--all-agents` -> `flags.allAgents`),
but `initClaudeAction` read the literal kebab-case keys, which the parser
never produces. Same bug class already fixed for `--no-global` (#2098A)
five lines above — never applied to these siblings.
Ships #2988: `hooks intelligence --train` now actually distills
(#2940) instead of printing a canned success message with no state
change behind it.
Co-Authored-By: RuFlo <ruv@ruv.net>
`--train` declared a `forceTraining` input on the `hooks_intelligence`
MCP tool but never read it — the handler always returned the same
read-only status dashboard, and the CLI action's --train branch was a
cosmetic 500ms sleep followed by an unconditional "Training cycle
completed". `lastAdaptation` (what `--status` reports as "Last
Training") never moved, so it could only ever age no matter how many
times --train ran.
Now `hooks_intelligence` calls the existing `distillLearning()` when
`forceTraining` is set and reports what actually happened: patterns
distilled, ran with nothing new to distill, or MCP unavailable — so a
real training cycle and a no-op are no longer the same output.
Publishes #2986 (fix(migrate): correct removed-agent install suggestion
and add `migrate fix --agents` restore, #2985) and #2987 (fix(mcp): mcp
start -t http exits after false-success table + doc drift, #2984). Pure
bug fixes, no breaking changes -> PATCH per repo semver policy.
@claude-flow/cli, claude-flow, ruflo published in lockstep at 3.38.2,
all three dist-tags (latest/alpha/v3alpha) verified against the live
registry, published tarball pulled and confirmed to contain both fixes.
Co-Authored-By: RuFlo <ruv@ruv.net>
* fix(migrate,mcp): unresolvable remediation command + false-success HTTP server exit
Two independently-reported, freshly-filed defects:
- #2985: `ruflo migrate status`'s ADR-128 removed-agent remediation
(shipped today via #2973/ADR-382 Part B) printed a command that cannot
succeed twice over: `ruflo plugins install <plugin>` requires -n/--name
(not a positional) AND targets the npm-package plugin system, while the
gap detector's own registry check (installed_plugins.json) is for the
Claude Code marketplace system entirely. Fixed to print the correct
`/plugin install <plugin>@ruflo` slash-command flow, with a one-time
"run /plugin marketplace add ruvnet/ruflo first" hint. Also corrects
three adjacent doc-drift items the reporter found while verifying:
README/USERGUIDE's `claude mcp add ruflo` examples (should be the
canonical `claude-flow` key per #2206 — the exact stray-key duplicate
#2612's healing logic exists to clean up), README's blanket "MCP server
registered: No" claim for the plugin path (ruflo-core ships its own
.mcp.json and does register one), and a stale comment in executor.ts
conflating the CLI-track's mcp__claude-flow__* tool refs with the
marketplace plugin binding (mcp__plugin_<plugin>_<server>__*).
- #2984: `ruflo mcp start -t http` printed a full "Status: Running"
success table — PID, health/RPC URLs — then exited 0 within seconds,
never actually leaving the port bound. Root cause: bin/cli.js's
"normal CLI mode" branch (which any explicit non-stdio --transport
always takes) unconditionally exits once the dispatched command's
action() promise resolves (#1552's "one-shot command" assumption).
mcp.ts's `start` action returned immediately after printing the table,
so the freshly-bound http.Server was torn down within milliseconds of
the printed success claim. Fixed by blocking in the foreground after a
successful start (SIGINT/SIGTERM-driven graceful shutdown), matching
daemon.ts's established `--foreground` pattern — `daemonize` isn't
currently wired to fork/detach anywhere in MCPServerManager, so every
successful start via this path is a foreground server regardless of
the -d flag.
Tests: migrate-agent-detection.test.ts updated for the corrected command
string; new mcp-http-foreground-2984.test.ts spawns the built CLI exactly
like the bug report and asserts the port actually accepts connections
after the success table prints (not just that it printed), then confirms
SIGTERM still produces a clean exit. Both verified via git-stash A/B:
fail against the pre-fix code, pass against the fix.
Full suite otherwise unaffected — same 9 pre-existing sandbox-environment
failures (ruvector/wasm bindings, embedder model downloads) reproduced
identically before this change.
Closes#2985. Closes#2984.
Co-Authored-By: RuFlo <ruv@ruv.net>
* revert: drop migrate-agent-detection changes, superseded by PR #2986
An external contributor (pacphi) independently opened #2986 fixing the
same #2985 with the identical installCommand correction plus a real
`migrate fix --agents` restore command — strictly more complete than
this branch's minimal fix. Dropping the overlapping files here to avoid
a duplicate/conflicting PR; reviewed #2986 and recommended it for merge.
Remaining on this branch: the #2984 mcp start -t http fix and the
doc-drift items #2986 explicitly scoped out (README/USERGUIDE mcp-add
key, executor.ts comment).
Co-Authored-By: RuFlo <ruv@ruv.net>
The suggestion printed by 'migrate status' (ADR-382 Part B) could not
succeed: 'ruflo plugins install <plugin>' fails on syntax (--name is
required) and targets the npm-package PluginManager, while the owning
plugins are Claude Code marketplace plugins (not npm packages). The
detection module's own header documents that split.
- point installCommand at the marketplace flow the registry check
actually verifies: /plugin install <plugin>@ruflo
- add 'migrate fix --agents' (with --dry-run): restores missing agents
from canonical plugin content — marketplace clone, then repo checkout,
then GitHub raw pinned to the CLI's version tag with main fallback —
rewriting the plugin-only mcp__plugin_ruflo-core_ruflo__ namespace to
the canonical claude-flow server key (#2206) and recording provenance
after the frontmatter. Never overwrites existing files.
- status now hints at the fix command when gaps are found
Publishes the #2983 fixes (#2982/#2976 unordered LIMIT truncation in
memory search, #2968 sql.js persistence honesty). Pure bug fixes, no
API/behavior additions -> PATCH per repo semver policy.
Also corrects package-lock.json's top-level version field, which had
drifted to a stale 3.35.0 independent of this bump.
@claude-flow/cli, claude-flow, ruflo published in lockstep at 3.38.1,
all three dist-tags (latest/alpha/v3alpha) verified against the live
registry.
Co-Authored-By: RuFlo <ruv@ruv.net>
Two independently-reported, verified defects in the memory bridge:
- #2982/#2976 (duplicate reports): bridgeSearchEntries() and
bridgeSearchHNSW() pre-ranked their corpus with `LIMIT 1000`/`LIMIT
10000` and no ORDER BY, so SQLite returned rows in arbitrary storage
order (insertion order on a fresh table) before BM25/embedding scoring
ever ran. On any corpus over the limit, newest entries were silently
excluded from scoring regardless of relevance. bridgeListEntries()
already ordered by updated_at DESC for the same reason; both search
paths now match it. Verified via a stash A/B: identical repro returns
zero results without the fix, recalls the target with it.
- #2968: bridgeStoreEntry() swallowed every wal_checkpoint(PASSIVE)
failure as "non-fatal" and unconditionally reported store success. On
the sql.js fallback driver (engaged when better-sqlite3's native
binding never got built — e.g. a skipped optionalDependency
postinstall), that PRAGMA throws "Invalid PRAGMA command" every time,
and writes may never reach disk. The specific failure signature is now
distinguished from ordinary busy/non-WAL pragma failures and surfaced
as `persistWarning`, which `memory store` prints instead of an
unconditional green "Data stored successfully".
Both fixes stay within the CLI's own bridge layer — no changes to the
external agentdb/better-sqlite3 packages.
Tests: 2 new regression files (3 tests), full CLI suite otherwise
unaffected (10 pre-existing failures reproduced identically against a
clean baseline with these changes stashed — all in ruvector/wasm/
embedder-model-download paths, unrelated to this change).
Closes#2982, #2976. Part of #2968 (root-cause guarded; upstream
agentdb sql.js persistence itself is unchanged).
Parts A/B/C: pinned ruflo-core's marketplace-plugin MCP launch path
(local-bin-first resolver, mirroring hook-handler.cjs), registered 3
plugins missing from marketplace.json, implemented ADR-128's promised
`ruflo migrate` removed-agent detection, and shipped a warn-only CI
guard (scripts/smoke-init-scaffold-references.mjs) plus a deterministic
remap of 701 dead `npx claude-flow` references across 142 scaffold files.
Ref: #2971, ADR-382
Adds scripts/smoke-init-scaffold-references.mjs (ADR-382 Part C, #2971):
four static assertions over v3/@claude-flow/cli/.claude/** and the
plugin/marketplace surface, deriving the live MCP tool set and canonical
CLI form from source rather than hand-maintaining them.
1. dead `npx claude-flow` (bare) invocation
2. dead `mcp__claude-flow__<tool>` references not in the live registry
3. plugin .mcp.json launches with no local-bin-first resolver (Part A regression guard)
4. plugins/* directories missing from .claude-plugin/marketplace.json
Ships warn-only (no --strict) with a documented --strict flag to flip once
backlogs clear. Wired into .github/workflows/v3-ci.yml as a new job,
gated on plugins/*/.mcp.json, .claude-plugin/marketplace.json, and the
script itself (v3/@claude-flow/cli/.claude/** was already a trigger path).
Deterministic remap applied: 701 occurrences of bare `npx claude-flow`
across 142 files -> `npx @claude-flow/cli@latest` (mechanical, 1:1, verified
by rerunning the guard: check 1 701 -> 0, check 2 unchanged at 410). The
386 legacy `npx claude-flow@alpha` / `@v3alpha` occurrences elsewhere in
the same tree were left untouched (still-maintained dist-tags).
NOT remapped in this PR (tracked follow-up, per ADR-382 Part C's own
guidance not to guess): 410 dead `mcp__claude-flow__<tool>` occurrences
across 98 files, 54 distinct dead tool names (memory_usage: 53 files,
task_orchestrate: 41, sparc_mode: 34, swarm_monitor: 16, plus 50 more at
lower counts). Each requires per-call-site judgment about the surrounding
example's intent (store vs retrieve vs list, 1-line vs restructured
2-line orchestration calls) that a bulk regex pass cannot make safely.
Checks 3-4 are expected-red until ADR-382 Part A merges (plugin/ruflo-core
.mcp.json resolver + the 3 missing marketplace entries:
ruflo-agntcy, ruflo-bbs-federation, ruflo-business-pods).