4139 Commits
Author SHA1 Message Date
randRuFlo 49cc62e772 chore(release): 3.76.1
auto-memory import/sync now exit 1 when @claude-flow/memory is unavailable (#4963, #4974).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-12 14:14:45 -05:00
randRuFlo 9ffcb32215 fix(helpers): auto-memory import/sync exit 1 when @claude-flow/memory is unavailable (#4963)
The warning was loud but both commands returned exit 0, so a hook runner
saw success when nothing was imported or synced. doImport/doSync now return 1
(packaged helper, repo copy and the init generator fallback); a thrown error
and the other commands are unchanged. Helpers manifest re-signed.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-12 13:58:09 -05:00
randRuFlo 06752888f6 Merge origin/main into release/3.76.0 (#4961, #4964)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-11 08:42:49 -05:00
rUv 1faf0a95c2 Merge pull request #4964 from kevin9327/fix/task-complete-credit-once
fix(tasks): credit task_complete only to the worker still holding the task
2026-11-11 08:42:47 -05:00
rUv 771c9ccfc6 Merge pull request #4961 from ruvnet/dream/2026-11-11-security
dream(security): settings-risk-scanner misses node/deno/bun/php interpreter allow-rules (evaluated)
2026-11-11 08:32:03 -05:00
randRuFlo bc3252133f fix(cli): show the centroid method in the hooks route table
With CLAUDE_FLOW_ROUTER_CENTROID=1 the table printed 'Method: keyword' while
Backend said 'nearest centroid'.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-11 08:29:01 -05:00
randRuFlo 3193d99ecb chore(release): 3.76.0
@claude-flow/cli, claude-flow and ruflo 3.76.0. Carries #4953 (opt-in centroid
agent router, ADR-527), #4956 (darwin ~0.14.0), #4958 (neural router assets
shipped), #4955 (memory 3.3.2, agentdb ^3.10.0), #4948, #4946 and #4949.
alpha/v3alpha stay at 3.75.2.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-11 08:18:30 -05:00
kevin 6239972d4c fix(tasks): credit task_complete only to the worker still holding the task
task_complete bumped taskCount for every assignee, even one that no
longer held the task. Completing a reopened task again (complete ->
pending -> complete, no reassignment) counted the same work twice,
which task_update already avoids by crediting only the holder.
2026-11-11 22:06:53 +09:00
randRuFlo 562dc93cc2 deps(cli): pin @claude-flow/memory 3.3.2 (published)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-11 08:02:38 -05:00
randRuFlo 2044517dd3 deps(memory,cli): require agentdb ^3.10.0; memory 3.3.2
- @claude-flow/memory: agentdb ^3.7.2 -> ^3.10.0, version 3.3.0 -> 3.3.2
  (3.3.1 is already on npm from release/memory-3.3.1, not yet on main)
- @claude-flow/cli: optional agentdb ^3.6.0 -> ^3.10.0
- v3/pnpm-lock.yaml: agentdb 3.7.2 -> 3.10.0 for cli/memory/neural; the
  orphaned 3.7.2 block is dropped; aidefence's peer still resolves 3.6.0.
  New transitive packages come from agentdb 3.10.0's exact-pinned deps
  (ruv-fann 0.1.2, ruv-fann-wsp 0.1.0, ruv-fann-wasm 0.1.2, ruvector 0.3.20,
  @ruvector/* bumps).

The CLI's exact @claude-flow/memory pin is deliberately left at 3.3.0:
memory 3.3.2 must be published before that pin moves.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-11 07:58:55 -05:00
Claude 609d425af6 dream(security): #4960 revert out-of-scope CJS-mirror edit, fix CI
The "guard" check failed: __tests__/helper-signing.test.ts's Ed25519
provenance gate (ADR-174) caught that v3/@claude-flow/cli/.claude/helpers/
hook-handler.cjs -- the npm-shipped, cryptographically signed helper
artifact -- no longer matched helpers.manifest.json's signed hash. The
previous commit's CJS-mirror port (done by an independent adversarial
critic reviewing this PR) edited that file directly; re-signing it
requires the GCP-held ruflo-helpers-signing-key, a release-time operation
explicitly out of scope and authority for this nightly research session.

A second, separate test (session-start-hook-settings-risk-scan.test.ts's
"root and package hook-handler.cjs copies are byte-identical" check) means
the root copy can't diverge from the package copy either, so reverting
only one side was not an option.

Reverted hook-handler.cjs (both copies) and the parity-test's node/deno/
bun/php sample additions to their pre-critique state. The core candidate
(settings-risk-scanner.ts + its own test/corpus) is untouched and remains
ACCEPT on its own evaluation. The CJS-mirror gap the critic found is real
and still open -- recorded in the gist/issue as a disclosed, not-fixed
finding for a future night that can go through the real signing pipeline,
rather than fixed here by defeating the gate that exists to catch exactly
this kind of unsigned edit.
2026-11-11 06:35:46 +00:00
Claude fe3808bbef dream(security): settings-risk-scanner misses node/deno/bun/php interpreter allow-rules
scanAllowRuleForRisk() flagged permissions.allow rules pre-approving
bash/sh/python/ruby/perl/curl/wget etc. with no per-call confirmation, but
not an equivalent pre-approval of node/deno/bun/php -- GTFOBins-documented
shell-breakout interpreters in the same risk tier as the words already
covered. This repo's own committed .claude/settings.json carries a live,
fully-unscoped "Bash(node:*)" allow-rule this exact scanner never flagged.

Adds a dedicated INTERPRETER_WORDS list feeding only RISKY_PREAPPROVE_WORDS
(scanAllowRuleForRisk), deliberately kept out of SHELL_EXEC_WORDS so
scanCommandStringForRisk's existing node-exemption for ruflo's own fixed
hook command strings stays untouched. Corrects the benchmark corpus's
Bash(node:*) ground-truth label (was malicious:false) and adds
deno/bun/php samples; recall 0.75->1.0, precision 1.0 both ways.

An independent adversarial critique (fresh context) confirmed the fix and
additionally found this session's TS-only change would have left the
hook-handler.cjs CJS mirror (used by the session-restore hook that runs on
every session boot) out of sync on these exact cases -- ported the same
word list into both copies and extended the CJS/TS parity-guard test to
cover it. This session closed the remaining non-blocking caveat (untested
prefix-collision safety for nodemon/phpunit/bunx/denoland) with a
dedicated regression test.

Dream Cycle 2026-11-11 (security, slot 1; scan: intelligence, swarm).
2026-11-11 06:30:08 +00:00
randRuFlo 89a323fdc9 test(cli): check #4954 assets against files instead of spawning npm pack
npm pack crashed under CI's parallel vitest run ("Exit handler never
called"). The guard now matches each default-path asset against the
package's `files` globs; it still fails on main.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 23:18:52 -05:00
randRuFlo 79137ced73 fix(cli): ship the neural router's bundled assets (#4954)
With CLAUDE_FLOW_ROUTER_NEURAL=1 the router loads seed-router.krr.json,
the low/med/high KRR specialists, four isotonic calibrators and
seed-rows.json from assets/model-router/. None were in `files`, so an
npm install fell back to k-NN-less behaviour while a repo checkout used
the calibrated KRR. Ships those nine files byte-for-byte; leaves out
the FastGRNN safetensors (read only from CLAUDE_FLOW_ROUTER_MODEL_PATH)
and the provenance note. Tarball: +2.13 MB gzipped, +4.87 MB unpacked.

A pack-listing test guards every default-path asset, including the
ADR-527 centroid artifact.

Fixes #4954

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 23:18:52 -05:00
randRuFlo b9b053e29a deps(cli): @metaharness/darwin ~0.14.0 (#4952)
0.14.0 adds an opt-in numeric surrogate (ruv-fann as an optional peer).
Without the surrogate config, evolveNumeric behaves as in 0.13.1, and
exports are unchanged. Moves the CLI range, the plugin's
DARWIN_PIN_VERSION and MH_DARWIN_PIN together. v3/pnpm-lock.yaml gains
a darwin@0.14.0 entry; 0.13.0 stays for metaharness, ruvector and
ruvllm-gpu-loop, which still declare ^0.13.0.

Fixes #4952

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 22:48:24 -05:00
rUv 60ca1a7496 Merge pull request #4953 from ruvnet/feat/centroid-agent-router
feat(router): opt-in nearest-centroid agent router (ADR-527)
2026-11-10 17:16:22 -05:00
rUv 0ef9f2de0b Merge pull request #4949 from ruvnet/test/4930-darwin-parity-diagnostics
test(metaharness): diagnose bench parity flake, fix 404-in-digest degraded misclassification (#4930)
2026-11-10 17:16:00 -05:00
randRuFlo 1f745addb5 fix(router): centroid confidence, abstain rank and learned-route bypass (ADR-527)
- A decided 'none' now reports NO_MATCH_CONFIDENCE, and a decided agent's
  confidence is a monotone rescale above it: raw cosine (0.2-0.6) ranked 25 of
  101 real test matches below a no-match (#3567). Raw cosine stays in
  centroid.score.
- When AgentDB or a persisted SONA pattern answers first, the response carries
  centroid.status 'bypassed' under the flag, so a pilot's fallback rate counts it.
- ADR: drop the 'wrong at >=0.7' claim (the raw scale never reached 0.7), record
  the clean-install check, per-process CLI cost, and that the margin grid's
  test accuracy was printed.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 15:02:42 -05:00
randRuFlo ac36136d02 feat(router): opt-in nearest-centroid agent router (ADR-527)
CLAUDE_FLOW_ROUTER_CENTROID=1 routes hooks_route tasks to the nearest MiniLM
centroid of the ADR-391 corpus dev split. Held-out test: 63.7% vs 25.7% for
the current default, falling back on 1.8% of prompts. Off by default: p95
latency fails the ADR-391 gate.

- Centroids are versioned with the embedder (embedder, model, dim); a query
  embedded any other way is refused and the current router decides.
- Near-ties (top-two margin < 0.005) keep the current router's pick.
- Every flagged response carries centroid.baselineAgent for pilot comparison.
- The local embedder now records which model produced a vector (modelId).
- ruv-fann routing deferred: training never beat the centroid on dev CV.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 14:56:24 -05:00
randRuFlo 8421e87322 chore(release): 3.75.3
@claude-flow/cli, claude-flow and ruflo 3.75.3. Carries #4905 (shared 3.0.8,
zod 4), #4947 (memory 3.3.1 pin), #4943, #4935, #4934, #4936 and #4938.
ruflo-graph-intelligence plugin 0.3.1 (the version audit ignores prerelease
tags, so 0.3.0 did not count as a raise over 0.3.0-alpha.1).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 14:09:19 -05:00
r baa3041a52 Merge remote-tracking branch 'origin/release/memory-3.3.1' into release/3.75.3 2026-11-10 14:08:38 -05:00
r 375070d0e1 Merge remote-tracking branch 'origin/weaver/ruflo-shared-zod4' into release/3.75.3 2026-11-10 14:08:38 -05:00
randRuFlo dad3aeb365 chore(swarm): 3.0.6 — Raft legacy requestVote vote-once and log checks (#4938)
Published to npm from this commit.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 14:06:49 -05:00
randRuFlo 0383c7e7b6 fix(metaharness): do not classify a "404" inside a hex digest as darwin unavailable
DEGRADED_RX matched any 404 substring. When bench.mjs cannot import
darwin (CI's Test V3 Packages job installs only v3/ with pnpm, so the
plugin script finds no @metaharness/darwin and runs the cached darwin
CLI), darwin reports a tampered suite on stderr with both sha256 digests.
A digest containing "404", about 3% of tampered suites, made
classifyDegraded() report the tamper as "darwin not available", and the
script exited 0 instead of 1.

The 404 token now has to stand alone ("404 Not Found", "E404"). The
regression test runs classifyDegraded on a tamper message whose digests
contain 404, and checks that the npm 404 forms are still classified as
unavailable.

Refs #4930

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 13:11:09 -05:00
rUv b2f48e5a88 Merge pull request #4936 from NotZhu/fix/4750-require-pinned-key
fix(transfer): refuse self-declared keys when verification is required
2026-11-10 13:08:48 -05:00
randRuFlo e89236b0ec chore(memory): 3.3.1 — onInsightAccessed key lookup (#4942) + package metadata (#4932)
Bumps @claude-flow/memory to 3.3.1 and moves the CLI's exact pin. Must not
merge before @claude-flow/memory@3.3.1 is on npm (audit-leaf-versions-published).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 13:08:07 -05:00
randRuFlo 0352da8033 test(metaharness): report darwin resolution path and subprocess tails on bench parity mismatch
bench.mjs now adds a top-level darwinSource field to every JSON payload
(library | cli-local | cli-cache | none). A degraded payload also carries
the darwin CLI's exit code and stderr tail. Existing fields and exit codes
are unchanged. runDarwin() returns the resolved bin source, and the shared
degraded emitter takes optional extra diagnostic fields.

darwin-inprocess-adr526 puts darwinSource, the degraded reason, and the
stdout/stderr tails in the assertion message when the bench.mjs
subprocess exit code is not the expected one.

Refs #4930

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 13:07:04 -05:00
r b6a2004307 Merge remote-tracking branch 'pr/4932' into release/memory-3.3.1 2026-11-10 13:06:21 -05:00
r 397a8932d1 Merge remote-tracking branch 'pr/4942' into release/memory-3.3.1 2026-11-10 13:06:20 -05:00
randRuFlo e3dbd8b216 chore(cli): pin @claude-flow/shared 3.0.8 (zod 4) in cli and root
shared 3.0.8 is on npm, built from this branch's head 824b38a75 (dist
byte-identical to a local build of that commit). The cli importer now
links the workspace shared; the orphaned registry shared@3.0.7 entry is
dropped from the pnpm lock.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 13:05:57 -05:00
rUv 6ba2aac474 Merge pull request #4938 from ruvnet/dream/2026-11-10-hive-mind
dream(hive-mind): RaftConsensus legacy requestVote() skips vote-once-per-term/log-up-to-date checks (evaluated, ACCEPT) #4937
2026-11-10 13:03:22 -05:00
rUv 3d62de7752 Merge pull request #4934 from lj1166/fix/4746-companion-write-safety
fix(init): publish companion helpers without following links
2026-11-10 13:02:44 -05:00
rUv 273018a7be Merge pull request #4935 from kevin9327/fix/task-update-reopen-completed-at
fix(tasks): clear completedAt when task_update reopens a finished task
2026-11-10 13:02:34 -05:00
rUv 384b1ff5d9 Merge pull request #4943 from Tong-bit-art/fix/doctor-driver-module-reset
test(doctor): reset modules before applying the driver mock
2026-11-10 13:02:19 -05:00
randRuFlo 9d1202e40c chore(release): 3.75.2
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 11:35:33 -05:00
randRuFlo 7cb8603b7f fix(release): ship zod 4 inside the bundled security package; release 3.75.1 (#4940)
@claude-flow/cli 3.74.1 and 3.75.0 (and the claude-flow umbrella) bundle
@claude-flow/security 3.0.7, which needs zod >=4.6.7, while the wrappers
keep zod 3. The staging script stripped the nested dependencies, so
security's `import 'zod'` resolved to zod 3 and the root export threw
`z.config is not a function`.

Declaring the dependency is not enough: npm never installs the
dependencies of a bundled package (checked against the 3.75.0 tarball).
The stager now vendors declared leaf dependencies into the bundled
package's own node_modules, checks the workspace copy satisfies the
declared range, and refuses a dependency that has dependencies itself.

The npx-install smoke now imports every bundled runtime package from the
installed CLI, so this fails CI instead of users.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-10 08:40:27 -05:00
马建彤 6b8dfa1a3a test(doctor): reset modules before applying the driver mock
The doctor Memory Persistence Driver suite can run after another file already imported doctor.ts in the same worker. Its vi.doMock('better-sqlite3') then does not affect the cached module, so the Memory Integrity check reports pass instead of the expected warn; the full CI ratchet has hit this intermittently.\n\nReset the module registry inside runDoctor() before importing doctor.ts, so the current test's mock always applies. The targeted binding-failure case passes; the rest of the file's local failures are the known Windows missing-native-binding environment.
2026-11-10 21:28:17 +08:00
PerryLink 39812bb5ed fix(memory): resolve insight keys in onInsightAccessed and update by entry id (#4911)
`onInsightAccessed()` resolved its argument with `backend.get(entryId)`, but
the bridge's callers address insights by the key they were stored under
(AutoMemoryBridge.storeInsightInAgentDB), while `createDefaultEntry` mints the
internal `entry.id` independently. A key lookup missed silently: no confidence
boost, no post-consolidation trajectory reopen. The same mismatch passed the
key to `backend.update()`, which expects the id.

Resolve with `getByKey(insightNamespace, entryId)` first and fall back to
`get(entryId)` for id callers, then update by `entry.id`.

Adds a regression test that stores an entry under its key, accesses it by
that key, and asserts the boost is applied to the internal entry.
2026-11-10 21:06:25 +08:00
ClaudeandRuFlo 6b9354650f dream(hive-mind): RaftConsensus legacy requestVote() skipped vote-once-per-term/log-up-to-date checks
The no-transport "legacy in-process" requestVote() path -- the real
production path, since no call site in v3/ ever wires a ConsensusTransport
into createRaftConsensus() -- granted votes on a bare
`currentTerm > peer.currentTerm` comparison, unlike the transport RPC path
and handleInboundRaftMessage() a few lines above it, which both correctly
apply Raft's vote-once-per-term and log-up-to-date receiver rules
(sec 5.2/5.4). A candidate whose term was higher only from repeated failed
elections (not log progress) could win a vote over a peer with a more
advanced log -- a real Leader Completeness safety violation. The same
strict `>` comparison also wrongly rejected a same-term candidate with an
at-least-as-fresh log when the peer had not yet voted.

Fixes the legacy path to apply the same rule already used correctly twice
elsewhere in this file. appendEntries()'s legacy path has an analogous
missing prevLogIndex/prevLogTerm check, deliberately left out of this patch
to keep it to one conceptual change; disclosed as a follow-up.

4 new discriminating/control tests, stash-isolated baseline 378/380 (2
predicted failures) -> candidate 380/380, 0 regressions, tsc --noEmit clean.

Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01ReiDH3S4EbKdQdNK4cgQS3
2026-11-10 06:22:34 +00:00
NotZhu 50652b1373 fix(transfer): refuse self-declared keys when verification is required
requireVerification now means what it says: when it is on, a pattern must be verified against a pinned key from StoreConfig.trustedRegistryPublicKeys. A self-declared pattern.publicKey is no longer trusted on its own, closing the self-sign gap left by #4750. Adds the two cases the review flagged (self-signed entry refused with verification on; still accepted when it is off).
2026-11-10 14:04:26 +08:00
rUv 4184c5cc24 Merge pull request #4933 from ruvnet/weaver/aidefence-agentdb-store
fix(aidefence): make the documented AgentDB vector store work (3.2.0, 3.2.1)
2026-11-10 00:31:40 -05:00
rUv 6f1acb1e87 Merge pull request #4821 from lj1166/fix/4754-bound-imports-and-join
fix(mcp): bound imports and federation join inputs
2026-11-10 00:16:14 -05:00
rUv a8970c2618 Merge pull request #4829 from MannXo/fix/4748-federation-require-jcs
fix(federation): default signatureMode to require-jcs
2026-11-10 00:16:10 -05:00
rUv cb39f37e18 Merge pull request #4830 from MentaNew/fix/embeddings-init-zero
Fix/embeddings init zero
2026-11-10 00:16:06 -05:00
rUv a3a38378af Merge pull request #4853 from NotZhu/fix/4734-readonly-getentry
fix(memory): make getEntry a read-only path, drop whole-image write (#4734)
2026-11-10 00:16:01 -05:00
rUv 25ac216aed Merge pull request #4879 from NotZhu/fix/transfer-store-download-hardening
fix(transfer): verify pattern downloads against a trusted key and bound size/time
2026-11-10 00:15:57 -05:00
rUv 7a2905f36e Merge pull request #4519 from ruvnet/fix/daemon-queue-supervisor-gate
fix(daemon): the dispatch queue lives in the user's state dir, not the project
2026-11-10 00:02:11 -05:00
randRuFlo b4f55ec56f chore(cli): pin @claude-flow/aidefence 3.2.1 (published)
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-09 22:37:26 -05:00
ruv f9abbf84ca fix(aidefence): no hidden 0.7 similarity floor in searchSimilarThreats (3.2.1)
3.2.0 shipped the AgentDB adapter, but searchSimilarThreats() defaulted
minSimilarity to 0.7. InMemoryVectorStore ignored that value; the adapter
honours it, and MiniLM cosine over regex-source pattern text measures
0.22-0.41. With agentdb installed, default searches and the README example
returned [] (seen in the post-publish smoke test).

- Default minSimilarity is now 0 (ranked, no floor); callers can still pass one.
- The test no longer depends on order: either learned threat type may rank first.
- The README example uses the defaults; it was run against the packed tarball,
  with and without agentdb installed.

agentdb is not a devDependency. CI installs it with --no-save in
aidefence-tests.yml, so the pnpm lockfile is unchanged.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-11-09 22:11:59 -05:00
kevin 13862a61d5 fix(tasks): clear completedAt when task_update reopens a finished task
Moving a completed, failed or cancelled task back to pending or
in_progress kept the old completedAt, so task_status and the store
reported a finish time for a task that is unfinished again.
2026-11-10 12:03:21 +09:00