Skip to content

Bias detector patterns are too narrow to match common phrasings #151

Description

@ascherj

The regex patterns in bias_detector.py require near-exact phrase sequences (e.g. “bootcamp graduates lack rigor”) and miss natural phrasings of the same bias, such as “The candidate only attended a bootcamp, so this project lacks the rigor of a formal CS education” or age-based assumptions like “Given their age, they likely cannot keep up with modern frameworks”. Nine unit tests specifying the intended coverage fail.

Steps to reproduce:

from safety.bias_detector import BiasDetector
print(BiasDetector.detect_bias('The candidate only attended a bootcamp, so this project lacks the rigor of a formal CS education'))
# observed: (False, '')  (expected: flagged as dismissive educational-background language)

Related failing tests: 9 tests in tests/unit/test_bias_detector.py (e.g. test_dismissive_bootcamp_language_detected, test_demographic_assumption_age_detected).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsafetySafety layertier-1Starter: good for first-time contributors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions