Skip to content

fix: require specific headlines and include replies in recaps - #1437

Merged
paulinevos merged 1 commit into
dev-null-sh:productionfrom
paulinevos:fix/headline-specificity-and-recap-replies
Nov 3, 2026
Merged

paulinevos merged 1 commit into
dev-null-sh:productionfrom
paulinevos:fix/headline-specificity-and-recap-replies

Conversation

@paulinevos

@paulinevos paulinevos commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Hot-topic recaps currently see only root posts, so useful answers in their replies cannot influence either recap eligibility or writing. Headline classification also permits broad labels such as “Laravel”, grouping distinct developments together.

Include public reply context in recaps and require headlines to identify a specific release, feature, event, change, problem, or finding rather than a product/category alone.

Changes

  • Preserve the strongest recent root per author (up to 100 roots) and include up to 100 newest approved, available, nonempty replies across those threads, including nested replies. Group reply bodies chronologically with their root; send no account or record identifiers.
  • Supply identical context to the recap usefulness decision and writer. Replies remain outside headline classification and do not independently affect topic ranking.
  • Recheck reply context before publication and hide recaps when linked threads contain muted or blocked contributors. Already-published reply paraphrases can remain until the existing two-hour expiry after reply deletion, rejection, or account erasure. No added reply-based invalidation; all four deletion/moderation actions remain unchanged from base, preserving existing root-source invalidation.
  • Tighten candidate, writer, matching, and deduplication policies. Existing broad headline names are not valid matches for new specific developments; distinct developments sharing a product stay separate.
  • Extend behavior/privacy regression coverage and update the public knowledge base. No schema or frontend component changes.

Validation

Local checks in an isolated PostgreSQL test database:

  • composer test:lint — passed; 22 warnings in unchanged frontend test files, no lint errors.
  • composer test:types — passed PHPStan and both TypeScript projects.
  • composer test:type-coverage — passed, 100%.
  • bun run test:unit — 223 passed, zero failures.
  • XDEBUG_MODE=coverage php -d memory_limit=-1 vendor/bin/pest --parallel --ci --coverage --exactly=100.0 --passthru-php="'-d' 'memory_limit=-1'" — full rerun passed: 5,492 tests, 29,747 assertions, 100% total coverage.
  • Final targeted deletion/moderation suites — 57 passed, 191 assertions; confirms the root/reply distinction and recap visibility at 7,199 seconds versus expiry at 7,200 seconds after generation. Earlier affected behavior suite: 213 passed; recap job/controller rerun: 36 passed.
  • git diff --check — passed.

The first full run on the final tree had one intermittent failure in the unchanged OrganizationNotificationsTest group-order assertion (notifications.data.0.organization.handle missing), with 5,491 passing tests. That entire file immediately passed on the same revision: 23 tests, 121 assertions. The test and notification creation/grouping code are unchanged from base; no unrelated fix is included.

Live model probes used synthetic text, not production data:

  • Rejected “Laravel”, “I like Laravel”, and a generic database question; accepted a specific reranking release, index-memory finding, Mac beta announcement, and a contextual quote endorsement.
  • Matched the reranking announcement only to its specific headline, not “Laravel” or a distinct passkey feature. Deduplication combined equivalent reranking headlines without merging the passkey feature.
  • Generated “Laravel AI SDK adds reranking support”, “Vector index memory usage doubles”, and “/dev/null Mac app beta opens for testing”.
  • A question alone scored 0 and produced no recap; adding substantive answers scored 1 and produced a concise grounded recap; vague replies still scored 0 with no recap.

Visual and mobile-device verification are not applicable: this changes backend source selection, privacy/invalidation, and model instructions, not layout, components, styles, or device interactions. No inspection media is included in this text-only PR. Hosted CI is separate from these local results.

Independent review

Independent read-only review: PASS, no unresolved correctness, regression, architecture, test, or privacy blockers.

  • Reviewed base: 246607a03c54ec62d5bb331c55ca07254f579fa1
  • Reviewed head: 3a1e588968b7503fc2a95b4388b0c5429116da92
  • Reviewed all 14 changed files, including the accepted two-hour stale-paraphrase contract; independently checked the diff for whitespace errors and confirmed the folded tree matches the reviewed follow-up. Inspected lint/type logs. Test runs and live-model probes are implementer-supplied evidence, not independently repeated.
  • Visual/device review: not applicable for the backend/prompt-only changes described above.

