Make the tests that passed for the wrong reasons honest (review, area 1a) - #304
Merged
Merged
Conversation
From the review of src/api and src/handoff (area 1a). Each new or changed
test was checked against the mutation the reviewer used to show the old
one was weak, and fails under it:
- Unknown handoff kind: posted kind 'search', whose 422 came from the
missing answer_id. Now kind 'bogus' with a stored summary and no human
claim; routing unknown kinds to the analysis model now fails it.
- Smuggling analysis fields into a search request: now with a valid
answer_id, asserting no analysis handoff is minted.
- Widening the tier asserted get('anything') is None, which is always
true. Now: nothing was minted.
- The handoff limiter had no test (the fixture allows 10,000). Now three
mints against a limit of two.
- What is kept for Continue in chat: the stub had no anchors, no sources
list and nothing held back, so storing raw text passed. Now with all
three, plus each id leading to its own answer.
- Nothing tested what a handoff seed sends the model; passing the raw
result through, with token, file and sample names, left the suite green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This is the last group from the max-level review of
src/apiandsrc/handoff: tests that passed for reasons other than what they are named for. Each new or changed test was run against the mutation the reviewer used to show the old one was weak, and it fails under that mutation:test_refuses_an_unknown_kindkind: "search", so the 422 came from the missinganswer_idkind: Literal["analysis", "bogus"], which skips the presence checktest_a_search_request_cannot_smuggle_an_analysis_fieldanswer_idanswer_idand asserts noAnalysisHandoffis mintedtest_cannot_widen_the_disclosure_tierget("anything") is Noneis always trueHandoffStore.__len__)test_the_rate_limit_applies(new)test_what_is_kept_is_the_stripped_text…,…held_back…,…each_id_leads_to_its_own_text(new)test_what_the_model_is_sent_names_no_file_and_no_token(new)data = dict(fetched.result)./checks.shpasses.🤖 Generated with Claude Code