Repository navigation
refactor: split session product status counts - #300
Conversation
|
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 25 minutes and 20 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 (1)
✨ 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f3849f72c
ℹ️ 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".
## Summary - Split session-product status table probing and count assembly into explicit sync/async helpers. - Preserve the public `session_product_status_sync` and `session_product_status_async` contracts as thin orchestration wrappers. - Keep sync `verify_freshness=False` count behavior distinct from async full-freshness behavior. ## Problem `session_product_status.py` had large public functions that mixed table existence probing, table counts, distinct FTS counts, duplicate estimates, stale/orphan repair counts, and final readiness projection. This made the session-product repair/status path harder to audit after the doctor readiness cleanup. ## Solution - Added typed aliases for table-presence and status-count payloads. - Factored sync count assembly into materialized-count, FTS duplicate-count, and repair-count helpers. - Factored async count assembly into matching materialized and repair count helpers while preserving its existing semantics. ## Verification - `pytest -q tests/unit/storage/test_derived_status.py tests/unit/cli/test_products.py tests/unit/core/test_health_core.py` - `mypy polylogue/storage/session_product_status.py tests/unit/storage/test_derived_status.py tests/unit/cli/test_products.py tests/unit/core/test_health_core.py` - `mypy polylogue tests` - `devtools verify --quick` Ref #270
## Summary - Replace fixed sleep timing in the interrupted-ingestion integration test with a wait for persisted message rows. - Reuse a small helper to finish or kill interrupted subprocesses consistently. ## Problem - Python 3.12 CI exposed a timing race in tests/integration/test_ingestion_interrupts.py: the test sent SIGINT after a fixed delay and then assumed the SQLite database had already been created. - Slow startup or scheduler contention can make that assertion fail before the pipeline has reached persistence, even though the production code is unrelated. ## Solution - Poll the isolated SQLite database until the messages table contains persisted rows before sending SIGINT. - Preserve the corruption/resume contract while removing the startup-speed assumption. ## Verification - ruff check tests/integration/test_ingestion_interrupts.py - mypy tests/integration/test_ingestion_interrupts.py - pytest -q tests/integration/test_ingestion_interrupts.py - git push hook: devtools verify --quick Ref #300.
## Summary - Replace the schema-local JSON alias module with the canonical runtime JSON contract in polylogue.lib.json. - Update schema, MCP, surface, CLI, and test imports to use the canonical JSON types and coercion helpers. - Tighten readiness, repair, maintenance, and check-command machine payloads to return canonical JSONDocument values. - Remove polylogue/schemas/json_types.py so new schema code cannot drift back to the unsafe cast-only helper. ## Problem - The codebase carried two JSON helper modules: polylogue.lib.json, which validates JSON values at runtime, and polylogue.schemas.json_types, which duplicated the type aliases but used cast-only coercion. - That split made schema code depend on a weaker, path-dependent contract and left check/maintenance JSON renderers with object-shaped payloads instead of explicit JSON contracts. ## Solution - Standardize internal imports on polylogue.lib.json across the schema/tooling/tests surface. - Convert readiness, repair, maintenance, and check rendering payload outputs to canonical JSONDocument coercion. - Delete the duplicate schema-local helper module instead of keeping a compatibility wrapper. ## Verification - ruff check polylogue tests/infra tests/unit - mypy polylogue tests/infra tests/unit - pytest -q tests/unit/core/test_schema_laws.py tests/unit/core/test_schema_registry.py tests/unit/core/test_schema_cluster_assignment.py tests/unit/core/test_schema_annotation_contracts.py tests/unit/pipeline/test_prepare_semantic.py tests/unit/pipeline/test_run_sources.py tests/unit/sources/test_source_laws.py tests/unit/sources/test_drive_ops.py - mypy polylogue/maintenance_models.py polylogue/readiness.py polylogue/storage/repair.py polylogue/cli/check_models.py polylogue/cli/check_rendering_json.py - pytest -q tests/unit/cli/test_check.py tests/unit/storage/test_repair.py tests/unit/core/test_health_core.py tests/unit/core/test_maintenance_targets.py - git push hook: devtools verify --quick Stacked on #305. Ref #300.
`session_product_status.py` had large public functions that mixed table existence probing, table counts, distinct FTS counts, duplicate estimates, stale/orphan repair counts, and final readiness projection — harder to audit after the doctor readiness cleanup. Splits table probing and count assembly into explicit sync/async helpers. Adds typed aliases for table-presence and status-count payloads. Factors sync count assembly into materialized-count, FTS duplicate-count, and repair-count helpers. Factors async count assembly into matching materialized and repair count helpers while preserving existing semantics. Preserves the public `session_product_status_sync` and `session_product_status_async` contracts as thin orchestration wrappers, keeping sync `verify_freshness=False` count behavior distinct from async full-freshness behavior. Verification: pytest + mypy over derived-status / products / health-core suites; devtools verify --quick green. Ref #270
Python 3.12 CI exposed a timing race in `test_ingestion_interrupts.py`: the test sent SIGINT after a fixed delay and then assumed the SQLite database had already been created. Slow startup or scheduler contention could make that assertion fail before the pipeline reached persistence, even though the production code was unrelated. Replaces fixed sleep timing with a poll of the isolated SQLite database until the messages table contains persisted rows before sending SIGINT. Reuses a small helper to finish or kill interrupted subprocesses consistently. Preserves the corruption/resume contract while removing the startup-speed assumption. Verification: ruff + mypy + pytest over the ingestion-interrupts test; devtools verify --quick green. Ref #300
The codebase carried two JSON helper modules: `polylogue.lib.json` validates JSON values at runtime, while `polylogue.schemas.json_types` duplicated the type aliases but used cast-only coercion. Schema code depended on a weaker, path-dependent contract, and check/maintenance JSON renderers carried object-shaped payloads instead of explicit JSON contracts. Standardizes internal imports on `polylogue.lib.json` across the schema / tooling / tests surface. Updates schema, MCP, surface, CLI, and test imports to use the canonical JSON types and coercion helpers. Tightens readiness, repair, maintenance, and check-command machine payloads to return canonical `JSONDocument` values. Deletes `polylogue/schemas/json_types.py` so new schema code cannot drift back to the unsafe cast-only helper (no compatibility wrapper). Verification: ruff + mypy + pytest over schema / pipeline / source / check / repair / health-core / maintenance-targets suites; devtools verify --quick green. Stacked on #305. Ref #300
`session_product_status.py` had large public functions that mixed table existence probing, table counts, distinct FTS counts, duplicate estimates, stale/orphan repair counts, and final readiness projection — harder to audit after the doctor readiness cleanup. Splits table probing and count assembly into explicit sync/async helpers. Adds typed aliases for table-presence and status-count payloads. Factors sync count assembly into materialized-count, FTS duplicate-count, and repair-count helpers. Factors async count assembly into matching materialized and repair count helpers while preserving existing semantics. Preserves the public `session_product_status_sync` and `session_product_status_async` contracts as thin orchestration wrappers, keeping sync `verify_freshness=False` count behavior distinct from async full-freshness behavior. Verification: pytest + mypy over derived-status / products / health-core suites; devtools verify --quick green. Ref #270
Python 3.12 CI exposed a timing race in `test_ingestion_interrupts.py`: the test sent SIGINT after a fixed delay and then assumed the SQLite database had already been created. Slow startup or scheduler contention could make that assertion fail before the pipeline reached persistence, even though the production code was unrelated. Replaces fixed sleep timing with a poll of the isolated SQLite database until the messages table contains persisted rows before sending SIGINT. Reuses a small helper to finish or kill interrupted subprocesses consistently. Preserves the corruption/resume contract while removing the startup-speed assumption. Verification: ruff + mypy + pytest over the ingestion-interrupts test; devtools verify --quick green. Ref #300
The codebase carried two JSON helper modules: `polylogue.lib.json` validates JSON values at runtime, while `polylogue.schemas.json_types` duplicated the type aliases but used cast-only coercion. Schema code depended on a weaker, path-dependent contract, and check/maintenance JSON renderers carried object-shaped payloads instead of explicit JSON contracts. Standardizes internal imports on `polylogue.lib.json` across the schema / tooling / tests surface. Updates schema, MCP, surface, CLI, and test imports to use the canonical JSON types and coercion helpers. Tightens readiness, repair, maintenance, and check-command machine payloads to return canonical `JSONDocument` values. Deletes `polylogue/schemas/json_types.py` so new schema code cannot drift back to the unsafe cast-only helper (no compatibility wrapper). Verification: ruff + mypy + pytest over schema / pipeline / source / check / repair / health-core / maintenance-targets suites; devtools verify --quick green. Stacked on #305. Ref #300
`session_product_status.py` had large public functions that mixed table existence probing, table counts, distinct FTS counts, duplicate estimates, stale/orphan repair counts, and final readiness projection — harder to audit after the doctor readiness cleanup. Splits table probing and count assembly into explicit sync/async helpers. Adds typed aliases for table-presence and status-count payloads. Factors sync count assembly into materialized-count, FTS duplicate-count, and repair-count helpers. Factors async count assembly into matching materialized and repair count helpers while preserving existing semantics. Preserves the public `session_product_status_sync` and `session_product_status_async` contracts as thin orchestration wrappers, keeping sync `verify_freshness=False` count behavior distinct from async full-freshness behavior. Verification: pytest + mypy over derived-status / products / health-core suites; devtools verify --quick green. Ref #270
Python 3.12 CI exposed a timing race in `test_ingestion_interrupts.py`: the test sent SIGINT after a fixed delay and then assumed the SQLite database had already been created. Slow startup or scheduler contention could make that assertion fail before the pipeline reached persistence, even though the production code was unrelated. Replaces fixed sleep timing with a poll of the isolated SQLite database until the messages table contains persisted rows before sending SIGINT. Reuses a small helper to finish or kill interrupted subprocesses consistently. Preserves the corruption/resume contract while removing the startup-speed assumption. Verification: ruff + mypy + pytest over the ingestion-interrupts test; devtools verify --quick green. Ref #300
The codebase carried two JSON helper modules: `polylogue.lib.json` validates JSON values at runtime, while `polylogue.schemas.json_types` duplicated the type aliases but used cast-only coercion. Schema code depended on a weaker, path-dependent contract, and check/maintenance JSON renderers carried object-shaped payloads instead of explicit JSON contracts. Standardizes internal imports on `polylogue.lib.json` across the schema / tooling / tests surface. Updates schema, MCP, surface, CLI, and test imports to use the canonical JSON types and coercion helpers. Tightens readiness, repair, maintenance, and check-command machine payloads to return canonical `JSONDocument` values. Deletes `polylogue/schemas/json_types.py` so new schema code cannot drift back to the unsafe cast-only helper (no compatibility wrapper). Verification: ruff + mypy + pytest over schema / pipeline / source / check / repair / health-core / maintenance-targets suites; devtools verify --quick green. Stacked on #305. Ref #300
Bumps [pytest-benchmark](https://github.com/ionelmc/pytest-benchmark) from 5.2.3 to 5.3.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/ionelmc/pytest-benchmark/releases">pytest-benchmark's releases</a>.</em></p> <blockquote> <h2>v5.3.0</h2> <ul> <li>Added --benchmark-precision and --benchmark-confidence: instead of a fixed number of rounds, stop once the mean's relative margin of error falls below the given fraction. Contributed by Aarni Koskela in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/318">ionelmc/pytest-benchmark#318</a>.</li> <li>Added compare --between mode. Example: pytest-benchmark compare --between=min 0001 0002. Contributed by Aarni Koskela in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/302">ionelmc/pytest-benchmark#302</a>.</li> <li>Modernized the CI/linting and added spellchecking. Contributed by Aarni Koskela in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/304">ionelmc/pytest-benchmark#304</a>, <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/306">ionelmc/pytest-benchmark#306</a> and <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/319">ionelmc/pytest-benchmark#319</a>.</li> <li>Defer the xdist auto-disable warning until a benchmark fixture is collected. Contributed by xlyyddy in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/317">ionelmc/pytest-benchmark#317</a> (fixes <a href="https://redirect.github.com/ionelmc/pytest-benchmark/issues/65">ionelmc/pytest-benchmark#65</a>).</li> <li>Replaced deprecated argparse.FileType. Contributed by Sophia Castellarin in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/310">ionelmc/pytest-benchmark#310</a>.</li> <li>Fixed various spelling/typos. Contributed by Daniel Holth and Hugo van Kemenade in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/297">ionelmc/pytest-benchmark#297</a> and <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/299">ionelmc/pytest-benchmark#299</a>.</li> <li>Cleaned up various dead code. Contributed by Hugo van Kemenade in <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/300">ionelmc/pytest-benchmark#300</a> and <a href="https://redirect.github.com/ionelmc/pytest-benchmark/pull/301">ionelmc/pytest-benchmark#301</a>.</li> <li>CI now tests only with latest Pytest (now 9.1.1), Python 3.10-3.14 and PyPy 3.11.</li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/ionelmc/pytest-benchmark/blob/master/CHANGELOG.rst">pytest-benchmark's changelog</a>.</em></p> <blockquote> <h2>v5.3.0 (2026-08-23)</h2> <ul> <li>Added <code>--benchmark-precision</code> and <code>--benchmark-confidence</code>: instead of a fixed number of rounds, stop once the mean's relative margin of error falls below the given fraction. Contributed by Aarni Koskela in <code>[#318](ionelmc/pytest-benchmark#318) <https://github.com/ionelmc/pytest-benchmark/pull/318></code>_.</li> <li>Added <code>compare --between</code> mode. Example: <code>pytest-benchmark compare --between=min 0001 0002</code>. Contributed by Aarni Koskela in <code>[#302](ionelmc/pytest-benchmark#302) <https://github.com/ionelmc/pytest-benchmark/pull/302></code>_.</li> <li>Modernized the CI/linting and added spellchecking. Contributed by Aarni Koskela in <code>[#304](ionelmc/pytest-benchmark#304) <https://github.com/ionelmc/pytest-benchmark/pull/304></code><em>, <code>[#306](ionelmc/pytest-benchmark#306) <https://github.com/ionelmc/pytest-benchmark/pull/306></code></em> and <code>[#319](ionelmc/pytest-benchmark#319) <https://github.com/ionelmc/pytest-benchmark/pull/319></code>_.</li> <li>Defer the xdist auto-disable warning until a benchmark fixture is collected. Contributed by xlyyddy in <code>[#317](ionelmc/pytest-benchmark#317) <https://github.com/ionelmc/pytest-benchmark/pull/317></code>_ (fixes <code>[#65](ionelmc/pytest-benchmark#65) <https://github.com/ionelmc/pytest-benchmark/issues/65></code>_).</li> <li>Replaced deprecated argparse.FileType. Contributed by Sophia Castellarin in <code>[#310](ionelmc/pytest-benchmark#310) <https://github.com/ionelmc/pytest-benchmark/pull/310></code>_.</li> <li>Fixed various spelling/typos. Contributed by Daniel Holth and Hugo van Kemenade in <code>[#297](ionelmc/pytest-benchmark#297) <https://github.com/ionelmc/pytest-benchmark/pull/297></code>_ and <code>[#299](ionelmc/pytest-benchmark#299) <https://github.com/ionelmc/pytest-benchmark/pull/299></code>_.</li> <li>Cleaned up various dead code. Contributed by Hugo van Kemenade in <code>[#300](ionelmc/pytest-benchmark#300) <https://github.com/ionelmc/pytest-benchmark/pull/300></code>_ and <code>[#301](ionelmc/pytest-benchmark#301) <https://github.com/ionelmc/pytest-benchmark/pull/301></code>_.</li> <li>CI now tests only with latest Pytest (now 9.1.1), Python 3.10-3.14 and PyPy 3.11.</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/07d519672687402e6c3fac1a543fbefd810d1e5b"><code>07d5196</code></a> Bump version: 5.2.3 → 5.3.0</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/accf7331e22c0ede38ffa72081c38f3469e0c9b5"><code>accf733</code></a> Add some details on <a href="https://redirect.github.com/ionelmc/pytest-benchmark/issues/304">#304</a>.</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/417dd9fa275e8b9d62c469e676cdb7546d2c4b8f"><code>417dd9f</code></a> Really update the changelog.</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/898acb34430c99ad877e94c52c8b90256a3bb4a8"><code>898acb3</code></a> Update changelog and plan release.</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/9cc7ef0bb1ad3785a46834b24660562dd48e4a0b"><code>9cc7ef0</code></a> Defer xdist warning until benchmark collection (<a href="https://redirect.github.com/ionelmc/pytest-benchmark/issues/65">#65</a>)</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/ef485506f04d5510831fdbdee5be7014f4726a93"><code>ef48550</code></a> Some minor skel updates: test only against latest pytest; bump linting/format...</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/88eaea957d1685f604a5835555d2ce5dbec1ac29"><code>88eaea9</code></a> Add --benchmark-precision for adaptive rounds (opt-in)</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/3b83d127127de74d9f71a3a78e5f661fac044950"><code>3b83d12</code></a> Update and freeze GHA actions</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/4b7662fbfba046eb92dd183e005e8708ac81e6cd"><code>4b7662f</code></a> Fix ruff complaints</li> <li><a href="https://github.com/ionelmc/pytest-benchmark/commit/26b011361d2c41f529a73833e1be8d3a565600fa"><code>26b0113</code></a> Remove Taplo lint (unmaintained)</li> <li>Additional commits viewable in <a href="https://github.com/ionelmc/pytest-benchmark/compare/v5.2.3...v5.3.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
session_product_status_syncandsession_product_status_asynccontracts as thin orchestration wrappers.verify_freshness=Falsecount behavior distinct from async full-freshness behavior.Problem
session_product_status.pyhad large public functions that mixed table existence probing, table counts, distinct FTS counts, duplicate estimates, stale/orphan repair counts, and final readiness projection. This made the session-product repair/status path harder to audit after the doctor readiness cleanup.Solution
Verification
pytest -q tests/unit/storage/test_derived_status.py tests/unit/cli/test_products.py tests/unit/core/test_health_core.pymypy polylogue/storage/session_product_status.py tests/unit/storage/test_derived_status.py tests/unit/cli/test_products.py tests/unit/core/test_health_core.pymypy polylogue testsdevtools verify --quickRef #270