Limitations

  • Existing production headlines and links are not reclassified or deleted by this change. No production writes or backfill were performed.
  • The original report about current production recaps remains unverified: production topic inputs, generation history, and stored recap state were unavailable. Synthetic model probes do not establish the cause for those topics.
  • Model decisions remain probabilistic. Production-scale query performance and physical-device behavior were not measured.

Update to the generated summary below: the earlier reply-removal refresh claim is superseded. Published reply paraphrases are deliberately allowed to survive until the existing two-hour expiry; no reply-based invalidation is added.

Summary by CodeRabbit

  • New Features
    • Hot-topic recaps can now use relevant public replies, including nested replies, to provide additional context.
    • Headlines focus on specific developments, issues, or findings rather than broad product or topic labels.
  • Bug Fixes
    • Recaps are hidden when their linked posts or replies are not visible due to muting or blocking.
    • Removing a reply no longer immediately clears its root post’s recap; recaps may remain available for up to two hours. Removing the root post still clears the recap.

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

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Walkthrough

Headline guidance now focuses on specific developments rather than broad subjects. Recap generation includes eligible public replies as context, and recap visibility checks cover hidden reply authors. Tests and documentation describe reply-related recap retention and expiration.

Changes: Specific-development headlines

Layer / File(s) Summary
Classify and group specific developments
KNOWLEDGE_BASE.md, app/Ai/Agents/CommitHeadlineWriter.php, app/Services/HeadlineProviders/OpenAIHeadlineProvider.php
Headline guidance requires concrete developments and distinguishes unrelated releases or issues, including those involving the same product.

Reply-aware hot-topic recaps

