Skip to content

Add required phrases and minimum coverage to osl-3.0 rules - #5452

Open
Adnan9-63 wants to merge 1 commit into
aboutcode-org:developfrom
Adnan9-63:fix/5347-osl-3.0-false-positive
Open

Adnan9-63 wants to merge 1 commit into
aboutcode-org:developfrom
Adnan9-63:fix/5347-osl-3.0-false-positive

Conversation

@Adnan9-63

Copy link
Copy Markdown

What this PR does / why we need it:

Fixes false-positive osl-3.0 detections where generic preamble phrases like "licensed under the" or "the full text of the license" triggered osl-3.0_54.RULE and osl-3.0_26.RULE during approximate sequence matching (3-seq).

Problem:

Both rules lacked required phrases ({{...}}) and explicit minimum_coverage. Because osl-3.0_54.RULE has 17 tokens, ScanCode's dynamic length threshold (models.py:2654-2658) computed a default minimum coverage of 50%. When scanning texts containing generic phrasing like KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT), the 9 overlapping preamble/URL tokens yielded ~52.94% coverage, causing 3-seq to falsely report osl-3.0 alongside mit.

Solution:

  1. Marked {{Open Software License version 3.0}} as a required phrase in both osl-3.0_54.RULE and osl-3.0_26.RULE.
  2. Added minimum_coverage: 80 to the YAML frontmatter of both rules to prevent partial fragment matching.

Fixes #5347

Checklist:

  • Tested with pytest tests/licensedcode/test_required_phrases.py and pytest tests/licensedcode/test_license_models.py -k 'key_phrases or spdxrule'
  • Verified that true-positive OSL-3.0 notices match at 100% confidence while KaTeX and AWS boilerplate fragments are rejected
  • Commit is signed off (git commit -s)

Signed-off-by: Adnan9-63 muhammad1414114@gmail.com

osl-3.0_54.RULE and osl-3.0_26.RULE lacked required phrases and explicit
minimum coverage. Due to the default 50% coverage threshold for medium
rules, a partial sequence match on generic boilerplate (e.g. 'licensed under the'
or 'the full text of the license') triggered false-positive OSL-3.0
detections on other licenses such as MIT.

Mark 'Open Software License version 3.0' as a required phrase and set
minimum_coverage: 80 on both rules.

Fixes aboutcode-org#5347

Signed-off-by: Adnan9-63 <muhammad1414114@gmail.com>
Copilot AI balanced review requested due to automatic review settings November 8, 2026 08:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Two active findings remain requesting rule-specific regression fixtures that verify both rejection of the reported boilerplate and acceptance of the intended notices.

2 open issues

Review effort: Lite

license_expression: osl-3.0
is_license_notice: yes
relevance: 100
minimum_coverage: 80
license_expression: osl-3.0
is_license_tag: yes
relevance: 100
minimum_coverage: 80

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[QUESTION] Bug or feature - "licensed under the" triggers OSL-3.0 rule

2 participants