test: per-detector contract tests#19
Merged
Merged
Conversation
Adds tests/detectors/test_detector_contracts.py: a data-driven suite that tests each of the 20 detectors individually against hand-built RunArtifacts (not the SyntheticAgent), so the checks are not circular with the eval fixtures. Each detector must fire with evidence on its own signal and stay silent on a clean artifact. A parity guard fails if a detector is added without a corresponding case, so coverage cannot silently regress. Closes the gap where only 1 of 20 detectors had a dedicated test file. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Importing from nemesis.detectors.base already pulls in the nemesis.detectors package __init__, which registers all 20 detectors — so the explicit `import nemesis.detectors` was redundant. Removing it clears the CodeQL py/unused-import finding. Verified the parity guard still sees all 20. Co-Authored-By: Claude Opus 4.8 <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.
Closes the coverage gap from the review: only 1 of 20 detectors had a dedicated test file; the rest were exercised only in aggregate via the eval loop.
Adds
tests/detectors/test_detector_contracts.py— a data-driven suite that:RunArtifacts (not the SyntheticAgent → not circular with eval fixtures)test_every_detector_has_a_contract_case) that fails CI if a detector is added without a case+41 tests (71 → 112), all green; ruff + black pass.
Design note: one data-driven file rather than 19 near-identical per-file stubs — same per-detector coverage, far more maintainable, and the parity guard enforces completeness.
🤖 Generated with Claude Code