Repository navigation
TheOracle: relevance floor and explicit no-evidence path - #24
Merged
Merged
Conversation
Retrieval sent the top passages to the model whatever their similarity, so an off-topic case was still "grounded" on unrelated guideline text. - THEORACLE_MIN_SIMILARITY (provisional 0.30, uncalibrated) drops every passage below the floor in case, dose-swap and therapy retrieval; nothing above it -> THEORACLE_NO_MATCH (422, no model call). - Therapy no-match now says "no relevant therapy reference" instead of reporting an outage. - Composer shows "Tidak ada bukti di Oracle" for no-match, without the pointless "Coba lagi"; the local SOAP draft stays available. - benchmark:oracle gains a relevanceFloor calibration section and no longer crashes when a query answers no-match. - Tests: 7 new (red before, green after); docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C7XhCnabM5SwJLKnmU
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…data The pinned model on the synthetic CI eval index scored the weakest on-topic case at 0.250 and the strongest off-topic query at 0.146; 0.30 would have rejected a genuine case. Still to be confirmed on the real index. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C7XhCnabM5SwJLKnmU
gaffercode
marked this pull request as ready for review
November 26, 2026 21:46
…hmark Real index (88 on-topic, 8 off-topic queries): weakest on-topic 0.3725, strongest off-topic 0.2597; 0.40 rejects two on-topic queries. Floor chosen by Gaffer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C7XhCnabM5SwJLKnmU
…oor off Resolves conflicts with the UI flow changes (mismatch prompt, new warning actions) while keeping the no-evidence notice. The synthetic eval (tests/theoracle-eval.test.ts) now retrieves with minSimilarity -1, since the 0.35 floor is calibrated on the real index, and asserts that on-topic cases score above off-topic queries instead of only recording them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012ta9C7XhCnabM5SwJLKnmU
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
Status: REVIEW. Floor value approved by Gaffer (0.35); merge still needs Gaffer's approval.
Problem
retrieveTheOracleGroundingalways sent up to 6 top passages to the model, however low their similarity, so an off-topic case was still "grounded" on unrelated guideline text.Change
THEORACLE_MIN_SIMILARITY = 0.35(cosine) insrc/lib/theoracle-grounding.ts. It applies to case retrieval, the dose-passage swap and targeted therapy retrieval.RetrieveOptions.minSimilarityoverrides it; a non-finite value falls back to the default.THEORACLE_NO_MATCH: the gateway returns 422 and makes no model call.benchmark:oraclegains arelevanceFloorcalibration section and no longer crashes on a no-match.docs/architecture.md,docs/testing.md. The bundle contract is unchanged.Calibration (real index, monorepo benchmark)
Weakest on-topic best passage: 0.3725. Strongest off-topic: 0.2597. The synthetic CI index (#25) scores lower (on-topic min 0.250), so its eval must not assert the production floor.
Acceptance criteria
THEORACLE_NO_MATCH, no therapy search, no inference. ✅ testedVerification
vitest run: 834 passed, 23 skipped (private data). 7 new tests went red to green.tscis clean.eslintshows 0 errors and the same 3 warnings as main.Risks
relevanceFloorbenchmark after every index rebuild, and grow the off-topic set.export-splitoverwrites it.🤖 Generated with Claude Code
https://claude.ai/code/session_012ta9C7XhCnabM5SwJLKnmU