Skip to content

fix(insights): scope async targeted rebuilds - #3701

Merged
Sinity merged 3 commits into
masterfrom
feature/storage/lyv4-scope-async-targeted-insight-rebuild
Aug 4, 2026
Merged

Sinity merged 3 commits into
masterfrom
feature/storage/lyv4-scope-async-targeted-insight-rebuild

Conversation

@Sinity

@Sinity Sinity commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

Keep asynchronous targeted session-insight rebuilds scoped to the requested sessions' affected thread roots and provider-day aggregates.

Problem

rebuild_session_insights_async(..., session_ids=[...]) still entered the full-rebuild aggregate path. It deleted and rebuilt every thread and tag rollup even when the caller requested one session, and its final aggregate work was not committed consistently with the synchronous path. Ref polylogue-lyv4.

Solution

Capture old and refreshed profile groups for the target subset, track degraded sessions, rebuild only affected non-degraded thread roots, refresh only the union of affected provider-day groups, and commit the targeted aggregate phase when chunk commits are enabled. Full rebuild behavior remains on its existing archive-wide path.

Verification

  • devtools test tests/unit/storage/test_session_insight_refresh.py -k 'targeted_session_insight_rebuild_async or async_large_session_rebuild_uses_bounded_degraded_profile': 2 passed, 31 deselected.
  • devtools verify --quick: exit 0, 22 checks passed.
  • A broader selector also passed the synchronous untouched-root parity test. The existing test_targeted_session_insight_rebuild_moves_tag_rollup_between_days failed with current-master bucket semantics (2026-04-03 actual versus 2026-04-01 expected); this branch does not alter that synchronous path.

Sinity added 2 commits August 4, 2026 02:32
Keep async session-insight refreshes bounded to affected thread roots and provider-day aggregates. Preserve untouched rollups and threads while committing completed chunked work consistently with the synchronous path.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

@Sinity, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 10 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f78ab737-991a-463b-b1ae-07ed84b288e2

📥 Commits

Reviewing files that changed from the base of the PR and between f2bad6e and e638f86.

📒 Files selected for processing (2)
  • polylogue/storage/insights/session/rebuild.py
  • tests/unit/storage/test_session_insight_refresh.py

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

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit 04917c9 into master Aug 4, 2026
2 of 3 checks passed
@Sinity
Sinity deleted the feature/storage/lyv4-scope-async-targeted-insight-rebuild branch August 4, 2026 01:02
Sinity added a commit that referenced this pull request Aug 4, 2026
Summary\nRecord the two recovered bootstrap lanes as closed in Beads
after their code PRs landed.\n\nProblem\nThe durable task records
remained open after PR #3699 and PR #3701 merged.\n\nSolution\nClose
polylogue-eizc with the v63 threads_fts removal evidence and
polylogue-lyv4 with the async targeted rebuild
evidence.\n\nVerification\nThe Beads pre-push hook validated the JSONL
and dependency graph with zero unhandled findings.
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.

1 participant