* 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>
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>
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>
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>
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>
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>
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>
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
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>
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>
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>