Commit Graph
2987 Commits
Author SHA1 Message Date
rUvandr 722232566a fix(memory): RvfBackend search through hnsw-index.ts (recall@10 0.09 → 0.89) (#4836)
* fix(memory): RvfBackend search through hnsw-index.ts (recall@10 0.09 -> 0.89)

RvfBackend's inlined HnswLite seeded every search from the first
efConstruction vectors in insertion order and BFS'd a flat neighbour graph,
and each insert was an O(n) brute-force scan. Measured against exact search
on 5,000 random unit vectors (cosine, 200 queries, seed 42):

  index                     384-dim recall@10  1536-dim  clustered 384
  HnswLite (before)         0.091              0.079     0.999
  @ruvector/diskann 0.1.3   0.896              0.739     1.000
  hnsw-index.ts, ef=200     0.888              0.744     0.990

DiskANN matched HNSWIndex on recall but a vector inserted after build() is
not searchable until a full rebuild (3.6-4.3 s at 1k vectors), which breaks
store()-then-search(). HNSWIndex is incremental and is the single HNSW
implementation ADR-125 asks for, so RvfBackend now uses it through a private
RvfVectorIndex (not exported; the prepublishOnly surface check still passes).

- indexes of <= 1000 vectors and dimension-mismatched queries use an exact scan
- distances map back to the old similarity scale; threshold filter unchanged
- re-storing an entry without an embedding removes its old vector
- update() re-indexes when an untyped caller passes an embedding

New rvf-backend-recall.test.ts drives the real RvfBackend.search: recall@10
>= 0.9 on 2000 random 64-dim vectors (HnswLite scored 0.294 there), exact
results at 300 vectors, delete/re-store correctness, recall after reopen.

@claude-flow/memory 3.2.2 -> 3.2.3.

Co-Authored-By: claude-flow <ruv@ruv.net>

* chore(memory): leave the version at 3.2.2 in this PR

audit-leaf-package-publish requires the CLI pin to cover the workspace
version, and audit-leaf-versions-published requires that pin to exist on the
registry. The 3.2.3 bump, its publish and the CLI pin move together in the
release that follows.

Co-Authored-By: claude-flow <ruv@ruv.net>

* release(memory): @claude-flow/memory 3.2.3, CLI pins it

The RvfBackend change has to reach users through a standalone publish:
memory is not bundled into the release tarballs (Publishing Rules).
@claude-flow/memory@3.2.3 is published from this branch's tree; the CLI pin
(dependencies + optionalDependencies) moves to it so audit-leaf-package-publish
and audit-leaf-versions-published both hold. The lockfile also gains the
@ruvector/sona 0.1.10 package entries pnpm reported missing.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-11-05 19:27:51 -06:00
randRuFlo 096101e794 test(mcp): ship the protocol module in stdio stub fixtures (ADR-524)
The bin launchers now import dist/src/mcp-protocol.js, so the two fixtures
that copy a launcher into a stub tree transpile it from source (as the
policy fixture already does for policy-enforcer). The dispatch-contract
regex accepts the forwarded trace context.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 18:41:18 -05:00
randRuFlo 4943f24efe release: 3.72.0
Minor bump: ADR-524 adds MCP 2026-07-28 support (server/discover, new
error codes, result fields). Supersedes the unpublished 3.71.5 bump.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 17:54:03 -05:00
randRuFlo 4afd1aa69a feat(mcp): serve MCP 2026-07-28 from the stdio servers (ADR-524)
All three stdio MCP servers (bin/cli.js, bin/mcp-server.js, MCPServerManager)
answered initialize with a hardcoded 2024-11-05 and knew nothing of the
2026-07-28 revision. They are now dual-era through one shared module,
src/mcp-protocol.ts:

- initialize echoes a supported legacy version (else 2025-11-25) and reports
  the real package version
- server/discover answered with or without _meta (stdio probe)
- per-request _meta version: -32022 for unknown, -32602 when a modern request
  lacks clientCapabilities
- modern results carry resultType and serverInfo; list results carry
  ttlMs/cacheScope; legacy responses are unchanged
- tools/list sorted by name in both eras (stable prompt caches)
- resources/read uses -32602 for modern, -32002 for legacy
- validated W3C traceparent/tracestate forwarded into the tool-call context

Tasks extension, subscriptions/listen and the HTTP package are Phase 2.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 17:52:44 -05:00
randRuFlo 2306c0adf4 test(cli): mock @claude-flow/aidefence in the #4767 wrapper tests
The root CI job has no built aidefence, so aidefence_has_pii fell through to
the auto-install path and failed. The test covers the MCP wrapper, not the
detector.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 11:24:36 -05:00
randRuFlo 7acac7ad25 test(cli): use parser-shaped skipMcp in the start test; run the FIFO reader from the cli package
The start command now reads the camelCase key the parser produces (#4814),
and the root vitest runs from v3/, where tsx is not hoisted (#4821).

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 11:05:37 -05:00
randRuFlo 760d514112 fix(hooks): give pre-bash a 3 s stdin window and re-sign helpers (#4826)
pre-bash now blocks when it gets no command (#4743), so a host that delivers
hook input after 500 ms would have every Bash command blocked. The read ends
at EOF, so a prompt host waits no longer.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 10:42:57 -05:00
r f9063010a2 Merge PR #4826 2026-11-05 10:42:06 -05:00
Parman Mohammadalizadeh fd6c7c4864 fix(hooks): block pre-bash when the command cannot be validated
pre-bash exited 0 on every failure path, so a command passed whenever the
hook input arrived after the 500 ms stdin window, failed to parse, or
raised an exception, and when the 5 s safety timer fired.

pre-bash now exits 2 with a [BLOCKED] reason when no command string was
obtained, when stdin is not valid JSON, in the handler and main catch
paths, and from the safety timer. Every other hook keeps exiting 0.

Fixes #4743
2026-11-05 16:36:13 +01:00
randRuFlo 95ec6e44e8 feat(aidefence): select MCP pattern packs with RUFLO_AIDEFENCE_PACKS (#4785)
Unset keeps the current options exactly. true/false or a comma list of pack
names is passed to createAIDefence in every load and retry branch; any other
value is refused with a clear error.

Closes #4785

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 10:03:51 -05:00
r dc79625daa Merge PR #4823 2026-11-05 10:02:24 -05:00
randRuFlo 6a7097a3ab release: 3.71.5
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 09:56:17 -05:00
randRuFlo 77ca18dcde fix(hive-mind): refuse a role outside worker/specialist/scout on spawn and join
Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 09:55:58 -05:00
randRuFlo 08fb7acf88 fix(cli): re-sign helpers manifest for the statusline fix; drop the duplicate fs mock in the #4716 test
vitest resolves 'fs' and 'node:fs' to one module, so the second mock
(existsSync: () => false) won and 8 tests failed on Linux.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 09:55:11 -05:00
r d1e4cb92d9 Merge PR #4821
# Conflicts:
#	v3/@claude-flow/cli/src/mcp-tools/memory-tools.ts
2026-11-05 09:54:40 -05:00
r 55603d7745 Merge PR #4820 2026-11-05 09:54:32 -05:00
r ff187f8402 Merge PR #4819 2026-11-05 09:54:32 -05:00
r 6183087803 Merge PR #4818 2026-11-05 09:54:32 -05:00
r ebc84e0c81 Merge PR #4817 2026-11-05 09:54:32 -05:00
r 9732dda7cd Merge PR #4809 2026-11-05 09:54:31 -05:00
r 4bfa874a13 Merge PR #4808 2026-11-05 09:54:31 -05:00
r 52ec160d5a Merge PR #4807 2026-11-05 09:54:31 -05:00
r 7a4129a418 Merge PR #4806 2026-11-05 09:54:31 -05:00
r fa5684cd42 Merge PR #4805 2026-11-05 09:54:31 -05:00
r a020194cee Merge PR #4804 2026-11-05 09:54:31 -05:00
r 84c0859689 Merge PR #4803 2026-11-05 09:54:31 -05:00
randRuFlo 704330e488 fix(cli): reuse an identical corrupt-store backup; bump workflows 0.7.2 and plugin-creator 0.4.5
Polling a corrupt store made a new .corrupt-<ts> copy on every read (#4779
review). A backup with identical bytes is now reused.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-11-05 09:53:38 -05:00
r 1aa99f258b Merge PR #4816 2026-11-05 09:52:46 -05:00
r b05e1c99f0 Merge PR #4815 2026-11-05 09:52:46 -05:00
r 433aa17e9a Merge PR #4814 2026-11-05 09:52:46 -05:00
r a164a000dc Merge PR #4813 2026-11-05 09:52:46 -05:00
r 499838c50f Merge PR #4812 2026-11-05 09:52:46 -05:00
r c7ce8749d9 Merge PR #4810 2026-11-05 09:52:45 -05:00
r 36454822e6 Merge PR #4802 2026-11-05 09:52:45 -05:00
r dbb29864ac Merge PR #4800 2026-11-05 09:52:45 -05:00
r ef4932de1f Merge PR #4799 2026-11-05 09:52:45 -05:00
r 186183810f Merge PR #4798 2026-11-05 09:52:45 -05:00
r 1bac85340b Merge PR #4796 2026-11-05 09:52:45 -05:00
r c35dba9db8 Merge PR #4795 2026-11-05 09:52:45 -05:00
r 2d684a34df Merge PR #4794 2026-11-05 09:52:45 -05:00
r 39e27abd46 Merge PR #4793 2026-11-05 09:52:45 -05:00
r 22fe44dae3 Merge PR #4790 2026-11-05 09:52:45 -05:00
r b901ab70ae Merge PR #4789 2026-11-05 09:52:45 -05:00
r 590394309a Merge PR #4787 2026-11-05 09:52:45 -05:00
r 2ce0746316 Merge PR #4786 2026-11-05 09:52:45 -05:00
r e2996013c6 Merge PR #4781 2026-11-05 09:52:45 -05:00
r afe8df0399 Merge PR #4780 2026-11-05 09:52:45 -05:00
r 0f71cf5e44 Merge PR #4779 2026-11-05 09:52:45 -05:00
r 3f80491e68 Merge PR #4778 2026-11-05 09:52:45 -05:00
r a6ed2d6aea Merge PR #4777 2026-11-05 09:52:45 -05:00