feat(groundedness): retrieval-quality scorer#282
Merged
Conversation
Pure scoreGroundedness(resultText, requiredKnowledge[]) -> {score,found,
missing,total,hadResults} plus a span-based extractRetrievedText over the
canonical TraceSchema (RetrievalSpan.hits + provider ToolSpan.result),
the structural sibling of src/authenticity. Provider-tool selection is an
injected matcher (default search/research-not-fetch), not a baked literal;
requiredKnowledge is a bare string[] supplied by the consumer. Subpath-only
export (./groundedness), no root re-export — mirrors authenticity.
tangletools
approved these changes
Jun 24, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — 11677e14
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-24T12:33:15Z
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.
What
Lifts groundedness — retrieval-quality scoring — into the substrate (
./groundednesssubpath).Did the retrieval/search provider actually return the fact the task needed, independent of whether the agent then used it. Isolates provider quality from agent skill (a perfect result + weak model still fails; junk results + strong model recovers — so task pass-rate alone conflates the two).
scoreGroundedness(resultText, requiredKnowledge[])→{ score, found, missing, total, hadResults }.RetrievalSpan.hits[].content+ providerToolSpan.result) — the provider tool matcher is injectable (defaults to search/research-not-fetch).authenticity(pure deterministic scorer + consumer-supplied domain config); subpath-only export, no root re-export.Why
A fundamental retrieval-eval primitive every retrieval-augmented eval needs; the provider's job is to surface the answer, this measures whether it did. Distinct from output-coverage scoring (which scores the agent's produced artifact) — this scores the provider's retrieved text.
Tests / checks
tsc --noEmit --strict0 errors, vitest 10/10, tsup emitsdist/groundedness.