Layer / File(s) Summary
Build and use reply context
app/Contracts/Services/HeadlineProvider.php, app/Queries/HeadlineSummaryCommitsQuery.php, app/Services/HeadlineProviders/OpenAIHeadlineProvider.php, app/Ai/Agents/HeadlineSummaryWriter.php, tests/Unit/Jobs/GenerateHeadlineSummaryTest.php
The query groups eligible reply text with root posts. Provider and writer instructions use substantive replies as context. Tests cover eligibility, the reply limit, and changes during generation.
Filter and retain reply-linked recaps
app/Queries/HeadlineSummaryQuery.php, tests/Feature/Controllers/HeadlineControllerTest.php, tests/Unit/Middleware/HandleInertiaRequestsTest.php, tests/Unit/Actions/*, tests/Unit/Actions/DeleteUserTest.php, KNOWLEDGE_BASE.md
The recap query checks visibility for linked roots and approved replies. Tests cover muted or blocked authors and recap expectations after root or reply removal or rejection. Documentation describes recap retention and expiration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant GenerateHeadlineSummary
  participant HeadlineSummaryCommitsQuery
  participant OpenAIHeadlineProvider
  GenerateHeadlineSummary->>HeadlineSummaryCommitsQuery: Select public roots and eligible replies
  HeadlineSummaryCommitsQuery->>GenerateHeadlineSummary: Return grouped post and reply text
  GenerateHeadlineSummary->>OpenAIHeadlineProvider: Check and summarize recap context
Loading

Possibly related PRs

Suggested reviewers: nunomaduro, xheaven

Merge Risk: Minimal · up to 3a1e5

The change makes headlines more specific and adds public replies to recap context. It also hides recaps when a linked thread contains muted or blocked contributors. A recap may keep summarizing a removed reply for up to two hours, which is documented and intended. No merge-blocking issue was identified.

Architecture risk: Low · up to 3a1e5

The change affects 3 systems.

Changed systems: tests, app, KNOWLEDGE_BASE.md

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — tests (service) was modified; 7 changed files map to changed impact.
  • observed — app (service) was modified; 6 changed files map to changed impact.
  • observed — KNOWLEDGE_BASE.md (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in app/Ai/Agents/CommitHeadlineWriter.php: The instructions now target specific developments, issues, or findings rather than a post’s main subject. They require retaining supplied product names and distinguishing versions or features; posts about the same development should share a headline, while unrelated releases or issues involving the same product should not. Broad topic or product-only headlines and invented news hooks, events, versions, or features are explicitly disallowed. The example headlines were updated.
  • observed — Modified behavior in app/Ai/Agents/HeadlineSummaryWriter.php: Adds instructions to read posts and nested replies together, use substantive replies as source material, and ignore tangents unrelated to the headline.
  • observed — Modified behavior in app/Ai/Agents/HeadlineSummaryWriter.php: Replaces the statement that a selected post represents one author with a warning that a thread may contain multiple authors and repeated replies may not be independent; it also adds consensus to the inferences the model must not draw.
  • observed — Modified behavior in app/Contracts/Services/HeadlineProvider.php: The summarize documentation adds reply context as an input to a grounded recap and describes bodies containing post-and-reply JSON without account or commit identifiers.
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 specific headlines and include replies in recaps" matches the main changes in the changeset. The raw summary shows changes to headline writing and matching rules that require s…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. 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 specific headlines and include replies in recaps" matches the main changes in the changeset. The raw summary shows changes to headline writing and matching rules that require specific developments rather than broad subjects, and changes to recap queries and generation that include public reply context. The title names both primary changes. It does not cover every detail, such as recap invalidation and muted or blocked author handling, which is acceptable for a short title.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. 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 4 functions across 13 files. (1 skipped: 1 unsupported.)

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
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: e41adbfa-1356-4e30-add5-9e45541048dd
Commits

Reviewing files that changed from the base of the PR and between cd3e732 and 3a1e588.

Files selected for processing: 5
  • KNOWLEDGE_BASE.md
  • tests/Unit/Actions/DeleteCommitContentTest.php
  • tests/Unit/Actions/DeleteCommitTest.php
  • tests/Unit/Actions/DeleteUserTest.php
  • tests/Unit/Actions/UpdateCommitStatusesTest.php

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

@paulinevos

paulinevos commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

All this "clear a deleted user's content from the recap" logic feels overly complex when recaps are refreshed every 2 hours anyway...

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 block approval of the headline and reply-aware recap changes.

No open issues 🎉

What changed in this PR

This PR makes hot-topic headlines identify specific developments and lets public replies contribute to recaps, while extending existing privacy and invalidation safeguards.

Changes:

  • Tighten headline eligibility, generation, matching, and deduplication to keep distinct developments separate.
  • Include bounded, chronological reply context in both recap eligibility checks and writing.
  • Extend recap invalidation, muted/blocked contributor filtering, regression tests, and public documentation.
File Description
tests/​Unit/​Middleware/​HandleInertiaRequestsTest.php Covers hidden reply authors in sidebar recaps.
tests/​Unit/​Jobs/​GenerateHeadlineSummaryTest.php Tests reply context, sampling limits, and publication rechecks.
tests/​Unit/​Actions/​UpdateCommitStatusesTest.php Covers recap invalidation when replies are rejected.
tests/​Unit/​Actions/​DeleteUserTest.php Covers recap invalidation after reply-author deletion.
tests/​Unit/​Actions/​DeleteCommitTest.php Tests thread recap clearing when replies are deleted.
tests/​Unit/​Actions/​DeleteCommitContentTest.php Tests recap clearing during reply content erasure.
tests/​Feature/​Controllers/​HeadlineControllerTest.php Covers muted and blocked reply authors on headline pages.
KNOWLEDGE_BASE.md Documents specific headlines and reply-aware recaps.
app/​Services/​HeadlineProviders/​OpenAIHeadlineProvider.php Tightens headline decisions and incorporates replies into recap eligibility.
app/​Queries/​HeadlineSummaryQuery.php Hides recaps involving muted or blocked reply authors.
app/​Queries/​HeadlineSummaryCommitsQuery.php Adds up to 100 newest replies across selected root threads.
app/​Contracts/​Services/​HeadlineProvider.php Documents reply context in summary inputs.
app/​Ai/​Agents/​HeadlineSummaryWriter.php Instructs the writer to use substantive replies without inferring consensus.
app/​Ai/​Agents/​CommitHeadlineWriter.php Requires headlines to distinguish specific developments.
app/​Actions/​UpdateCommitStatuses.php Clears thread recaps when replies are rejected.
app/​Actions/​DeleteUser.php Clears recaps linked through an erased user's replies.
app/​Actions/​DeleteCommitContent.php Clears thread recaps during content erasure.
app/​Actions/​DeleteCommit.php Clears thread recaps when a reply is deleted.

Review effort: Balanced

@paulinevos
paulinevos force-pushed the fix/headline-specificity-and-recap-replies branch from cd3e732 to 3a1e588 Compare November 3, 2026 12:50
@paulinevos
paulinevos merged commit 385c8ae into dev-null-sh:production Nov 3, 2026
12 of 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