Surface the score-direction assumption in dock_diverse - #111
Merged
Conversation
Every docking entry point reports when it had to guess a score field's direction (lower-is-better, the docking convention) except dock_diverse, which took only the boolean from higher_is_better() and dropped the "assumed" flag. A user diversifying hits on an unrecognised score field got a shortlist silently ranked by a guessed direction while dock_summary/dock_rank/dock_report all warned. Bring it in line: - DiverseResult gains direction_assumed; select_diverse_hits records it (default False, backward-compatible). - The CLI prints a "(... assumed; pass --higher/--lower-is-better)" note matching dock_summary's wording. - The MCP payload adds direction and direction_assumed, matching dock_summary's keys.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Continues the docking review. Every docking entry point reports when it had to guess a score field's direction (lower-is-better, the docking convention) — except
dock_diverse, which took only the boolean fromhigher_is_better()and dropped theassumedflag (cli.py and mcp_server.py both didhigher_is_better(field)[0]). A user diversifying hits on an unrecognised score field got a shortlist silently ranked by a guessed direction, whiledock_summary/dock_rank/dock_reportall warned.Changes
docking.py—DiverseResultgains adirection_assumedfield;select_diverse_hitsaccepts and records it. DefaultFalse, fully backward-compatible._run_dock_diversecaptures(higher, assumed)and prints a(lower-is-better, assumed; pass --higher/--lower-is-better)note, matchingdock_summary's wording.dock_diversepayload now includesdirectionanddirection_assumed, matchingdock_summary's keys exactly.Scope note
I deliberately did not make docking refuse to run on an unknown field (one option raised in review). The assumption-with-notice pattern is already the established design across the other dock tools;
dock_diversewas simply the one place that skipped the notice. This change makes it consistent rather than changing the contract.Tests
4 new/extended tests: core threading of the flag, the CLI warning on an unrecognised field, and the MCP payload keys. Full suite: 866 passed, 21 skipped.
ruff checkclean.