- session-start hook now writes session entry to auto-memory-store.json
- post-task hook now writes task outcome to auto-memory-store.json
- statusline getAgentDBStats reads from both auto-memory-store.json AND
hooks memory store (.claude-flow/memory/store.json)
- Vectors/Size in statusline will auto-populate as hooks fire
- Removed fake previousSession fallback values (was 3/15 hardcoded)
Co-Authored-By: claude-flow <ruv@ruv.net>
- patterns: was Math.floor(fileSize / 2KB), now reads actual entries
from patterns.json, auto-memory-store.json, or SQLite page count
- sessions: was Math.floor(fakePatterns / 10), now counts real
session files from .claude/sessions/ and .claude-flow/sessions/
- intelligence %: removed fake "does src/ exist? +15%" fallback,
now 0% when no real learning data exists
- DDD domains: was inflated from fake patterns, now requires 100
real patterns per domain claim
- postinstall: changed symlinkSync to cpSync for Windows compat
Closes statusline portion of #1058
Co-Authored-By: claude-flow <ruv@ruv.net>
- Add agentdb ^3.0.0-alpha.11 as optionalDependency in CLI package
- Was resolving to v2.0.0-alpha.3.4 which has no controllers/index.js
- AgentDB v3 moves controllers to dist/src/controllers/ but agentic-flow
patch expects dist/controllers/ — add postinstall symlink
- 19 controllers now load: HNSWIndex, MemoryController, ContextSynthesizer,
ReflexionMemory, AttentionService, EmbeddingService, etc.
Co-Authored-By: claude-flow <ruv@ruv.net>
v0.1.27-0.1.29 had non-functional wrapper (constructor passed wrong arg,
called non-existent methods) and score inversion (routing always returned
empty results). Pin floor to 0.1.30 to prevent broken versions.
Co-Authored-By: claude-flow <ruv@ruv.net>
Remove Math.random() metrics from 6 locations:
- agent_health: CPU/memory/latency were random — now null with notes
- system_health: all checks were hardcoded "healthy" — now real fs checks
- coordination_metrics: latency/throughput were random — now null with real sync data
- github-tools: all 5 tools fabricated — now return _stub:true, local CRUD only
- process monitor: all metrics random — now real os.loadavg/memoryUsage
- hook-handler route: random latency, hardcoded matches — removed
Fix 6 bugs:
- task-tools path mismatch: agents.json → agents/store.json
- token-optimizer double-increment of editsOptimized
- config get: now reads real configManager instead of hardcoded map
- config providers: now reads/writes real config, mutation flags work
- session restore: now syncs to sql.js database after legacy JSON write
- claims rebalance: now executes moves when dryRun=false
Mark stubs honestly (_stub:true):
- neural compress/optimize
- performance bottleneck/profile/optimize
- hooks metrics/pretrain/intelligence-reset (reset now actually deletes files)
- workflow execute/resume (steps stay pending, not auto-completed)
- hooks session-end summary: reads real counts from stores
- hooks explain: reads real success rate from routing-outcomes.json
- hooks transfer: returns failure instead of demo data when source empty
- status.ts: performance claims → 'not measured'
Co-Authored-By: claude-flow <ruv@ruv.net>
- neural-tools: replace pure-random fallback with zero vector, update comments
- hooks-tools: replace 0.85+random matchScore with real keyword ratio
- benchmarks: replace random confidence with embedding-presence check
- No remaining Math.random() used for confidence/accuracy/metrics anywhere
Co-Authored-By: claude-flow <ruv@ruv.net>
- Add deduplicateById() helper using Map to keep last entry per ID
- Dedup in init() reduces 4482→157 entries (194MB→~79KB graph-state.json)
- Dedup in consolidate() with preDedupCount tracking for write-back
- Apply dedup to both v3 and root intelligence.cjs copies
Co-Authored-By: claude-flow <ruv@ruv.net>
- #1514: Remove fabricated token savings (hardcoded +=100 per cache hit,
baseline=1000). getOptimalConfig() now scales with agentCount.
neural_train stores real embedding patterns via generateEmbedding().
neural_predict uses cosine similarity against stored patterns (no
hardcoded labels). Returns empty array when no patterns exist.
verifySignature() confirmed already real (HMAC + timingSafeEqual).
- #1516: All embedding model defaults prefixed with Xenova/ so
@xenova/transformers resolves correctly. ControllerRegistry now
passes embeddingModel to AgentDB constructor.
- #1521: @claude-flow/memory bumped to 3.0.0-alpha.13, better-sqlite3
moved from optionalDependencies to dependencies.
- #1526: hook-handler normalizes snake_case tool_input/tool_name from
Claude Code. intelligence.cjs scoped to current project only
(was scanning all 51+ project dirs).
- ADR-073: Documents stub tool honesty policy and real predictions.
Closes#1514, #1516, #1521, #1526
Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
- #1532: Add getProjectCwd() to all 16 MCP tool files, respecting CLAUDE_FLOW_CWD
env var instead of bare process.cwd(). Fixes macOS global install where cwd='/'.
Install script now passes -e CLAUDE_FLOW_CWD="$HOME" to claude mcp add.
- #1530/#1531: Add 10MB file size guard and 5000-node PageRank cap to
intelligence.cjs. Add 3s timeout wrapper on intelligence.init()/consolidate()
in hook-handler.cjs. Prevents indefinite hang on large graph-state.json.
- #1524: Auto-initialize memory database on MCP server startup in mcp-server.ts
with graceful degradation. Fixes "Database not initialized" for memory_store.
- #1522/#1520/#1523: Detect ruvector extension before falling back to pgvector
in all ruvector CLI commands. Dynamic vector type names in DDL/indexes.
Fix -d flag mapping to --database in benchmark/optimize.
Closes#1532, #1531, #1530, #1524, #1522, #1520, #1523
Co-authored-by: Reuven <cohen@ruv-mac-mini.local>
- #1499: ReasoningBank missing embedder param — added createEmbeddingService()
call in controller-registry.ts, matching pattern used by other controllers
- #1490: SQLite database path relative to CWD — changed path.join to
path.resolve for all swarmDir/dbPath computations, preventing data loss
when MCP server CWD changes
- #1489: memory_search defaults to 'default' namespace — when namespace is
not explicitly provided, now searches across ALL namespaces instead of
silently filtering to 'default'
- #1484: init --full hooks disconnected — writeSettings now merges hooks
into existing settings.json instead of skipping the file entirely when
it already exists (which it does in most projects)
All 1725 tests pass, 0 failures.
Co-Authored-By: claude-flow <ruv@ruv.net>
getStatus() reports running=true with the current process PID when
transport is stdio (even before the server starts). This caused
start() to throw "already running" with the process's own PID.
Now skips the "already running" check when the detected PID matches
the current process, matching the same logic in commands/mcp.ts.
Co-Authored-By: claude-flow <ruv@ruv.net>
Two issues fixed:
1. PID reuse detection: process.kill(pid, 0) returns true for ANY
process owned by the user, not just the MCP server. When the OS
recycles a PID, this falsely blocks startup with "already running".
Now verifies the process is actually node/claude-flow/npx before
reporting it as running.
2. Legacy PID cleanup: older versions wrote mcp-server.pid to
.claude-flow/ instead of /tmp/. Now cleans up that legacy path
during removePidFile() to prevent ghost locks.
Co-Authored-By: claude-flow <ruv@ruv.net>
Use multi-strategy approach to find .claude/ directory:
1. Check process.cwd() first (most common when invoked by user)
2. Walk up from CLI package location
3. Walk up from CWD as fallback
Fixes discovery returning 0 agents/skills when running from
a subdirectory within the project.
Co-Authored-By: claude-flow <ruv@ruv.net>
Adds 5 new MCP tools to help the system navigate Ruflo's 259 tools,
26 commands, 60+ agents, and 37 skills:
- guidance_capabilities: List all capability areas with tools/agents/skills
- guidance_recommend: Task-based routing to relevant capabilities
- guidance_discover: Live filesystem discovery of agents and skills
- guidance_workflow: Workflow templates for common task types
- guidance_quickref: Quick reference cards for daily operations
Also updates init executor to stop counting .yaml agent files
(all migrated to .md in previous commit).
Co-Authored-By: claude-flow <ruv@ruv.net>
Workers now read status, currentTask, and tasksCompleted from the agent
store instead of always returning idle/null/0. This was a v3 regression
of the fix from #762.
Closes#1382
1. SQL injection: Convert all 9 string-interpolated queries in
memory-initializer.ts to parameterized queries (db.prepare/bind)
Closes#1030
2. Preinstall hook: Remove no-op preinstall script and package.json entry
that triggered supply chain concern
3. SECURITY.md: Add vulnerability disclosure policy with supported
versions, reporting process, and safe harbor statement
4. SafeExecutor: Remove npx from default command allowlist to prevent
arbitrary package execution via safe executor
5. Cleanup command: Add `cleanup` command for removing project artifacts
(.claude/, .swarm/, data/, etc.) with --dry-run default and --force
to execute. Addresses uninstall documentation gap
Published as v3.5.40. All fixes verified in Docker.
Closes#1375
* fix: intelligence layer loads flat array from auto-memory store
The auto-memory-hook.mjs writes a flat JSON array to auto-memory-store.json,
but intelligence.cjs loadEntries() only checked for store.entries (object
wrapper format). This caused the vector store to load only 1 fallback
pattern from MEMORY.md instead of the full 1,300+ entries.
Now supports both formats: flat array and { entries: [...] } wrapper.
Also fixes deprecated Dirent.path usage (use parentPath first).
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: apply same loadEntries fix to helpers-generator.ts
The published CLI package generates intelligence.cjs during `init` via
helpers-generator.ts — it had the same flat-array bug. Users running
`npx claude-flow init` would get the broken version.
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: statusline uses real data instead of hardcoded/estimated values
- Hooks: count actual hook entries instead of hardcoding total=17
- Vectors: count real entries from auto-memory-store.json, not file-size/2
- Tests: scan v3/ directory (depth 6), was missing ~2000 test files
- Swarm: only show active if state updated within 5 min (stale check)
- Security: flag as STALE if audit older than 7 days
- ADRs: count actual files (76), don't use stale compliance JSON (7)
- Intelligence: scale to 2000 entries = 100% instead of 100 entries
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: apply statusline accuracy fixes to generator (end-user path)
The statusline-generator.ts always overwrites the bundled statusline.cjs
during init, so all 6 accuracy fixes must be in both files:
- Hooks: count actual entries, not hardcode 17
- Vectors: read real entry count from store JSON
- Tests: scan depth 6, include v3/ directory
- Swarm: 5-min staleness check on metrics
- Security: PENDING when no audit run, STALE after 7 days
- ADRs: count files directly, skip stale compliance JSON
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: prevent MCP server self-kill on startup (#1380)
Three compounding bugs caused `mcp start` to crash with "Killed":
1. Self-kill: getStatus() reported current process as "running" for stdio
transport, then start command sent SIGKILL to its own PID
2. Config crash: Zod schema rejected partial configs with non-object values
3. Hook exit: process.exitCode=0 was overridden by async errors
Fixes:
- Add isSelfDetected guard to skip kill when PID matches process.pid
- Add .passthrough() to SystemConfigSchema, merge partial configs with defaults
- Use process.exit(0) in .finally() for reliable hook exits
- Remove invalid hook events (TeammateIdle, TaskCompleted, PostCompact)
- Wrap hook commands in sh -c for cross-platform CLAUDE_PROJECT_DIR expansion
Published as v3.5.39. Tested in Docker — clean startup, no warnings.
Closes#1380
Co-Authored-By: claude-flow <ruv@ruv.net>
- Fix loadEntries() to handle flat array format from auto-memory-store.json
- Fix statusline: real hook count, real vector count, real test count, stale swarm/security checks
- Apply fixes to both local helpers and generator (end-user init path)
- Published as v3.5.31
Co-Authored-By: claude-flow <ruv@ruv.net>
- Parser: scoped alias resolution (two-pass) fixes global -t flag collision
- Neural: --pattern-type flag now recognized, predict threshold lowered for hash-fallback
- Hooks: pre-task --task-id optional, added notify subcommand
- Agent metrics: real data from .swarm/ state instead of hardcoded demo
- Security audit: dynamic timestamps from file state instead of 2024 demo data
- Settings generator: Windows-compatible %CLAUDE_PROJECT_DIR% env var
- ADR-063: documents all findings from deep capability audit
Co-Authored-By: claude-flow <ruv@ruv.net>
writeHelpers() copies the pre-installed 577-line statusline.cjs from the
npm package, then writeStatusline() skipped writing because the file
already existed. This meant the full 758-line generated version (with
AgentDB vectors/size, tests, ADRs, hooks, integration stats) was never
used in fresh installs.
Fix: writeStatusline() now always writes the generated version,
overwriting any legacy copy from writeHelpers().
Fixes statusline showing static zeros for vectors/size in new installs.
Co-Authored-By: claude-flow <ruv@ruv.net>
Replace relative paths and $(git rev-parse --show-toplevel) with
$CLAUDE_PROJECT_DIR in all hook commands. Fixes hooks breaking when
Claude Code changes working directory to a subdirectory.
- .claude/settings.json: 15 hook paths updated
- v3/@claude-flow/cli/.claude/settings.json: 9 hook paths updated
- settings-generator.ts: hookHandlerCmd, autoMemoryCmd, statusline fixed
- All three packages bumped to 3.5.15 and published
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: v3.5.5–v3.5.7 platform parity, branding, stdin timeout, settings completeness
Covers three releases published to npm:
v3.5.5 — Complete branding sweep
- Replace all "Claude Flow V3" with "RuFlo V3" across 30+ CLI source and helper files
- Fix Windows PS1 daemon manager, BAT wrapper, statusline branding
- Fix config.yaml header, CAPABILITIES.md, JSDoc, SQL schema comments
v3.5.6 — Platform parity and settings completeness
- Fix macOS daemon death on terminal close (SIGHUP handler in foreground mode)
- Fix Windows daemon spawn (shell:true, windowsHide:true, no detached flag)
- Fix PID file write order (write after child.unref() + 100ms delay)
- Add 4 missing hooks to settings-generator: PostToolUse:Bash, PreToolUse:Write|Edit|MultiEdit, SubagentEnd, Notification
- Rename "Worker Daemon" to "RuFlo Daemon"
v3.5.7 — Hook stdin timeout fix
- Replace `for await` stdin with event-based + 500ms timeout in hook-handler.cjs
- Prevents hanging when Claude Code leaves stdin in ambiguous state (not TTY, not pipe)
- Update helpers-generator.ts template with same fix
Also:
- Add Nginx reverse proxy service to ruflo docker-compose for Chat UI branding
- Update ADR-060: 13/24 items fixed, all P0/P1 resolved
Co-Authored-By: claude-flow <ruv@ruv.net>
* fix: update pnpm-lock.yaml for agentic-flow dependency
The lockfile specifiers were out of sync with @claude-flow/cli/package.json
after agentic-flow was added, causing CI frozen-lockfile failures.
Co-Authored-By: claude-flow <ruv@ruv.net>