Repository navigation
test(theoracle): public synthetic retrieval and evidence-gate eval for CI - #25
Merged
Merged
Conversation
…r CI
CI skipped every retrieval-quality test because the knowledge base is private.
Add a synthetic corpus (31 passages, 16 documents) and case set (23 retrieval,
12 therapy-retrieval, 11 gate cases) under tests/fixtures/theoracle-eval/.
Layer 1 runs the gate on each case's declared evidence, with no model.
Layer 2 builds a temporary index with the production builder and the pinned
EmbeddingGemma model, then scores recall@6/MRR, therapy dose recall, the privacy
filter and the gate on what was actually retrieved. CI sets
SENTRAPEDIA_ORACLE_EVAL=required so a missing model fails instead of skipping.
build-theoracle-index.mjs gains --index-dir so the eval reuses the real builder.
Known gap found by layer 1 (g08, it.fails): the tablet rule does not read a
weight band written as a range ("BB 41-59 kg"), so that clause verifies a
tablet count for any patient weight.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012ta9C6s513KoCTM6zpyNXH
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Run 45874985015: clinical recall@6 1 / MRR 1, lay recall@6 1 / MRR 0.938, therapy dose recall 1. Lay recall floor 0.75 -> 1, clinical MRR 0.8 -> 0.9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C6s513KoCTM6zpyNXH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Gafferness · project thread
Why
CI skipped every retrieval-quality check because the TheOracle knowledge base is private. This adds a public, synthetic eval that runs on every PR.
What
tests/fixtures/theoracle-eval/corpus.json: 31 invented passages in 16SINTETISdocuments, including an off-topic document and a privacy trap (phone number). It is not clinically reviewed and is not guidance.tests/fixtures/theoracle-eval/cases.json: 23 retrieval cases (15 clinical, 8 lay wording), 12 therapy-retrieval cases, 11 evidence-gate cases, and thresholds.tests/theoracle-eval.test.ts:gateTherapyruns on each case's declared evidence.node_modules/.cache/theoracle-eval/report.jsonand to the job summary.scripts/build-theoracle-index.mjs --index-dir <folder>lets the eval reuse the real builder. A stub test was added inscripts.node-test.mjs.ci.yml:SENTRAPEDIA_ORACLE_EVAL=requiredmakes a missing model fail the run instead of skipping it.docs/testing.md: new section with the acceptance criteria.Acceptance criteria
Thresholds are provisional until this PR's first CI run.
Known gap found (not fixed here, by owner decision)
Case
g08runs asit.fails. The tablet rule reads a weight band asBB 60 kg, but not as a range likeBB 41-59 kg. A clause with a range band therefore verifies its tablet count for any weight. In a local probe, 4 tablets of DHP for a 45 kg patient came out verified when the bands were written41-59/60-80. The fix goes in a separate PR with clinical review.Verification
Notes
export-split, so this change also needs porting back to the monorepo.THEORACLE_MIN_SIMILARITY): any eval case below the floor would throwTHEORACLE_NO_MATCH.Generated by Claude Code