* chore(deps): bump agent-browser in /v3/@claude-flow/browser
Bumps [agent-browser](https://github.com/vercel-labs/agent-browser) from 0.39.2 to 0.41.0.
- [Release notes](https://github.com/vercel-labs/agent-browser/releases)
- [Changelog](https://github.com/vercel-labs/agent-browser/blob/main/CHANGELOG.md)
- [Commits](https://github.com/vercel-labs/agent-browser/compare/v0.39.2...v0.41.0)
---
updated-dependencies:
- dependency-name: agent-browser
dependency-version: 0.41.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* chore(deps): update v3/pnpm-lock.yaml for agent-browser 0.41.2
Dependabot bumped the browser package's own lockfile but not the v3 pnpm
lock, so frozen-lockfile CI failed. Surgical edit (importer + package entry,
integrity checked against the registry); a full regen would have churned
@opentelemetry/api across every importer.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: r <r@x>
Co-authored-by: RuFlo <ruv@ruv.net>
Part of #1870. With --claude, -m/--model goes to the Claude Code worker as --model. No flag, no change. Values starting with '-' are refused before anything spawns.
Co-authored-by: Michael Valderrama <17348490+ibucketbranch@users.noreply.github.com>
* fix(auto-memory): JSON store surfaces write/read failures and verifies imports (#4685)
- JsonFileBackend._persist() no longer swallows errors: a failed write or
rename rejects store/bulkInsert/bulkDelete/update/shutdown.
- Only ENOENT means "no store". A read failure (e.g. EACCES), invalid JSON,
a non-array document, or an entry without a unique non-empty string id
throws a StoreError, and the file is never rewritten, so its bytes stay.
- Every persist reads the file back inside the lock and checks the intended
entries are present and equal and the deleted ids are gone.
- import reports success only after shutdown plus a fresh readback of every
entry it wrote; a failed import (including unreadable source files) exits 1.
Sync failures also exit 1. Exit 2 is never used, since Claude Code treats it
as "block". A missing @claude-flow/memory still exits 0 with its warning.
- New read-only `read <namespace> <key>` prints
{schemaVersion, store, storePresent, namespace, key, found, entry}; it never
loads the memory package, creates directories, takes the lock or calls
shutdown, and refuses an ambiguous key.
- The repository and packaged helper copies are byte-identical again.
The signed helpers.manifest.json is NOT re-signed here: the
auto-memory-hook.mjs hash in it is now stale, so helper-signing.test.ts and
the helpers-manifest-guard workflow fail until a maintainer runs
`node scripts/sign-helpers.mjs` (docs/helpers-sync.md step 2).
Regression: __tests__/auto-memory-persistence-4685.test.ts (28 of 30 fail on
the previous helper). Reported by @sparkling.
Co-Authored-By: RuFlo <ruv@ruv.net>
* chore(helpers): re-sign helpers.manifest.json for the auto-memory-hook fix (#4685)
Signed with the project key through RUFLO_HELPERS_SIGNING_SECRET (Secret
Manager, ruv-dev); check-helper-sync passes.
Co-Authored-By: RuFlo <ruv@ruv.net>
---------
Co-authored-by: r <r@x>
Every ruflo-core plugin hook runs the CLI, and the CLI auto-starts a daemon
whenever none is alive, so a daemon the user stopped came back within minutes.
daemon stop now writes .claude-flow/daemon.stopped (only in a Ruflo project or
an existing .claude-flow/; stop --all marks every stamped workspace).
ensureDaemonRunning declines to spawn while the marker exists. An explicit
daemon start clears it. The start that auto-start spawns carries
RUFLO_DAEMON_AUTOSTARTED=1: it never clears the marker and re-checks it, so a
stop that lands after the hook checked still wins.
Co-authored-by: r <r@x>
- hooks_intelligence_learn advertised trajectoryIds but never read it, so a
scoped request ran global learning. The learning path cannot select, so an
explicit selection is now refused before anything is imported or mutated.
- agentdb_context-synthesize summarizes validated task episodes; its description,
the research-synthesize skill (ruflo-goals 0.4.6) and the researcher agent
(ruflo-core 0.2.14) no longer send research documents to it.
Co-Authored-By: RuFlo <ruv@ruv.net>
- headless claude -p argv gets --permission-mode auto unless the caller set a
mode or --dangerously-skip-permissions (2.1.302 starts -p in manual mode on
third-party providers, telemetry off, or fresh installs; workers would stall).
RUFLO_HEADLESS_PERMISSION_MODE overrides; none passes no flag.
- parse credential_expires_at from the -p JSON result (2.1.318), carry it on
the execution result and emit 'credential-expiring' within 10 days.
- onFailure: "block" on the pre-bash safety gate in init-generated and repo
settings (2.1.295): a gate that can't start or times out blocks instead of
letting the command through. Older Claude Code ignores the key (checked on
2.1.289).
Co-authored-by: r <r@x>
The Decision Transformer 'should train under performance target' check
times the very first train() call in a fresh worker. That cold call is
several times slower than steady state (17ms vs 4ms locally), and on a
loaded 2-worker CI runner it alone crossed the 100ms bound: 110-154ms
on #4653, #4655, #4657, #4663 and #4521. Run one train() on a throwaway
instance with the same config first, then time. The PPO update check has
the same shape and gets the same warm-up. Bounds are unchanged.
Co-authored-by: r <r@x>
bridgeListEntries() and the sql.js listEntries() fallback selected full content and embedding columns before ORDER BY updated_at DESC LIMIT/OFFSET, so metadata-only pages sorted large payloads that were then discarded (#4686).\n\nUse a rowid subquery to order/limit row identities first, then fetch the page's payload columns. The original full-row query remains as a fallback for legacy WITHOUT ROWID tables. Filters (status/TTL/namespace/provenance/tags), total count, embedding cap, page membership, order and returned fields are unchanged.\n\nAdds a sql.js fixture test for descending offset pages, full content, total and limit 0. Existing sql.js list/provenance/tag and ADR-472 embedding tests pass 12/12 locally; tsc reports only the pre-existing missing workspace packages.
* fix(providers): account for Anthropic prompt-cache tokens
Anthropic reports input_tokens separately from cache_creation_input_tokens and cache_read_input_tokens, with cache writes priced at 1.25x and reads at 0.1x base input. The provider ignored both fields: promptTokens undercounted every cache hit/write and promptCost used the full base rate for all input (#4597 performance/security scan).\n\nAdd optional cache fields to LLMResponse.usage, compute total prompt tokens from all three, apply the cache multipliers in cost accounting, and carry the same fields through the streaming done event. Non-cached responses are unchanged.\n\nTwo tests mock the Anthropic REST/SSE responses: a non-streamed response (100 ordinary + 200 write + 800 read -> 1100 prompt tokens, .00129 prompt cost) and a streamed response (60 prompt, 5 output, .000114 prompt). Baseline returns 100/10 prompt tokens and omits the cache fields; candidate passes 2/2. Full provider unit tests pass (the integration suite is skipped locally: missing dotenv); tsc only reports the pre-existing missing @ruvector/ruvllm.
* test(providers): keep non-cached Anthropic usage unchanged
Add a compatibility control proving the new cache accounting leaves a response with no cache tokens byte-identical: 100 prompt, 50 completion, 150 total, \.0003 prompt cost.
The parser stores --memory-only as flags.memoryOnly and --no-include-memory
(or --include-memory false) as flags.includeMemory = false, but session
save, restore and export read only the kebab-case keys, which are never
set. `session restore <id> --memory-only` overwrote the agent and task
stores, and `session save` / `session export` with --no-include-memory
still wrote the memory entries.
Read the camelCase keys and keep the kebab ones as a fallback, as init and
mods do.
agentdb_pattern-store writes through ReasoningBank.storePattern(), but when
agentdb's Transformers.js model fails to load (offline, failed sharp install,
or a loaded CI runner) it serves hash-based mock embeddings. A passage and a
query then embed to unrelated vectors, so searchPatterns() returned [] for a
pattern that was just stored. This is the full-suite #2226 failure that has
kept the CI ratchet red since the move to agentdb 3.2.
- bridgeSearchPatterns: when the agentdb vector search returns nothing, scan
the same reasoning_patterns table for the query text, matching what the
LocalReasoningBank branch already does over getAll().
- rescueAgentdbEmbedder: agentdb 3.x's ReasoningBank calls embedQuery() /
embedPassage(), which bypass embed(). Patch the role methods too and clear
the cached mock vectors, so a host with ONNX actually gets real vectors.
- Regression test forces AGENTDB_DISABLE_TRANSFORMERS=1 and requires the
round-trip to hit; it fails without the fix.
Co-authored-by: r <r@x>
Every initialize created a session, but the server answers every client
through one currentSession, so a superseded session is never addressed again.
It still held a slot until the 30-minute expiry, and 100 short-lived SDK
clients (connect, listTools, close) were enough to make the next initialize
fail with "Maximum sessions (100) reached".
SessionManager.reserveCapacity(keepId) closes the least recently active
session other than keepId when the manager is full. The server calls it
before creating a session, keeping the current one. Capacity and expiry are
unchanged, and nothing is closed while there is room.
Co-Authored-By: RuFlo <ruv@ruv.net>
agentdb_health could return available:true with controllers while AgentDB itself had failed to open (for example because the daemon or another MCP server owned the RuVector store). The only trace was the separate isBridgeAvailable() check; the health payload had no init error or lock hint (#4654).\n\nbridgeHealthCheck now reads the registry's getAgentDBInitError(), reports available:false, includes agentdbInitError and the recorded bridgeFailureReason, and adds an actionable hint when the cause is an already-open/locked native store. Older registries without the record are unchanged.\n\nRegression extends the #4622 fake registry with listControllers and covers failed and healthy health payloads. Baseline returns available:true and no error for the failure case; candidate 5/5 with the Windows bridge opt-in, existing 3 tests unchanged.
* fix(neural): call the @ruvector/attention API that exists
ruvector-training called methods the binding does not have, in 0.1.31
and in the latest 2.2.2:
- computeContrastiveLoss called InfoNceLoss.compute(anchor, positives[],
negatives), which throws "Get TypedArray info failed" because the
binding takes a single positive, and then InfoNceLoss.backward(),
which does not exist. `neural train`'s contrastive leg (with --backend
wasm, or auto without the native ruvllm trainer) swallowed the error
every epoch and reported "LoRA Adaptations 0".
- computeFlashAttention, computeMoEAttention and
computeHyperbolicAttention called computeRaw(); the classes expose
compute(query, keys, values).
computeContrastiveLoss now uses computeWithGradients(anchor, positive,
negatives) and averages over the positives, so the list signature keeps
its meaning; it rejects an empty list. The attention helpers call
compute(). With the fix, `neural train --backend wasm --epochs 5` reports
3 LoRA adaptations instead of 0.
Fixes#4610
* test(neural): skip the #4610 cases unless initializeTraining brought the feature up
Resolving @ruvector/attention is not enough. In CI the package resolves
but the binding does not initialize, so the cases failed with "Flash
attention not initialized". The test now runs initializeTraining once
in a child and gates each case on the feature it reports: InfoNCE Loss
for the contrastive case, and FlashAttention, MoE and
HyperbolicAttention for their helpers.
Refs #4610
Claude Code names ~/.claude/projects/<slug> by replacing every character
other than [A-Za-z0-9] with `-`. resolveProjectMemoryDir() only tried
slugs that replace slashes, backslashes, `:` and whitespace, so for a
project path with `_`, `.` or the like (/home/alice/my_app, a Windows
user folder such as john.doe, a WSL /mnt/c/.../my_proj path)
memory_import_claude found nothing and returned "No Claude memory files
found", with or without projectPath.
Also try Claude Code's rule after the existing candidates of each path,
and for a WSL path on its Windows form too. The cost tracker's
_encode-project-path.mjs uses the same rule (#4366).
The parser stores every long flag under its camelCase key, but the
embeddings subcommands read ctx.flags['db-path'], ['max-size'],
['ef-construction'] and ['batch-size'], which are never set. The flags
(and the documented `chunk -s 256` short form) were ignored and the
hard-coded defaults used instead. Read the camelCase keys.
session_export wrote the session JSON to any outputPath given in MCP tool
input, so a caller could create or overwrite files anywhere the MCP server
process could write. The path is now resolved against the project root, its
real parent directory must stay inside the real project root, and an
existing symlink or non-file target is refused. The CLI 'session export'
command writes its own file and is unaffected.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVKCrsaLkwMr8CpYU7J
The DAA, workflow and claims stores are plain JSON-parsed objects keyed by
ids from MCP tool input. validateIdentifier accepts names such as
__proto__ and constructor, so daa_workflow_execute, workflow_cancel and
workflow_stop could resolve such an id to Object.prototype and write status
and error fields onto it, and claims_steal treated an inherited built-in as
a stealable marker. The record maps now load as null-prototype maps.
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVKCrsaLkwMr8CpYU7J
The parser stores `--dry-run` (and `-d` on `deployment deploy`) as
`dryRun`, but these three actions read `flags['dry-run']`, which is
never set, so each of them ran the real operation:
- `ruvector migrate --dry-run` applied every pending migration, and with
`--down` it ran the rollback SQL (DROP TABLE for 1.2.0 to 1.5.0).
- `ruvector backup restore --clean --dry-run` dropped and recreated the
schema, then inserted the backup's rows.
- `deployment deploy --dry-run` recorded a deployment and made it the
active one in .claude-flow/deployments.json.
Read `dryRun`, keeping the kebab key as a fallback, as the top-level
migrate, update, init and mods commands do.