Repository navigation
test(storage): re-arm stale global-first anti-vacuity VM-step canary - #3341
Conversation
Problem: polylogue-1ldl: test_exact_session_action_count_bounds_pairing_before_global_ranking and test_exact_session_multi_aggregate_work_is_not_amplified_by_irrelevant_growth each monkeypatch _action_relation_for_query to fall back to the plain "actions" relation name, simulating pre-z9gh.2 "global-first" behavior, and assert the resulting query costs >=50000 SQLite VM steps as an anti-vacuity control against a mutation that removes the exact-session bound. Since PR #3018 (z9gh.2) replaced the old windowed-CTE "actions" compatibility view with one backed by the small, pre-materialized, session_id-indexed action_pairs table, renaming the relation to "actions" no longer forces any meaningfully different or expensive path -- both tests measured 0/400 VM steps for the "mutant" query, well under the 50000 threshold, so the canary had silently stopped discriminating the global-first regression it exists to catch. polylogue-5202: test_live_multi_session_divergence_reopens_raw_authority in tests/unit/sources/test_live_batch_support.py was reported failing on an older master with a stale `failed == [second]` assertion predating PR #3129's deferred-membership semantics change. Investigation found this test's assertions were already updated to the current-correct `failed == []` / `succeeded == [second]` shape by PR #3282 (4120c40, merged 2026-07-26, Ref polylogue-6mvg) as part of unrelated FTS-repair-deferral work -- the test passes on this branch with no further change needed. Verified the broader `-k "raw_materialization or raw_authority"` selection (198 tests) is all green. No code change accompanies polylogue-5202 in this commit; it is closed by reference to the PR that already fixed it. What changed: Replaced the now-inert `lambda **_kwargs: ("", "actions", [])` mutation in both polylogue-1ldl tests with one that forces the actually-expensive "global-first" branch that still exists in `action_relation_select_sql(session_placeholders=None)` -- the unbounded windowed tool_use/tool_result pairing recomputation across every block in the archive, rather than a read of the materialized action_pairs table. Verified this reproduces genuinely archive-wide cost (measured 53500 VM steps for the count-only path vs 400 bounded, and correspondingly for the multi-aggregate path), restoring the anti-vacuity control's discriminating power. Added inline comments at both mutation sites explaining what changed and why the old mutation stopped working. Also discovered (not part of either bead's scope) that test_api_query_units_routes_through_execution_control and test_api_multi_aggregate_receipt_reports_real_work_selection_and_delivery in the same execution-control test file fail on unmodified master with an unrelated "query_units" vs "api.query_units" call-log naming mismatch, exactly as polylogue-1ldl's own investigation notes aside. Filed as its own tracked item, polylogue-0twa, rather than left as anonymous debt. Verification: - devtools test tests/unit/storage/test_archive_tiers_archive.py tests/unit/archive/query/test_execution_control.py -> 60 passed, 2 failed (the pre-existing, out-of-scope polylogue-0twa naming mismatch; both polylogue-1ldl tests pass) - devtools test -k "raw_materialization or raw_authority" -> 198 passed (polylogue-5202's test included) - ruff check / ruff format --check on both changed files -> clean - mypy --strict on both changed files -> no issues - devtools render all --check -> no drift Ref polylogue-1ldl, polylogue-5202 Co-Authored-By: Claude <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 22 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 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 |
Summary
Fixes a stale VM-step anti-vacuity mutation in two archive query tests (polylogue-1ldl) and verifies a previously-stale live-batch assertion (polylogue-5202) is already resolved on master by an unrelated prior PR.
Problem
polylogue-1ldl:
test_exact_session_action_count_bounds_pairing_before_global_ranking(tests/unit/storage/test_archive_tiers_archive.py) andtest_exact_session_multi_aggregate_work_is_not_amplified_by_irrelevant_growth(tests/unit/archive/query/test_execution_control.py) each monkeypatch_action_relation_for_queryto fall back to the plain"actions"relation name, simulating pre-z9gh.2 "global-first" behavior, and assert the resulting query costs>= 50000SQLite VM steps as an anti-vacuity control. Since PR #3018 (z9gh.2) replaced the old windowed-CTEactionscompatibility view with one backed by the small, pre-materialized, session_id-indexedaction_pairstable, renaming the relation to"actions"no longer forces any meaningfully different/expensive path — both tests measured 0/400 VM steps for the "mutant" query, well under the 50000 threshold. The canary had silently stopped discriminating the exact regression it exists to catch.polylogue-5202:
test_live_multi_session_divergence_reopens_raw_authority(tests/unit/sources/test_live_batch_support.py) was reported failing with a stalefailed == [second]assertion predating PR #3129's deferred-membership semantics change. Investigation found the assertions were already updated to the current-correctfailed == [] / succeeded == [second]shape by PR #3282 (commit 4120c40, merged 2026-07-26, Ref polylogue-6mvg) as part of unrelated FTS-repair-deferral work. The test already passes on current master with no further code change needed.Solution
lambda **_kwargs: ("", "actions", [])mutation at both polylogue-1ldl sites with one that forces the actually-expensive "global-first" branch that still exists inaction_relation_select_sql(session_placeholders=None)— the unbounded windowed tool_use/tool_result pairing recomputation across every block in the archive, instead of a read against the materializedaction_pairstable. Verified this reproduces genuinely archive-wide cost (measured 53500 VM steps for the count-only path vs 400 bounded).raw_materialization/raw_authorityselection are green on master, and closing the bead by reference to PR perf(storage): defer FTS repair off the live-ingest write path #3282.query_unitsvsapi.query_unitscall-log naming assertion noticed in the same test file (out of scope for this PR).Verification
devtools test tests/unit/storage/test_archive_tiers_archive.py tests/unit/archive/query/test_execution_control.py→ 60 passed, 2 failed (pre-existing, out-of-scope polylogue-0twa naming mismatch; both polylogue-1ldl tests pass)devtools test -k "raw_materialization or raw_authority"→ 198 passed (includes polylogue-5202's test)ruff check/ruff format --checkon both changed files → cleanmypy --stricton both changed files → no issuesdevtools render all --check→ no driftdevtools verify --quick→ all steps okRef polylogue-1ldl, polylogue-5202