← Back to Pull requests

[6.2] [AI] Fix Smart Search category access indexing #48136

Open
unknown opened this pull request with 348 lines diff across 4 files
View on GitHub
unknown unknown commented on Jul 22, 2026 17:44 UTC
Author

Pull Request resolves #47839.

  • I read the Generative AI policy and my contribution is compatible with the policy and GNU/GPL 2 or later.
  • Summary of Changes

    Joomla access-level IDs are identifiers, not an ordering of restrictiveness. Smart Search therefore cannot combine an item's access level with its category access level by choosing the larger ID.

    This change stores the item and category access levels independently in #__finder_links and requires the current user to be authorized for both when loading search results or suggestions. It also:

  • keeps normal indexing, debug indexing, and incremental item/category access updates aligned;

  • defaults category-less content to the Public access level;

  • adds the new column and supporting indexes to MySQL and PostgreSQL install/update schemas; and

  • adds unit coverage proving that category access is preserved whether its ID is numerically higher or lower than the item access ID.
  • The PR targets 6.2-dev because the separate cat_access schema is a feature-level database change. Existing Smart Search data must be cleared and reindexed after applying the database update so that cat_access is populated from each source item.

    Testing Instructions

    Automated checks run locally against 6.2-dev:

  • Focused category-access unit tests: 4 tests, 8 assertions, passed.

  • Full unit suite: 1,131 tests, 1,638 assertions, passed with one existing skip.

  • PHPStan on all changed PHP files: no errors.

  • Repository PHP CS Fixer dry run: no changes required.

  • PHP syntax, whitespace, and Git diff checks: passed.
  • Manual reproduction:

    1. Apply the database update.
    2. Clear the existing Smart Search index.
    3. Create a category with access set to Registered.
    4. Create a published article in that category with access set to Public.
    5. Run the Smart Search indexer.
    6. As a guest, search for the article title.
    7. As a registered user, repeat the search.

    Actual result BEFORE applying this Pull Request

    The guest search shows the article even though opening it is denied. The indexed row keeps only the article access level and discards the category access level.

    Expected result AFTER applying this Pull Request

    The article is excluded from guest search results and remains available to users authorized for both the article and its category. Custom access-level IDs work the same way regardless of their numeric order.

    Link to documentations


    Please select:
  • Documentation link for guide.joomla.org: <link>

  • No documentation changes for guide.joomla.org needed
  • Pull Request link for manual.joomla.org: <link>

  • No documentation changes for manual.joomla.org needed
  • Diff: 348 lines (+261 / -87) across 4 files Reviewer: carrerasdarren-cell Review duration: 149020m
    All Vouch review confidence checks passed
    Residual risk 0.27 = Change Risk (0.49) × (1 − Review Confidence (0.45)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.49 · 348 lines diff across 4 files
    0.49
    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: 35%
    44%
    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
    Diff Size diff_size
    0.350
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #48136"
    general weight: 0.35
    Assignees
    Unassigned
    Labels
    risk: low confidence: 44.7% 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: 49.4% (MEDIUM) · Higher = larger blast radius
    49.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: 44.7% · Lower = rushed or shallow review
    44.7%
    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: 27.3% · Safe to merge
    27.3%