* dream(performance): #3265 stop re-tokenizing MMR candidates that PR #3169 mostly stopped needing
mmrRerank() eagerly re-tokenized every remaining candidate's content on
every outer-loop pass (O(N x limit) tokenize() calls), a pattern that
predates and survived PR #3169 unchanged. #3169 made embedding-cosine
the preferred, now-common pairSimilarity path, so most of that
tokenization was computed and then discarded. Tokens are now computed
lazily and cached per-candidate, only when the Jaccard fallback is
actually needed.
Evaluated: tokenize() calls 400 -> 0 on a 30-candidate/limit-20
all-embedded corpus (stash-isolated: fails against real baseline,
passes against candidate); vitest bench shows the candidate 5.88x
faster (independently reproduced at 5.96x by an adversarial critic).
Selection output is byte-for-byte identical to baseline across
all-embedded/no-embedding/mixed scenarios. 473/474 full package suite
both ways (1 pre-existing, unrelated environmental failure), tsc clean.
Evaluated, ACCEPT. Full research (5-role parallel fan-out), evaluation
receipt, adversarial critique, Darwin/Flywheel scoping, reward-hack
check, and security/hive-mind scan findings in the linked issue and
gist.
Closes#3265
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01P5UJ62RVAbq8DLEEXPrwvU
* dream(performance): append 2026-09-10 ledger row (#3265, #3266)
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01P5UJ62RVAbq8DLEEXPrwvU
---------
Co-authored-by: Claude <noreply@anthropic.com>
* dream(memory): #3056 hybridSearch reachable via explicit opt-in without memoryService
The ADR-125 Phase 5 three-arm (dense+sparse+entity) RRF/MMR fusion
controller was fully built and tested but unreachable from any
production call site: its explicit-enable config override worked at
the isControllerEnabled() gate but the createController() factory
still unconditionally required a hand-built UnifiedMemoryService,
silently returning null otherwise. Falls back to the existing
this.backend when it type-guards as AgentDBAdapter-compatible,
reachable only via explicit controllers: { hybridSearch: true } --
default auto-enable behavior is unchanged.
New deterministic $0 benchmark quantifies the feature's actual
retrieval-quality effect for the first time (previously only
functional/unit tests existed): +0.267 aggregate recall@10, with a
disclosed, statistically significant regression on pure-paraphrase
queries where fusion noise dilutes an already-perfect dense signal.
Independent adversarial critic (fresh subagent): CONFIRMED-SAFE,
reproduced bit-for-bit. 75/75 tests passing in touched files, 458/459
in the full package (1 pre-existing environmental failure, unrelated).
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_016T1JRz8NBeGGmxQJVPReWa
* dream(memory): #3056 update ledger with 2026-08-14..18 nights + PR #3057
Reconstructs the v2 live-entries table from PR/issue history since each
night's own LEDGER.md edit lives only on its unmerged branch and never
reaches main (0% merge rate). Adds tonight's row (memory, hybridSearch
reachability fix, ACCEPT scoped, witness b28714fb...).
Co-Authored-By: RuFlo <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_016T1JRz8NBeGGmxQJVPReWa
---------
Co-authored-by: Claude <noreply@anthropic.com>
Previously `npm run bench` matched no files because `vitest.config.ts`
restricts include to `src/**/*.test.ts`. ADR-125 Phase 6 lands a dedicated
`vitest.bench.config.ts` that discovers `benchmarks/**/*.bench.ts`, and
the `bench` script now points at it.
Additions:
- `vitest.bench.config.ts` — bench discovery config; legacy custom-framework
bench files (cache-hit-rate, hnsw-indexing, memory-write, vector-search)
are excluded for now and will be ported in a follow-up alongside Phase 3.
- `benchmarks/hnsw-search.bench.ts` — first real vitest `bench()` suite.
Measures `HNSWIndex.search` (k=10, k=50) and `addPoint` against 1k random
128-dim vectors.
- `benchmarks/results/baseline-20260519T212453Z.md` — first measured baseline,
committed so the README perf table has a real referent.
- `benchmarks/results/scripts/run-baseline.mjs` — companion script that
produces the JSON blob the baseline.md references.
Measured baseline on Darwin / M-series:
build_time_ms: 533.42 (1k vectors, 128-dim)
search_k10_avg_ms: 0.5294 (~1.9k ops/s)
search_k50_avg_ms: 0.5235
add_avg_ms: 0.8656
378 tests still passing — no regression.
Refs: ADR-125 Phase 6
Closes: part of #2061
Co-Authored-By: RuFlo <ruv@ruv.net>