← Back to Pull requests

fix: strip email domains from FTS search input #140

Open
c1-dev-bot[bot] opened this pull request with 176 lines diff across 2 files
View on GitHub
c1-dev-bot[bot] c1-dev-bot[bot] commented on Apr 22, 2026 00:08 UTC
Author

Summary

  • When users search the Task Log by full email address (e.g. dluu@zscaler.com), FullTextSearchQuery produces tokens like dluu and zscalercom (domain with dot stripped). Since the FTS index only contains display name tokens, the domain token never matches, causing 0 results.

  • Adds stripEmailDomains() preprocessing that detects email-format tokens in the search input and extracts only the local-part before @, so dluu@zscaler.com becomes dluu before tokenization.

  • Includes unit tests for stripEmailDomains and an integration test (TestSearchEmailAddress) verifying email search matches against display name vectors.
  • Fixes: IGA-1508

    Test plan

  • TestStripEmailDomains — verifies email domain stripping for various inputs (single email, multiple emails, non-email text, edge cases like @orphan, empty strings)

  • TestSearchEmailAddress — integration test against Postgres confirming that dluu@zscaler.com matches a vector containing dluu while notauser@example.com does not

  • Existing FTS tests pass unchanged (no regression in symbol, dot, camel, snake, path, prefix matching)
  • ---

    Automated PR Notice

    This PR was automatically created by c1-dev-bot as a potential implementation.

    This code requires:

  • Human review of the implementation approach

  • Manual testing to verify correctness

  • Approval from the appropriate team before merging
  • Diff: 176 lines (+132 / -44) across 2 files Reviewer: None requested Review duration: 328723m
    All Vouch review confidence checks passed
    Residual risk 0.34 = Change Risk (0.54) × (1 − Review Confidence (0.38)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.54 · 176 lines diff across 2 files
    0.54
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 10%
    38%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.310
    No Reviewer Assigned no_reviewer_assigned
    0.120
    Real PR Conversation Timeline
    1 comments
    "Review active on #140"
    general weight: 0.35
    Reviewers
    None requested
    Assignees
    c1-dev-bot[bot] c1-dev-bot[bot]
    Labels
    risk: low confidence: 38.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.4% (MEDIUM) · Higher = larger blast radius
    54.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 38.5% · Lower = rushed or shallow review
    38.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 33.5% · Safe to merge
    33.5%