Skip to content

refactor(storage): derive session product status descriptors (#373) - #373

Merged
Sinity merged 1 commit into
masterfrom
feature/refactor/session-product-status-descriptors
Apr 23, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/refactor/session-product-status-descriptors

Conversation

@Sinity

@Sinity Sinity commented Apr 23, 2026

Copy link
Copy Markdown
Owner

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

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
@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 12 minutes and 17 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2c077996-b1e4-4222-b16e-ed9aec23bc24

📥 Commits

Reviewing files that changed from the base of the PR and between cbee970 and 0a8b43e.

📒 Files selected for processing (2)
  • polylogue/storage/session_product_status.py
  • tests/unit/storage/test_session_product_status_descriptors.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/refactor/session-product-status-descriptors

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 and usage tips.

@Sinity Sinity changed the title refactor(storage): derive session product status descriptors refactor(storage): derive session product status descriptors (#373) Apr 23, 2026
@Sinity
Sinity merged commit 91a678c into master Apr 23, 2026
10 of 13 checks passed
@Sinity
Sinity deleted the feature/refactor/session-product-status-descriptors branch April 23, 2026 00:38
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@Sinity
Sinity requested a review from Copilot May 1, 2026 01:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

Sinity added a commit that referenced this pull request May 7, 2026
## 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
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.

refactor: derive session product status from descriptors

2 participants