Repository navigation
refactor(storage): derive session product status descriptors (#373) - #373
Conversation
Problem: session-product status checks repeated table presence, row counts, FTS duplicate checks, repair metrics, and readiness predicates across sync and async paths. What changed: add local descriptors for product tables, FTS projections, status-count fallbacks, and readiness predicates; drive sync and async status assembly from those descriptors; and add focused descriptor and sync/async parity tests. Verification: ruff check polylogue/storage/session_product_status.py tests/unit/storage/test_session_product_status_descriptors.py; mypy polylogue/storage/session_product_status.py; pytest -q tests/unit/storage/test_session_product_status_descriptors.py tests/unit/cli/test_products.py tests/unit/storage/test_derived_status.py tests/unit/storage/test_embedding_stats.py; devtools render-all --check; devtools verify. Ref #322
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 12 minutes and 17 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 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 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary Derive session-product status checks from local descriptors for product tables, FTS projections, repair/count metrics, and readiness predicates. ## Problem Issue #322 identified that `polylogue/storage/session_product_status.py` repeated table-presence checks, row counts, duplicate checks, repair metrics, and readiness assembly logic across sync and async paths. That made fallback behavior easy to drift, especially around absent product tables. Closes #322 ## Solution - Added local status descriptor types for product tables, FTS projections, status-count fallbacks, and readiness predicates. - Reworked sync and async status assembly to expand the shared descriptor catalogs. - Preserved `SessionProductStatusSnapshot` fields and the public CLI/MCP payload shape. - Added descriptor tests plus a sync/async parity test for absent product tables. ## Verification - `ruff check polylogue/storage/session_product_status.py tests/unit/storage/test_session_product_status_descriptors.py` -> passed - `mypy polylogue/storage/session_product_status.py` -> no issues - `pytest -q tests/unit/storage/test_session_product_status_descriptors.py tests/unit/cli/test_products.py -k 'session_product_status or descriptor or stale or duplicate'` -> 14 passed - `pytest -q tests/unit/storage/test_session_product_status_descriptors.py tests/unit/cli/test_products.py tests/unit/storage/test_derived_status.py tests/unit/storage/test_embedding_stats.py` -> 44 passed - `devtools render-all --check` -> generated surfaces in sync - `devtools verify` -> all checks passed - `git push -u origin feature/refactor/session-product-status-descriptors` -> pre-push quick verification passed
Summary
Derive session-product status checks from local descriptors for product tables, FTS projections, repair/count metrics, and readiness predicates.
Problem
Issue #322 identified that
polylogue/storage/session_product_status.pyrepeated table-presence checks, row counts, duplicate checks, repair metrics, and readiness assembly logic across sync and async paths. That made fallback behavior easy to drift, especially around absent product tables.Closes #322
Solution
SessionProductStatusSnapshotfields and the public CLI/MCP payload shape.Verification
ruff check polylogue/storage/session_product_status.py tests/unit/storage/test_session_product_status_descriptors.py→ passedmypy polylogue/storage/session_product_status.py→ no issuespytest -q tests/unit/storage/test_session_product_status_descriptors.py tests/unit/cli/test_products.py -k 'session_product_status or descriptor or stale or duplicate'→ 14 passedpytest -q tests/unit/storage/test_session_product_status_descriptors.py tests/unit/cli/test_products.py tests/unit/storage/test_derived_status.py tests/unit/storage/test_embedding_stats.py→ 44 passeddevtools render-all --check→ generated surfaces in syncdevtools verify→ all checks passedgit push -u origin feature/refactor/session-product-status-descriptors→ pre-push quick verification passed