test(scoring): fix stale empty-tags reachability expectations (main is red)#123
Open
Amr-Saad wants to merge 1 commit into
Open
test(scoring): fix stale empty-tags reachability expectations (main is red)#123Amr-Saad wants to merge 1 commit into
Amr-Saad wants to merge 1 commit into
Conversation
Two assertions in test_scoring.py still encode the old reachability default (requires_auth, x0.5) for findings with no reachability tags. scoring.py was intentionally changed so an empty tag set defaults to externally_reachable (x1.0) - documented in _reachability_multiplier: the old x0.5 default 'severely penalised every finding ... causing critical CWEs to score 2.5/10'. The file's other tests already use explicit reachability tags consistent with the new model; only these two lagged, leaving main red. - defaults_reachability_when_missing: 1.05 -> 2.1 (LOW 3.0 x SANITIZATION_BYPASSABLE 0.7 x externally_reachable 1.0) - reachability_multipliers_and_default_behavior[set()]: 2.5 -> 5.0 (MEDIUM 5.0 x FULL_EXPLOIT 1.0 x externally_reachable 1.0) Full suite now green (105 passed); ruff clean on the file. Tests-only change; no production code touched. 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.
Two assertions in
tests/test_scoring.pystill encode the old reachability default (requires_auth, ×0.5) for findings with no reachability tags, somainis currently red on them.src/sec_af/scoring.pywas intentionally changed so an empty tag set defaults toexternally_reachable(×1.0) — documented inline in_reachability_multiplier:The file’s other tests already use explicit reachability tags consistent with the new model; only these two lagged.
Changes (tests only)
…defaults_reachability_when_missing1.052.1…multipliers_and_default_behavior[set()]2.55.0Added inline comments so the empty-vs-non-empty default (
{custom_tag}still falls back torequires_auth×0.5) is explicit.Verification
pip install -e .[dev]+pytest.ruff check tests/test_scoring.py: clean.🤖 Generated with Claude Code