You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: derive session product status from descriptors #322
The low-churn audit in #315 found that polylogue/storage/session_product_status.py still repeats table checks, sync and async count queries, duplicate checks, FTS readiness checks, and status assembly logic.
The file is typed, but structurally boilerplate-heavy. A descriptor model for product tables and projections should reduce drift risk while keeping status semantics explicit.
Scope
Extract product status descriptors for tables/projections that can drive common status checks.
Candidate descriptors:
table name and row-count query
duplicate-key query where applicable
sync/async access path
FTS projection readiness checks
product status assembly metadata
Acceptance criteria
Repeated status-count and readiness patterns are replaced by descriptor-driven helpers.
Sync and async behavior stay equivalent.
Product status tests cover representative descriptor types and failure cases.
No user-facing CLI/MCP status contract changes unless explicitly documented.
Starting implementation on feature/refactor/session-product-status-descriptors.
Tactic:
Keep the descriptor model local to polylogue/storage/session_product_status.py for this slice.
Add descriptors for table presence/counts, FTS projections, repair/count metrics, and readiness predicates.
Preserve SessionProductStatusSnapshot field names and CLI/MCP payload shape.
Add tests for representative descriptor behavior and sync/async parity on absent product tables, since that is the easiest fallback path for duplicated logic to drift.
Verification target before PR: focused storage/product tests first, then devtools verify before merge.
Implementation checkpoint on feature/refactor/session-product-status-descriptors.
What changed locally:
Added status descriptors in polylogue/storage/session_product_status.py for product tables, FTS projections, repair/count metrics, and readiness predicates.
Replaced repeated sync/async table/count/FTS/repair assembly logic with descriptor-driven helpers.
Preserved the public SessionProductStatusSnapshot field names and status payload shape.
Added tests/unit/storage/test_session_product_status_descriptors.py for representative descriptor behavior and sync/async parity when product tables are absent.
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
Completed in PR #373 and squash-merged as 91a678cc8b378566aead2c847afd47108ce7041b.
What landed:
Local descriptors now drive session product table checks, FTS projection checks, repair/count metrics, and readiness predicates in polylogue/storage/session_product_status.py.
Sync and async paths share the same descriptor catalogs while preserving the existing SessionProductStatusSnapshot and CLI/MCP payload contract.
Added descriptor-focused tests and an absent-product-table sync/async parity test in tests/unit/storage/test_session_product_status_descriptors.py.
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
Activity
Sinity commentedon Apr 23, 2026
Starting implementation on
feature/refactor/session-product-status-descriptors.Tactic:
polylogue/storage/session_product_status.pyfor this slice.SessionProductStatusSnapshotfield names and CLI/MCP payload shape.Verification target before PR: focused storage/product tests first, then
devtools verifybefore merge.Sinity commentedon Apr 23, 2026
Implementation checkpoint on
feature/refactor/session-product-status-descriptors.What changed locally:
polylogue/storage/session_product_status.pyfor product tables, FTS projections, repair/count metrics, and readiness predicates.SessionProductStatusSnapshotfield names and status payload shape.tests/unit/storage/test_session_product_status_descriptors.pyfor representative descriptor behavior and sync/async parity when product tables are absent.Verification so far:
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 syncNext: run the full local
devtools verify, then commit/open PR if clean.refactor(storage): derive session product status descriptors (#373)
Sinity commentedon Apr 23, 2026
Completed in PR #373 and squash-merged as
91a678cc8b378566aead2c847afd47108ce7041b.What landed:
polylogue/storage/session_product_status.py.SessionProductStatusSnapshotand CLI/MCP payload contract.tests/unit/storage/test_session_product_status_descriptors.py.Verification used before merge:
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 passeddevtools verify --quick-> passedGitHub automation was quota-limited/unstable around review, but there were no inline review threads and local verification was clean.
refactor(storage): derive session product status descriptors (#373)