test(discovery): prove the scorer responds to known faults - #65
Closed
pengyuzhang wants to merge 1 commit into
Closed
test(discovery): prove the scorer responds to known faults#65pengyuzhang wants to merge 1 commit into
pengyuzhang wants to merge 1 commit into
Conversation
The unit tests check that each piece behaves. This checks the instrument as a whole, the way you would check any instrument: feed it a known input, change one known thing, and see whether the reading moves by the amount it should. It builds a defect-free control run, confirms the control scores 1.0/1.0 with the gate passing, then injects one real failure mode at a time - a missed declaration site, one tool reported twice, an invention, a lookalike believed, a wrong version, a wrong scope, a mutable tag read as pinned, a leaked credential, silence about an unknown tool, an unexplained error, and recall below the last accepted run. Both halves matter equally. A scorer that misses a planted duplicate is broken; so is one that reports defects nobody planted, because every false alarm costs somebody the afternoon it takes to prove the collector was fine. Each case asserts the whole delta rather than only the number it was looking for.
lghupan
approved these changes
Aug 23, 2026
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.
Stacked on #64.
The unit tests check that each piece behaves. This checks the instrument as a whole, the way you would check any instrument: feed it a known input, change one known thing, and see whether the reading moves by the amount it should.
Both halves matter
The control line is the half that is easy to forget. A scorer that misses a planted duplicate is broken; so is one that reports defects nobody planted, because every false alarm costs somebody the afternoon it takes to prove the collector was fine. So each case asserts the whole delta, not just the number it was looking for — the
totals that movedcolumn is part of the check.The
nonerows are worth reading: a wrong version on a tool that was found is a field failure, not a miss, and the scorer keeps those separate.Faults are real failure modes
Not arbitrary mutations. Each is something a collector has done or plausibly could: a missed declaration site, usr-merge double-counting, a lookalike believed,
:latestread as pinned.Runs for each OS:
--os mac,--os win.--jsonfor machine-readable output. Exit code is non-zero if any fault goes undetected, so it can gate.Verification
Passes 11/11 on all three platforms.