Skip to content

fix: require author breadth or engagement for hot topics - #1519

Merged
paulinevos merged 2 commits into
dev-null-sh:productionfrom
paulinevos:fix/hot-topic-eligibility
Nov 8, 2026
Merged

paulinevos merged 2 commits into
dev-null-sh:productionfrom
paulinevos:fix/hot-topic-eligibility

Conversation

@paulinevos

@paulinevos paulinevos commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hot topics could qualify from two posts by the same author, while an engaging discussion with only one root post could not qualify. Require either multiple root authors or a sufficiently trending individual thread, and extend the discovery window from eight to twelve hours.

Changes

  • Require more than one root author, or one root meeting the age-discounted trend weight of two fresh outside repliers.
  • Reuse existing trend weights, including the bonus when the root author answers an outside participant. Self-only activity adds no weight; repeated roots cannot combine scores to reach the cutoff.
  • Preserve one strongest contribution per author, deterministic ranking, visibility, mutes and blocks.
  • Use the same twelve-hour window for recap sources.
  • Update the public knowledge base and add regression coverage for author breadth, distinct participants, the conversation bonus, score cutoffs and time boundaries.
  • In a separate test-only commit, set deterministic display names in the API and web organization mention fixtures. The unchanged tests left names random even though mention search matches both handles and names; setting Jess to "Jess Taylor" reproduced the original CI failure. No production mention behavior changed.

Validation

All checks passed locally on the final tree:

  • vendor/bin/pint --dirty --format agent — passed.
  • vendor/bin/pest tests/Unit/Queries/HotHeadlinesQueryTest.php --compact — 16 tests, 31 assertions passed.
  • vendor/bin/pest tests/Feature/Controllers/Api/MentionSuggestionControllerTest.php tests/Feature/Controllers/MentionSuggestionControllerTest.php --compact — 49 tests, 134 assertions passed.
  • composer test:lint — passed; warnings remain in unchanged frontend files.
  • composer test:types — passed.
  • composer test:type-coverage — passed, 100%.
  • bun run test:unit — 308 Node tests passed, including the nested Vitest suite.
  • php -d memory_limit=-1 vendor/bin/pest --parallel --ci --coverage --exactly=100.0 --passthru-php="'-d' 'memory_limit=-1'" — 5,879 tests, 31,665 assertions passed; 100% coverage.
  • git diff --check — passed.

Visual and device verification are inapplicable: no component styles, layout or interactions changed. This PR uses the text-only template; no inspection captures are included. Hosted CI is separate from these local results.

Independent review

Independent read-only reviewer: PASS for correctness, regressions, architecture and meaningful tests, with no unresolved findings.

  • Reviewed base: af8dc37a15b73ac59bcd74b1435e53dfabd55dca
  • Reviewed head: 67a61acf078865e5fbad8e696d80076f52b33d48
  • Full scope: the seven files in this PR, including the separate deterministic-fixture commit. The cumulative diff received a fresh independent PASS.
  • An initial documentation finding was corrected to explicitly retain the existing answered-replier bonus, with a regression test covering eligibility before and after the author answers.
  • Reviewer inspected the diff and scoring paths but did not independently rerun the full suite. The implementer completed the mandatory verification above before publication.
  • Visual review: not applicable to this backend-only change.

Limitations

The cutoff has not yet been calibrated against labeled production examples. Production-scale query performance and real-world relevance remain unverified. No production data was accessed or modified; ground-truth sampling is deferred until read-only access is available.

Summary by CodeRabbit

  • New Features
    • Hot topics and recap summaries now include activity from the past 12 hours, up from 8 hours.
    • Topics can qualify through contributions from multiple visible authors or a single sufficiently trending discussion. Trending considers replies, author participation, and thread age, with higher engagement thresholds for older discussions. Repeated activity by one author alone does not qualify.

Copilot AI balanced review requested due to automatic review settings November 8, 2026 12:08
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Hot topics now use a 12-hour window and can qualify through multiple visible authors or a sufficiently trending single contribution. Headline summary inputs use the same window. Documentation and tests reflect these rules. Mention suggestion test fixtures now set member names as well as handles.

Changes: Hot topic selection and summaries

Layer / File(s) Summary
Hot headline eligibility and window
app/Queries/HotHeadlinesQuery.php, tests/Unit/Queries/HotHeadlinesQueryTest.php, KNOWLEDGE_BASE.md
The query uses a 12-hour window and allows eligibility through multiple author contributions or one contribution meeting a trend-score threshold. Tests cover repeated roots, self-replies, outside repliers, age-dependent thresholds, window boundaries, and aggregation. The Hot topics documentation describes these rules.
Headline summary window alignment
app/Queries/HeadlineSummaryCommitsQuery.php, tests/Unit/Jobs/GenerateHeadlineSummaryTest.php, KNOWLEDGE_BASE.md
The summary query uses HotHeadlinesQuery::WINDOW_HOURS. Tests update the window and cutoff fixtures, and the recap documentation changes its source window to 12 hours.

Mention suggestion test fixtures

Layer / File(s) Summary
Organization member profile fixtures
tests/Feature/Controllers/Api/MentionSuggestionControllerTest.php, tests/Feature/Controllers/MentionSuggestionControllerTest.php
The organization-member suggestion tests now set both a handle and a name for each member.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Suggested reviewers: xheaven, mnapoli

Merge Risk: Minimal · up to 67a61

Hot-topic discovery and recap sources move to a twelve-hour window. No merge-blocking risk was established.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix: require author breadth or engagement for hot topics" matches the main change. The changeset makes a hot topic qualify through multiple visible authors' top-level commits or one suffici…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: require author breadth or engagement for hot topics" matches the main change. The changeset makes a hot topic qualify through multiple visible authors' top-level commits or one sufficiently trending thread, replacing the earlier two-commit requirement. The title names the main behavior change (eligibility for hot topics) and the type of change (fix). It does not mention the window change from eight to twelve hours, which is a secondary change and does not need to appear in the title.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 6 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: be28dabb-17c2-4abd-9515-d0115bd9ee56
Commits

Reviewing files that changed from the base of the PR and between 8e9232d and 67a61ac.

Files selected for processing: 2

  • tests/Feature/Controllers/Api/MentionSuggestionControllerTest.php
  • tests/Feature/Controllers/MentionSuggestionControllerTest.php

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified for the Hot topics eligibility and source-window changes.

No open issues 🎉

What changed in this PR

This PR updates Hot topics eligibility so repeated posts by one author cannot qualify a topic alone, while a sufficiently engaging single thread can qualify.

Changes:

  • Require multiple root authors or one thread meeting the existing age-discounted engagement threshold.
  • Extend discovery and recap source windows from eight to twelve hours.
  • Update public documentation and regression coverage for engagement, author breadth, scoring thresholds, and time boundaries.
File Description
tests/​Unit/​Queries/​HotHeadlinesQueryTest.php Covers revised eligibility, engagement thresholds, and twelve-hour boundaries.
tests/​Unit/​Jobs/​GenerateHeadlineSummaryTest.php Updates recap time boundaries and engagement fixtures.
KNOWLEDGE_BASE.md Documents qualification rules and extended source windows.
app/​Queries/​HotHeadlinesQuery.php Implements author-breadth or single-thread eligibility and the shared window constant.
app/​Queries/​HeadlineSummaryCommitsQuery.php Uses the shared twelve-hour window for recap sources.

Review effort: Balanced

@paulinevos
paulinevos merged commit 1a77f39 into dev-null-sh:production Nov 8, 2026
13 checks passed
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.

2 participants