Skip to content

test(eval): harden force-embedding flag and vector-path eval guards#264

Closed
BigSimmo wants to merge 2 commits into
mainfrom
cursor/force-embedding-eval-d6c9
Closed

test(eval): harden force-embedding flag and vector-path eval guards#264
BigSimmo wants to merge 2 commits into
mainfrom
cursor/force-embedding-eval-d6c9

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Harden forceEmbedding through eval runners, retrieval cache keys, and RAG search paths.
  • Bypass coverage gate, lexical shortcuts, and shared-cache hits when forceEmbedding is set.
  • Add golden-case failure metrics and tests so vector regressions cannot hide behind text-fast-path or cache behavior.

Verification

  • npm run test -- tests/eval-quality.test.ts tests/retrieval-query-variants.test.ts
  • npm run verify:cheap
  • npm run eval:retrieval:quality (retrieval/ranking/scoring behavior changed)
  • npm run check:production-readiness

Clinical Governance Preflight

  • No patient-identifiable workflow changes
  • Service-role keys remain server-only
  • Eval-only hardening; retrieval behavior change is gated behind forceEmbedding test flag
Open in Web Open in Cursor 

BigSimmo and others added 2 commits July 3, 2026 21:00
The golden retrieval set was 100% lexical fast-path (embedding_skipped_rate=1.0), so
it could not measure whether a re-index changes vector/embedding retrieval quality.

- forceEmbedding option on searchChunksWithTelemetry (SearchChunksArgs): bypasses every
  lexical text-fast-path so retrieval always exercises the embedding/vector stage.
  Diagnostic/eval-only; folded into the search cache key; never set on production paths.
- eval-retrieval.ts: per-case `forceEmbedding` field + a global `--force-embedding` flag.
- 10 `vector-*` cases (psychiatric monographs: PTSD, OCD, panic, anorexia, GAD, Tourette,
  postnatal, bipolar, ADHD, opioid) with forceEmbedding=true. Each is a clinical query that
  must be answered by vector retrieval of the right monograph — verified live at
  document_recall@5=1.0, content_recall@5=1.0, all via strategy=hybrid (embedding used).

Rationale: forcing embedding is the correct instrument for re-index measurement — you want
to measure the vector index directly, not have a lexical shortcut mask a regression. Wording
alone can't reliably force the vector path (the fast-path is driven by emergent lexical-match
strength), so the flag makes these probes deterministic.

Live golden eval: 34/34 pass (24 existing + 10 new), no regression. verify:cheap green (980).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wire forceEmbedding through eval runners and retrieval cache keys, bypass coverage/lexical shortcuts when forced, and add golden-case failure metrics so vector regressions cannot hide behind text-fast-path or cache hits.
@supabase

supabase Bot commented Jul 5, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@BigSimmo

BigSimmo commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #269 (consolidated platform fixes branch).

@BigSimmo BigSimmo closed this Jul 5, 2026
@BigSimmo
BigSimmo deleted the cursor/force-embedding-eval-d6c9 branch July 8, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant