3817 Commits
Author SHA1 Message Date
randRuFlo 2a75e765c3 chore(release): 3.71.1 — shared 3.0.7, mcp 3.1.6, plugin-agent-federation 1.0.5
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-04 03:30:34 -05:00
r d3c5244eae Merge PR #4682 into release/3.71.1 2026-11-04 03:28:54 -05:00
r b694a8ae01 Merge PR #4647 into release/3.71.1 2026-11-04 03:28:54 -05:00
r 86840b68a6 Merge PR #4646 into release/3.71.1 2026-11-04 03:28:54 -05:00
r 4c22c1b48d Merge PR #4664 into release/3.71.1 2026-11-04 03:28:54 -05:00
r 3c388f18e0 Merge PR #4669 into release/3.71.1 2026-11-04 03:28:54 -05:00
rUv bca5d10958 Merge branch 'main' into fix/4674-http-session-retire 2026-11-04 01:58:18 -06:00
rUv 090317b4cc Merge branch 'main' into fix/shared-rate-reset-empty-key 2026-11-04 01:58:15 -06:00
rUv 031a109b6b Merge branch 'main' into fix/resilience-ownership-20261101 2026-11-04 01:58:12 -06:00
rUv 504c2bd080 Merge branch 'main' into fix/federation-handoff-dual-floor 2026-11-04 01:58:09 -06:00
rUv 9973d61028 Merge branch 'main' into fix/dry-run-ruvector-deployment 2026-11-04 01:58:05 -06:00
rUv 32f6f680be Merge branch 'main' into fix/memory-import-claude-slug 2026-11-04 01:58:03 -06:00
rUvandr bbd057eb17 fix(memory): find stored patterns when agentdb serves mock embeddings (#4643) (#4681)
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>
2026-11-04 01:57:56 -06:00
randRuFlo 536a7315bd fix(mcp): retire superseded sessions instead of refusing at maxSessions (#4674)
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>
2026-11-04 02:07:21 -05:00
ordinary being 762fbf74c2 fix(memory): expose AgentDB init failures in health (#4667)
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.
2026-11-04 01:01:20 -06:00
Aaditya 55260ca55a fix(neural): call the @ruvector/attention API that exists (#4613)
* 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
2026-11-04 01:01:04 -06:00
Tanishq 093298ef53 fix(memory): match Claude Code's project slug for all non-alphanumerics in memory_import_claude
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).
2026-11-04 01:47:25 +05:30
Tanishq 82e96a5b3d fix(cli): honor --dry-run in ruvector migrate, ruvector backup restore and deployment deploy
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.
2026-11-03 03:38:58 +05:30
马建彤 7ca274c106 test(federation): cover a spawn floor above the write floor
Exercise the symmetric max(write, spawn) case so agent-handoff cannot regress to spawn-only gating when spawn is the higher floor.
2026-11-02 18:27:25 +08:00
马建彤 a19171eb0e fix(federation): require both handoff trust floors
POLICY_CATEGORY_FOR_MESSAGE_TYPE mapped agent-handoff to the spawn floor only. A handoff also transfers work state, so when an operator sets minTrustLevelForWrite above minTrustLevelForSpawn, a handoff was admitted below the configured write floor (#4650, follow-up from #4580).\n\nAdd a write+spawn category whose threshold is max(minTrustLevelForWrite, minTrustLevelForSpawn), and map agent-handoff to it. Plain agent-spawn remains spawn-only.\n\nRegression uses write=PRIVILEGED, spawn=ATTESTED: handoff at TRUSTED is now refused and only PRIVILEGED is allowed; agent-spawn keeps its existing capability/floor behavior. Baseline fails the handoff case; candidate 2/2. Package suite 620 passed (one pre-existing missing-@noble suite); no tsc errors in the changed source.
2026-11-02 18:06:00 +08:00
rUv 5f3dacc54b feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0 (#4652)
* feat(mods): automatic context delegation (ruflo-mods 0.15.0, ADR-522) + release 3.71.0

New contextDelegation option (off | observe | enforce, default off). A
main-loop whole-file Read of a 14-120 KB file for an analysis prompt is
answered by a no-tools haiku $.model.complete on the session's own
credentials. Every quote is checked against the file and the model sees
only the cited passages (the file's own lines) plus how to read the rest.
The real Read always runs first, so a later Edit works (spike: answering
the Read without next(e) breaks Edit); any failure shows the whole file.

Live A/B (real binary, haiku main, 6 repo files 17-83 KB): 6/6 correct
both ways, 6/6 delegated, total cost -22.5% incl. worker, main input
-21.5%, wall +6.5%. First run delegated 0/6: haiku drops indentation in
quotes; the verifier now trims per-line whitespace and relocates up to 3
lines, showing the file's own lines.

Tests: 8 plugin tests, 3 real-binary e2e (extract + Edit, forged quote,
off), CLI parity test vs DEFAULT_CONTEXT_LIMITS and core verdicts. Smoke
step 4 now allows exactly one gated $.model.complete.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP

* ci: keep the claude-code test-kit plugin test out of the vitest ratchet

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01MfPHVHXWyvDvDtYMTsA6MP
2026-11-01 15:14:10 -05:00
rUv a3d45e64b9 feat(core): governed context delegation with reproducible benchmark proof (#4648)
* feat(core): add bounded context delegation with source-bound benchmark proof

* feat(core): add governed Messages adapter and durable resumable live pilot

* fix(benchmarks): isolate pilot fixtures and record bounded live timeout proof

* fix(context-delegation): review fixes — pilot env allowlist, hash-before-import, real policy root; ADR-521

- subscription-pilot: the spawned claude gets an allowlisted environment
  (PATH, HOME, locale, XDG, CLAUDE_CONFIG_DIR, plus names in
  RUFLO_PILOT_CHILD_ENV_PASS) instead of the whole shell; a GH_TOKEN
  canary test proves it. Policy is evaluated for process.cwd(), not a
  hardcoded /home/ruv.
- provider-pilot: the --runtime entry and policy runtime are contained
  and hashed before they are imported.
- ADR renumbered 520 -> 521 (520 is agentdb episode CRUD on main).
- Evidence regenerated for the new snapshot (9301fbfd…, Node 24): 300/300
  quotes, coordinator bytes -97.56%, total boundary +3.83%; verify.mjs ok.

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

* fix(context-delegation): honour --worker-available through the CLI parser; scope evidence hashes to owned files

- context-plan read only f['worker-available'], but the parser camelCases
  flags, so the documented command always planned 'worker-unavailable'.
  Accept both spellings; new test drives the real CommandParser (fails
  without the fix).
- results.json no longer hashes hooks.ts, index.ts and global-ai-budget.ts.
  Those files change in unrelated PRs, which would have failed
  verify.mjs on the next one. Evidence regenerated (20491e6e…, 14 hashes),
  163/163 tests, verify ok.

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

* chore(release): 3.70.0

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-01 14:13:37 -05:00
rUv 3c30ee3fa3 feat(agentdb): episode CRUD over agentdb 3.3 (ADR-520) + release 3.69.0 (#4642)
* feat(agentdb): episode get/list/update/delete over agentdb 3.3 (ADR-520)

agentdb_episode-get, -list, -update and -delete reach agentdb 3.3's
ReflexionMemory through one new bridge helper (withReflexionController),
so a verified session can be marked success with a critique in place,
keeping its id, and recall re-ranks it. Strict integer ids; pre-3.3
builds get a clear error (delete is gated so the old parseInt-ing
deleteEpisode is never used).

agentdb ^3.3.0 in root and CLI, ruflo override >=3.3.0, both lockfiles;
marketplace agentdb plugin -> plugin-v3.3.0.

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

* fix(agentdb): ADR-112 use-when guidance on episode CRUD tool descriptions

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

* chore(release): 3.69.0

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-01 12:52:22 -05:00
rUvandr 47406b0a96 fix(memory,neural): AgentDB SQL fallback persistence, cache size reuse, MoE mean P_i (#4639)
* fix(memory,neural): persist AgentDB SQL fallback, reuse cached sizes, average MoE P_i

- memory (#4410): AgentDBBackend's SQL fallback gated on db.run/db.get, which
  agentdb's prepare/exec handle never has, so no table was created and every
  write was a silent no-op. Use prepare().run/get with spread params (safe on
  better-sqlite3 and agentdb's sql.js shim) and quote the "references" column.
- memory (#4481): CacheManager stores each entry's size on its LRU node and
  refunds that number on overwrite/delete/eviction instead of re-serializing.
- neural (#4381): computeLoadBalanceLoss() uses the mean gate probability over
  the same route() history as f_i, persisted and reset with the routing stats.
- Bump @claude-flow/memory 3.2.2, @claude-flow/neural 3.0.2.

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

* chore(cli): pin @claude-flow/memory 3.2.2 and @claude-flow/neural 3.0.2 (both published)

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

---------

Co-authored-by: r <r@x>
2026-11-01 12:17:59 -05:00
rUvandr 73b20daf6e fix(cli): session-end consolidation, session snapshot IDs, Fisher decay env (#4638)
* fix(cli): session-end consolidation, snapshot IDs, Fisher decay env, read-path regression test

- #3908: bridgeSessionEnd probed only `nightlyLearner.consolidate`, which
  neither the MemoryConsolidator wrapper nor AgentDB's NightlyLearner has.
  Feature-detect consolidate -> run -> runAll, bounded (10s) and non-fatal.
- #4404: session_save keyed snapshot rows by a bare `namespace::key`, so
  tuples containing `::` collided (one dropped on save, a distinct sibling
  row skipped as a mirror). Percent-escape `%` and `:` per component;
  ordinary IDs are unchanged and restore reads the explicit fields.
- #3475: CLAUDE_FLOW_FISHER_DECAY overrides the default Fisher EMA decay;
  only a finite number in (0, 1] is honoured, constructor config still wins.
- #4570: the sql.js read paths no longer rewrite memory.db on main (fixed by
  #3918's ensureSchemaColumns change); add a regression test asserting
  inode/mtime/ctime/size are unchanged across searchEntries, listEntries,
  memory_search, memory_list and memory_search_unified.

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

* test(cli): drop #4570 regression test (issue closed separately as fixed by #3918)

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

---------

Co-authored-by: r <r@x>
2026-11-01 12:17:55 -05:00
rUvandr 60f3b336ca fix(security): realpath containment in hooks_codemod (#4346); strict-majority Raft quorum (#4458) (#4636)
* fix(security): realpath containment in hooks_codemod; strict-majority Raft quorum

hooks_codemod (#4346, CWE-59): the project-root check compared lexically
resolved paths, so a symlink inside the project pointing outside it let the
codemod read and rewrite files outside the root. Both the file/files[] and
glob branches now also compare real paths (nearest existing ancestor for
missing leaves) against realpath(projectRoot) using path.relative.

RaftConsensus (#4458): quorum was floor(n * 0.66), i.e. 1 for 2- and
3-voter clusters, so the leader's self-vote accepted a proposal even after
a peer rejected it. Quorum is now max(floor(n/2)+1, floor(n * threshold)).
@claude-flow/swarm 3.0.2 -> 3.0.3.

Fixes #4346
Fixes #4458

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

* chore(swarm): 3.0.4 (3.0.3 was published without dist)

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

---------

Co-authored-by: r <r@x>
2026-11-01 12:17:51 -05:00
rUvandClaude 7cd8c4517c fix(security): prototype pollution in config MCP tools scope handling (#4635)
config_get/set/reset/export/import/list indexed store.scopes with the
caller-supplied scope name. validateIdentifier accepted reserved names
such as __proto__, and inherited names (toString, hasOwnProperty)
resolved to shared built-ins, so a scoped write could land on
Object.prototype for the whole MCP server process.

Scope names now go through validateScope (rejects __proto__,
constructor, prototype) and scopes are only read/created as own
properties via readScope/ensureScope. Scoped config_set also rejects a
reserved key.


Claude-Session: https://claude.ai/code/session_01MfPHVKWbict6fc5sWyA3zp

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 12:17:47 -05:00
Rudy Celekli 8812be98ed fix(shared): match complete HTTP status tokens in retry predicates 2026-11-01 12:11:44 -05:00
Rudy Celekli 0fdc9e66a6 fix(shared): isolate rate limiter reset for empty keys 2026-11-01 12:10:54 -05:00
rUvandr 3667ba6573 fix(cli): enforce swarm.maxAgents in agent_spawn (#4572); fix the two red main CI tests (#4640)
agent_spawn now resolves the target swarm before writing the agent and
refuses a spawn into an active swarm that already holds maxAgents live
(non-terminated) agents, with current/max in the error. No swarm, a
shut-down swarm, or a retry of an agent already in the swarm behave as
before.

Main CI: the ratchet runs vitest from the repo root with no config, so the
5 s default testTimeout applied. On a loaded runner the #4203 recall test
took 6.2 s and timed out; its abandoned search imported rabitq-index.js
after the next test's vi.resetModules() and built the index there, which
failed "concurrent ensureRabitqIndex()" on its initialized === false
precondition. The suite gets an explicit 60 s budget. The #2226 test
searched the repo-root .swarm store that every other test file writes
patterns to; it now uses a store of its own.

Co-authored-by: r <r@x>
2026-11-01 11:43:06 -05:00
rUvandClaude bb3869c9c9 fix: align bundled SKILL.md name: fields with their directory names (#1054) (#4616)
21 skills under .claude/skills/ (both the repo-dev copy and the shipped
v3/@claude-flow/cli/.claude/skills copy that `init` actually installs into
user projects) had a display-friendly `name:` in their SKILL.md frontmatter
instead of their kebab-case directory name. Claude Code resolves a skill
invocation (e.g. `/pair-programming`) by directory name but surfaces the
`name:` field in autocomplete, so a mismatch makes the skill unselectable
("skill not found").

Adds a regression test (skill-name-matches-dir-1054.test.ts) scanning the
shipped skills directory and asserting every SKILL.md's name: matches its
directory; it fails on the pre-fix content and passes after.

Note: open PR #1587 addresses the same report but only touches the separate
.agents/skills/ mirror, not the .claude/skills copy that `init` ships, so it
would not have fixed the reported repro on its own.


Claude-Session: https://claude.ai/code/session_01ReiDH3nbkdgFmZjAXyWZpp

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:26:26 -05:00
rUvandClaude 45b42984d3 fix: statusline DDD% reflects pattern count, not DDD domains (#1047) (#4615)
The statusline's "DDD Domains" / "DDD ●XX%" fields were purely derived
from `.swarm/memory.db` file-size-based pattern-count thresholds in
getV3Progress() — nothing to do with Domain-Driven-Design domain
completion. Running `memory init --force` could drop "DDD progress"
from 100% to 80% just by resetting the DB file size, with zero change
to any actual architecture work.

Relabel the full and compact statusline views honestly ("Learning
Tier" / "Learning:") and replace the fabricated "DDD ●XX%" percentage
with the real pattern count it was derived from ("Memory ●N"), per the
issue's own suggested remediation. The CVE-count half of this issue
was already fixed by #2694; the ADR-count half is already tracked
separately by #1588, so neither is touched here.

Adds a regression test (issue-1047-ddd-statusline-metrics.test.ts)
that fails on the old code and passes after the fix.


Claude-Session: https://claude.ai/code/session_01ReiDH3nbkdgFmZjAXyWZpp

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:26:22 -05:00
rUvandClaude 1b783e0c98 dream(security): gate admin-plane trust-change/topology-change below ATTESTED (evaluated) #4633 (#4634)
* dream(security): #4633 gate admin-plane trust-change/topology-change below ATTESTED (evaluated)

PolicyEngine.evaluateMessage()'s getOperationForMessageType() had no case
for trust-change/topology-change (the two federation message types that
mutate a peer's trust level or the mesh topology itself) — both fell
through to the generic 'send' operation, granted from TrustLevel.ATTESTED,
the same floor as ordinary data-plane messages. Unlike write/memory/spawn,
there was no SecurityPolicy-configurable threshold for this category.

Adds a dedicated 'admin-change' CAPABILITY_GATES entry (TRUSTED+ only) and
a new minTrustLevelForAdmin SecurityPolicy field (default TRUSTED),
mirroring the write/memory/spawn pattern fixed last night (#4619). The
hardcoded floor cannot be bypassed by a loosened policy override, matching
the existing defense-in-depth shape for remote-spawn/PRIVILEGED.

7 new tests (4 discriminating, 3 controls). Stash-isolated baseline:
4/17 fail exactly as predicted. Candidate: 17/17 pass. Full package suite:
684/684 (677 existing + 7 new), 0 regressions. tsc --noEmit: unchanged
5 pre-existing unrelated module-resolution errors, 0 in changed files.

Independent adversarial critique (fresh context, re-ran stash isolation
and the full suite itself): CONFIRMED core bug, PASS shippability. Two
non-blocking caveats disclosed: (1) claim-event/agent-handoff still fall
through the same default branch — pre-existing, already covered by their
separate absence from DEFAULT_SECURITY_POLICY.allowedMessageTypes, not
in scope tonight; (2) an uncited editorial comment citing "Identiverse
2026" — trimmed in this commit.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH37Jrnfnkp5K5kF5vf

* docs(dream-cycle): 2026-11-01 security gist + ledger row (#4633)

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH37Jrnfnkp5K5kF5vf

* docs(dream-cycle): record PR #4634 in ledger row

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH37Jrnfnkp5K5kF5vf

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-01 10:26:18 -05:00
kevin b18d641478 fix(claims): keep recorded progress when claims_handoff omits progress (#4596) 2026-11-01 10:26:11 -05:00
kevin 173e047e04 fix(daa): keep the names of object steps in daa_workflow_create (#4599) 2026-11-01 10:26:07 -05:00
kevin 3590274e30 fix(daa): keep same-millisecond daa_knowledge_share entries from overwriting each other (#4601)
Signed-off-by: kevin9327 <5299031+kevin9327@users.noreply.github.com>
2026-11-01 10:26:03 -05:00
kevin dbf708a75a fix(coordination): rotate through active nodes in round-robin load balancing (#4621)
coordination_load_balance distribute with the round-robin algorithm
always picked the first active node, so every task went to the same
node. Remember the node the last task went to and pick the active node
after it, wrapping around.
2026-11-01 10:25:59 -05:00
Aaditya f5c8b346e3 fix(workflow): workflow_run creates a ready workflow instead of a fake running one (#4612)
workflow_run stored its workflow with status 'running' and a startedAt,
and returned status 'running' with a fabricated `stages * 30s`
estimate, but dispatched nothing. workflow_execute then refused the
workflow ("Workflow already running") and workflow_delete refused it
("Cannot delete running workflow"), so it stayed stuck unless
cancelled.

It now saves the workflow as 'ready', as workflow_create does, with no
startedAt. It returns status 'ready', estimatedDuration 'unknown' and a
nextStep note: workflow_execute starts the workflow, and its task
steps need config.agentId or options.defaultAgentId. options still flow
into variables, so a defaultAgentId passed to workflow_run is used by
workflow_execute. dryRun is unchanged.

The `workflow run` CLI says "Workflow created" and prints how to start
it. workflow-cli-tool-shape's list case now expects the 'ready' status.

Fixes #4609
2026-11-01 10:25:56 -05:00
rUvandr 2b1a392747 feat(memory): session episodes through agentdb 3.2 hybrid retrieval; release 3.68.0 (ADR-519) (#4632)
- Session end stores the summary as a ReflexionMemory episode (neutral reward,
  unverified). The bridge called startEpisode/endEpisode, which ReflexionMemory
  never had, so no session episode was ever written.
- New agentdb_episode-recall MCP tool: retrieveRelevant with agentdb 3.2's
  keyword + vector fusion by default, opt-in cross-encoder rerank.
- agentdb_session-start takes recall/k/hybrid/rerank and returns episodes.
- A failing secondary write no longer discards a stored or recalled episode.
- agentdb ^3.2.0 in cli and claude-flow, >=3.2.0 in the ruflo override.
- scripts/smoke-episode-recall.mjs runs the round trip on real agentdb.

Co-authored-by: r <r@x>
2026-11-01 00:33:07 -04:00
rUvandr 66df9b95e1 feat(marketplace): agentdb and agentic-flow external plugins (ADR-518) (#4629)
* feat(marketplace): list agentdb and agentic-flow as external plugins (ADR-518)

Adds both upstream Claude Code plugins to the ruflo marketplace as
git-subdir entries pinned to their plugin-v3.1.0 merge commits
(agentdb 401fcb68, agentic-flow 2c86073b). Each runs its own MCP server
pinned to the 3.1.0 package plus a mod guard command.

A real-binary e2e checks out the pinned commit and asserts the mod
answers its own command with zero model requests, with a negative
control the loader refuses. README rows and ADR-518 added.

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

* chore(marketplace): keep \u escapes so the diff only adds the two entries

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

* fix(console): give agentdb and agentic-flow a home section (plugin coverage)

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

* test: run the external-plugin e2e only in the real-binary tier

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

* chore(console): 0.49.8 — plugin map covers agentdb and agentic-flow

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

---------

Co-authored-by: r <r@x>
2026-10-31 20:45:43 -04:00
rUvandr 56fe4dc604 feat: ecosystem convergence — agentdb 3.0.0, agentic-flow 3.0.0, AIMDS packs; release 3.67.0 (#4628)
* fix(aidefence): restore the ADR-118 wider-detection pass to source (3.0.4)

@claude-flow/aidefence 3.0.3 (npm latest) was published from an uncommitted
tree carrying the ADR-118 / #2004 patterns, so main never had them, and
main's #3177 ReDoS bounds never reached npm. 3.0.4 is a true superset:
the verb-noun override window, behave-as role hijack and god/root/admin/sudo
mode jailbreak markers, on top of main's bounded PII/marker regexes.
Parity against the published 3.0.3 dist: 24-input corpus, 0 regressions.
Drops publishConfig.tag=alpha. Refs #4625.

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

* feat(aidefence): merge AIMDS pattern packs into ThreatDetectionService (3.1.0)

Vendors the AIMDS pack engine (normalize, decoders, pattern-loader, engine)
and its six pattern packs (53 patterns) from midstream AIMDS at abe78d6 into
src/domain/services/packs/. Packs are embedded as TS modules, so they load
from the published ESM dist with no fs path lookup; the files allowlist is
unchanged.

ThreatDetectionService.detect() runs the packs in a second pass over the raw
input and merges findings into the existing result shape (one threat per
type, as before). Built-in patterns, including the ADR-118 extras, stay and
their confidences are unchanged. Packs are on by default; disable or select
them with createThreatDetectionService({ packs }) or createAIDefence({ packs }).
The legacy pattern-array argument still works.

- ThreatType gains tool_invocation, data_exfiltration, markup_forgery;
  Threat gains an optional ruleId (e.g. EX-001) for pack findings.
- Packs are validated, compiled and regex-warmed once per process, so
  isSafe()/checkThreats() no longer pay a compile per call and the first
  detect() is not charged ~17 ms of lazy regex compilation.
- Fixes a quadratic regex in the vendored normaliser (undoLeet): 100 KB of
  hex digits took 1.8 s; now 6 ms. Decoders cap each blob before decoding.

Corpus (55 attacks / 30 legit): built-ins only 8/55, packs on 55/55; false
positives F13 and F27 in both modes (built-in encoding_attack), pinned.

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

* fix(memory): build AgentDB controllers with an embedder and the shared vector backend

LearningSystem, NightlyLearner, ExplainableRecall and the graph transformer's
CausalMemoryGraph take (db, embedder, ...). The registry passed only the
database, so the first predict/discover/recall threw on this.embedder (the
#3327 Finding A class, fixed for ReasoningBank only). Real-agentdb test fails
on the old source (learningSystem.embedder undefined). memory suite 659/659.
Adds ADR-513 (stable versions, convergence) and ADR-516 (aidefence recovery).

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

* feat(cli): move to agentic-flow ^2.2.0 (main line); stable-only tag policy

- agentic-flow ^3.0.0-alpha.1 resolved to the March 3.0.0-alpha.2, which
  pulled @xenova/transformers -> onnx-proto -> protobufjs 6 (critical).
  2.2.0 is agentic-flow's main line (ADR-515). The update validator and the
  init doc table follow.
- neural-tools: computeEmbedding returns a Float32Array, which JSON.stringify
  writes as {"0":...}; convert to an array before the neural store.
- CLAUDE.md: no more alpha/v3alpha/next dist-tags (ADR-513); overrides do not
  reach users; examples use ruflo@latest.

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

* chore(cli): pin @claude-flow/aidefence 3.1.0 (AIMDS pattern packs)

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

* chore(cli): target agentic-flow ^3.0.0 (first stable 3.x, ADR-515)

agentic-flow's security defaults change in a breaking way (agents no longer
bypass permissions by default, proxies need a token), so the main line ships
as 3.0.0 rather than 2.2.0. That also gives the 3.x alpha line a stable head:
existing ^3.0.0-alpha.1 installs resolve to it and drop the March alpha's
protobufjs 6 (critical).

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

* fix(memory): capture AgentDB's backend failure reason from stderr too

agentdb 3.0.0 moves library diagnostics off stdout (they corrupted stdio MCP
JSON-RPC), so the #4622 lock-reason capture patches console.error as well.

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

* docs(adr): ADR-514 agentdb 3.0.0, ADR-515 agentic-flow 3.0.0, ADR-517 AIMDS pattern packs

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

* chore(memory): 3.2.1 (embedder wiring, stderr reason capture)

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

* chore(release): 3.67.0 — agentdb 3.0.0, agentic-flow 3.0.0, aidefence 3.1.0, memory 3.2.1

- CLI and the claude-flow umbrella declare agentic-flow ^3.0.0 (root lock and
  v3 pnpm lock resolve 3.0.0 / agentdb 3.0.0).
- CHANGELOG 3.67.0.

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

* test/docs: dated ADRs 513-517; scope the bracket/DAN timing test to built-ins

- ADRs 513-517 gain Date lines (the console ADR parser expects >97% dated)
  and ADR-513/516 name the versions that shipped (agentic-flow 3.0.0,
  aidefence 3.1.0).
- threat-detection 'bounds the bracket and DAN patterns' measures the
  built-in regexes it was written for ({ packs: false }); the AIMDS packs
  have their own 100 KB adversarial timing test. Full detector on that input:
  86 ms locally, 301 ms on the CI runner (linear, budget was 200 ms).

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

* fix(deps): stop pinning ruvector 0.2.27 under agentdb 3.0.0; CLI agentdb ^3.0.0

The root (and ruflo wrapper) overrides pinned ruvector ^0.2.27 from the BEIR
work (3.10.29). npm applies overrides inside this repo's tree, so CI ran
agentdb 3.0.0 on ruvector 0.2.27, below agentdb's own ^0.2.40: a pairing no
user ever installs (published overrides are ignored), and the one where #2226
pattern recall failed on CI. Raised to ^0.2.41.

The CLI's agentdb range moves to ^3.0.0 (stable; no alpha ranges, ADR-513),
so the v3 pnpm lock resolves 3.0.0 and the v3 test job exercises what users
get instead of 3.0.0-alpha.20. 115 agentdb/memory-related CLI test files:
868/868 on 3.0.0.

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

---------

Co-authored-by: r <r@x>
2026-10-31 17:59:28 -04:00
rUvandr bd77bced5f fix(security): bearer parsing, verification-code bias, protocol stripping; release 3.66.2 (#4624)
* fix(security): linear bearer parsing, unbiased verification codes, nested-protocol stripping

- @claude-flow/mcp: HTTP and WebSocket transports parse Authorization: Bearer
  with a prefix compare instead of /^Bearer\s+(.+)$/i, which backtracked
  quadratically on long whitespace runs (CodeQL js/polynomial-redos).
- ruflo-chatgpt-federation: same parser fix in authContext.
- @claude-flow/security: generateVerificationCode draws digits with
  randomInt(10); byte % 10 favoured 0-5 (js/biased-cryptographic-random).
- @claude-flow/security: sanitizeString strips javascript:/vbscript:/data:
  until stable, so javajavascript:script: no longer reassembles javascript:
  (js/incomplete-url-scheme-check).
- cli terminal_create: session ids from crypto randomBytes, not Math.random.

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

* chore(release): 3.66.2 — mcp 3.1.5, security 3.0.6

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

* chore(ruflo-chatgpt-federation): 0.2.5 for the bearer parser fix

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

* test(ruflo-chatgpt-federation): smoke expects 0.2.5

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

---------

Co-authored-by: r <r@x>
2026-10-31 14:11:42 -04:00
509aa0f503 dream(performance): #4597 AttentionCoordinator embedding-cache never memoized (evaluated, ACCEPT-scoped) (#4598)
* dream(performance): AttentionCoordinator embedding-cache memoization (WIP, evaluation in progress)

Memoizes AttentionCoordinator.getOrCreateEmbedding()'s synthetic content-hash
embedding per-AgentOutput via an identity-keyed WeakMap, instead of rebuilding
it from scratch on every O(n^2)/O(numHeads*n^2) pairwise call across the
flash/multi-head/hyperbolic/graph-rope coordination mechanisms. Twice-deferred
finding (2026-10-20, 2026-10-25), now closed.

6 new tests (attention-coordinator-embedding-cache.test.ts), stash-isolated
baseline fails 3/6 as predicted -> candidate 6/6 pass. Full @claude-flow/swarm
suite 367/367 (361+6 new), 0 regressions. tsc --noEmit 0 errors both ways.
Standalone wall-clock probe (multi-head, 5-trial median): n=20 25.927ms->1.070ms
(~24.2x), n=50 158.119ms->4.655ms (~34.0x), n=100 652.951ms->16.550ms (~39.5x).

Research gist + full receipt: docs/dream-cycle/dream-gist-2026-10-30.md.
Issue/PR/ledger update to follow once the independent adversarial critique
completes.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH484YJNjSdtxKAvbzp

* dream(performance): post-critique fixes + final witness for AttentionCoordinator cache

Independent adversarial critique: CONFIRMED-WITH-CAVEATS, no blocking issues
(reproduced stash-isolated baseline/candidate result and the wall-clock
speedup independently, on different hardware; confirmed no production
caller exists outside this package's own new test). Fixed forward the one
cheap, concrete caveat: documents the identity-keyed WeakMap cache's
mutate-and-reuse staleness risk as a KNOWN LIMITATION comment (no current
caller triggers it). The other caveat (2 of 6 tests reach into private
internals) is disclosed, not fixed -- no other public surface exists to
assert an identity-caching implementation detail against.

Finalizes the research gist with the critique summary and witness stamp.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH484YJNjSdtxKAvbzp

* dream(performance): backfill 2026-10-29 ledger row + append 2026-10-30

2026-10-29's row was never appended last night even though the pipeline
really ran (dream/2026-10-29-swarm, #4572, #4573 all exist) -- STEP 25's
"ledger update always happens" invariant was missed once. Backfilled from
the real issue/PR content, not fabricated. Appended tonight's own row
(#4597/#4598, AttentionCoordinator embedding-cache memoization).

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH484YJNjSdtxKAvbzp

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: r <r@x>
2026-10-31 13:20:30 -04:00
ordinary being ba1308daeb fix(integration): make the attention cache key cover the full tensors (#4600)
AttentionCoordinator.computeCacheKey() hashed only the first eight elements of query/key/value (and ignored mask). Two values with an identical prefix but different tails collided, so a later useCache request returned an output computed from the wrong value; delegated results also collided across masks (#4597 hive-mind/performance scan).\n\nHash every Float32 element plus length via FNV-1a for all three tensors, and include the mask in the key. The existing mechanism prefix and cache-hit behavior are unchanged.\n\nThree regression tests: same-prefix/different-tail values no longer share a cached output; an identical request still hits; delegated results with only a different mask no longer collide. Baseline fails the collision cases; candidate passes 3/3. Full integration suite 78/78 and tsc clean.
2026-10-31 12:55:45 -04:00
rUvandr 49adc540a0 fix(memory): report the original AgentDB open failure; memory_list reports failed queries (#4622); release 3.66.1 (#4623)
- ControllerRegistry keeps the first backend failure AgentDB logs (e.g. a
  native vector store locked by another process) instead of only the last
  fallback's format rejection, exposed as getAgentDBInitError(), with the
  single-owner HTTP remedy. @claude-flow/memory 3.2.0.
- The CLI bridge records that reason, so the sql.js fallback's refusal names
  it, and isBridgeAvailable() is false when AgentDB did not open.
- memory_list returns success:false with the error on a failed query instead
  of an empty inventory.
- Release 3.66.1 with plugin-agent-federation 1.0.4 (#4619 trust thresholds).

Co-authored-by: r <r@x>
2026-10-31 11:17:37 -04:00
rUvandClaude 7208f28c0a dream(security): enforce SecurityPolicy trust thresholds in PolicyEngine (evaluated) (#4619)
* dream(security): #4618 enforce SecurityPolicy.minTrustLevelFor{Write,Memory,Spawn} in PolicyEngine

PolicyEngine.evaluateMessage() gated federation messages solely via the
hardcoded CAPABILITY_GATES table; SecurityPolicy's minTrustLevelForWrite/
Memory/Spawn fields were declared, defaulted, and accepted as constructor
overrides but never read. By default this let memory-query/memory-response
messages through at TrustLevel.ATTESTED, one level below the policy's own
stated minTrustLevelForMemory: TRUSTED.

Adds a per-message-type policy-category check layered as an additional
restriction on top of CAPABILITY_GATES (never a replacement — a loosened
override cannot bypass that hardcoded floor). 10 new discriminating tests;
677/677 full package suite passes; stash-isolated baseline fails the 3
tests this fix targets.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH4ix1BStZRrZwPT81X

* dream(security): #4618 research gist for 2026-10-31

Local gist (gh gist create unavailable this session — GH_TOKEN invalid for
gh CLI; GitHub MCP tools used for issue/PR instead). Witness stamp computed
against candidate commit a85efdf53a.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH4ix1BStZRrZwPT81X

* dream(security): #4618 update LEDGER for 2026-10-31

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH4ix1BStZRrZwPT81X

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-31 10:54:25 -04:00
rUvandr 0d94037eb1 release: 3.66.0 (learning loop on classic hooks ADR-512, lessons name files ADR-511, CI=1 update-check fix) (#4617)
Co-authored-by: r <r@x>
2026-10-31 01:51:22 -04:00
rUvandr 189aceca1d feat(learning): the verified-outcome learning loop on classic hooks, for every ruflo project (ADR-512) (#4604)
* feat(learning): run the verified-outcome learning loop on classic hooks for every ruflo project (ADR-512)

Until now only the opt-in ruflo-mods plugin recorded verified turns and showed lessons. Classic hooks
(every `ruflo init` project) now do the same. They replay the session transcript (`transcript_path`)
through the mod's own record and lesson code, bundled into .claude/helpers/learning-loop.cjs:

- route: records the turns that finished, then prints the lessons that fit the new prompt
- session-end: records the rest (PreCompact leaves the open turn open). This runs before the
  session-id dedup, which otherwise dropped SessionEnd after a PreCompact. It also starts a
  detached `ruflo hooks verified-ingest --quiet`
- one implementation: plugins/ruflo-mods/scripts/build-learning-loop-helper.mjs bundles
  hooks/loop/transcript.ts; the bundle is committed, checked in mod-guidance CI, and is a signed
  critical helper that helper-refresh installs (manifest re-signed)
- never twice: with its loop on, the mod adds `learning-loop` to RUFLO_MODS_OWNS
- opt-out: .claude-flow/config.json learningLoop.enabled=false, or RUFLO_LEARNING_LOOP=0

Tests: mods-learning-loop-classic (replay matches the mod's records, offsets, the hook-handler run
as a process, end to end classic record -> real ingest -> lesson in route output) and real-binary
contract 6 (pinned claude, mock model, no plugin). ruflo-mods 0.14.0.

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

* docs(adr): ADR-512 cites PR #4604

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

* ci: sign and exclude the classic-loop helper and real-binary test where the other helpers are (ADR-512)

smoke-helper-signing-security copies the critical helpers into its fixture; it now copies
learning-loop.cjs too. The ratchet's default run skips real-binary files, which need the
claude binary (mods-real-binary runs them).

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

* test(mods): give the built-CLI tests the time their children get

vitest's 5s default timed out mods-cli-bin on a loaded CI runner and reported only
STACK_TRACE_ERROR (the timeout error carries the stack of the it() call). Each test runs the
built CLI several times with a 120s child timeout.

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

---------

Co-authored-by: r <r@x>
2026-10-30 16:59:46 -04:00
rUvandr 45753638dc fix(update): skip the startup update check for CI=1, not only CI=true (#4608)
* fix(update): skip the startup update check for CI=1, not only CI=true

The startup update check skipped CI only when CI was the literal string 'true'. A CI=1 run
(many CI systems, and the mods-cli-bin test) checked, found a newer published CLI and ran
npm install @claude-flow/cli@<latest> --save-exact in the working directory during ruflo init.
After 3.65.1 was published that install, with native builds, pushed init past the test's
120s child timeout on every branch still at 3.65.0. isCI() now accepts any CI,
CONTINUOUS_INTEGRATION or GITHUB_ACTIONS value except empty, 0 or false.

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

* fix(update): CI detection reads CI and CONTINUOUS_INTEGRATION only

GitHub Actions sets CI=true, so GITHUB_ACTIONS added nothing and broke rate-limiter tests that
clear CI to exercise the non-CI path.

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

---------

Co-authored-by: r <r@x>
2026-10-30 16:59:42 -04:00
rUvandr 4114d92514 release: 3.65.1 (security: http_fetch SSRF via DNS, #4605) (#4606)
(cherry picked from commit 6ea81aa65a)

Co-authored-by: r <r@x>
2026-10-30 15:55:26 -04:00