Signal approximate totals for age-only trial count searches#217
Merged
Signal approximate totals for age-only trial count searches#217
Conversation
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.
Summary
--count-onlytrial searches now signal that the returned total is approximate, since BioMCP's age post-filter runs during full search rather than the fast count path(approximate, age post-filtered)to the total; JSON output adds"approximate": true--agehelp text notes the approximation behavior for CTGov-only fast-count pathsCOUNT_TRAVERSAL_PAGE_CAPis hoisted to the module-level constant block alongside other traversal constantsDetails
When a user runs
biomcp search trial --age N --count-only, BioMCP previously returned CTGov's upstream total without indicating that the actual result set may be smaller after client-side age filtering. This change makes that approximation explicit.A new
TrialCountenum (Exact,Approximate,Unknown) annotates the return type ofcount_all_with_ctgov_clientandcount_all. TheApproximatevariant fires only on the CTGov age-only fast path. All other count paths continue returningExactorUnknownas before, with no change to their output.Test plan
make buildpassesmake testpasses (632 tests)make checkpasses (clippy + fmt)make specpasses (113 passed, 5 skipped)--count-onlytext output shows(approximate, age post-filtered)qualifier--count-onlyJSON output includes"approximate": true--count-onlyoutput is unchanged (no qualifier, noapproximatefield)