Repository navigation
test(insights): guard message-budget rebuild chunks - #2538
Merged
Merged
Conversation
Problem: the bounded-WAL insight rebuild had coverage for per-chunk commits, but the sync full-rebuild regression forced chunks with page_size=1. That still left room to regress back to fixed-count chunking and miss the production failure shape where a small session count can represent a huge message window. What changed: add a sync full-rebuild regression that keeps page_size larger than the fixture, patches the message budget small, and asserts multiple committed windows with intermediate session_profiles visible from a second connection. Document insights as an automatic daemon convergence invariant alongside FTS and embeddings, including why the rebuild stays outside ingest transactions. Also fix the adjacent backfill-day fixture so it exercises a newly acquired older transcript instead of a stale replace the archive writer correctly rejects. Verification: devtools test tests/unit/storage/test_session_insight_refresh.py tests/unit/daemon/test_convergence_stages.py; devtools render all --check; devtools verify --quick (run 20260704T215833Z-quick-1935811-feb86f4f).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR documents session insights as a daemon convergence evidence category in AGENTS.md and docs/internals.md, adds a regression test for chunked full rebuild behavior and updates fixture comments in test_session_insight_refresh.py, and records closure of two beads issues. ChangesSession insight convergence documentation and tests
Estimated code review effort: 2 (Simple) | ~10 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the missing sync full-rebuild regression for bounded-WAL session insight rebuilds: the test keeps
page_sizelarger than the fixture and forces chunking only through the message-budget planner, then proves intermediate committedsession_profilesare visible from a second connection. It also documents session insights as an automatic daemon convergence invariant alongside FTS and embeddings.Problem
rebuild_session_insights_syncalready commits per chunk, but existing coverage could still pass if the full rebuild regressed to fixed-count chunking. That misses the original production failure shape: a small number of giant sessions can still create a huge WAL/write-lock window. Separately, the internals docs did not clearly state that insights are an automatic derived-model convergence invariant rather than operator maintenance.Solution
test_full_rebuild_chunks_by_message_budget_before_page_sizeintests/unit/storage/test_session_insight_refresh.py.docs/internals.mdand regeneratedAGENTS.mdto describe insights as a daemon-enforced FTS/embed peer, including why rebuilds remain outside ingest transactions: WAL/lock isolation, hot-source batching, and materializer-version rebuildability.polylogue-1xc.1andpolylogue-1xc.9.Verification
devtools test tests/unit/storage/test_session_insight_refresh.py::test_full_rebuild_chunks_by_message_budget_before_page_size tests/unit/storage/test_session_insight_refresh.py::test_full_rebuild_commits_incrementally_and_prunes_orphans tests/unit/daemon/test_convergence_stages.py::test_default_convergence_stages_retry_bounded_false_results-> 3 passed.devtools render all --check-> OK.devtools test tests/unit/storage/test_session_insight_refresh.py tests/unit/daemon/test_convergence_stages.py-> 61 passed.devtools verify --quick-> passed, run20260704T215833Z-quick-1935811-feb86f4f.devtools verify --quick-> passed oncb556339a64cd8ba9a8f40616f85b129434faf9f, run20260704T220022Z-quick-1944727-a492c91b.Ref polylogue-1xc.1
Ref polylogue-1xc.9
Summary by CodeRabbit