Repository navigation
refactor: rebuild storage and product runtime boundary contracts - #260
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (16)
📝 WalkthroughWalkthroughThis PR refactors the storage and product runtime boundary contracts throughout the codebase to replace generic Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 - rebuild the archive-product query/provenance surface around explicit shared product contracts - align runtime state, artifact, and session-product helpers with the newer typed payload boundaries - widen run-activity accounting to the actual CLI/runtime count surface used across the repo ## Problem Closes #259 The next remaining architectural pressure after the schema/source and audit tranches was concentrated in the storage and durable-product boundary layer. Runtime state updates, product registry rendering, and session-product hydration still carried broad object-shaped plumbing and repeated provenance/query wiring even though those shapes were already known. ## Solution - rewrote the archive-product contract layer in `polylogue/archive_products.py` and `polylogue/operations/archive.py` so query models inherit from explicit shared bases, search-active behavior is modeled directly, aggregate pagination is centralized, and product provenance/inference provenance construction is no longer repeated in every product type - tightened `polylogue/products/registry.py` around `ArchiveProductModel` instead of generic object payloads so product accessors and JSON rendering operate over explicit product contracts - aligned runtime/storage follow-through in `polylogue/storage/raw_state_models.py`, `polylogue/storage/artifact_views.py`, `polylogue/storage/repository_contracts.py`, `polylogue/storage/session_product_profiles.py`, and `polylogue/storage/session_product_threads.py` so typed payloads are normalized at the boundary instead of reconstructed through loose dict plumbing - fixed the repo-wide count-surface mismatch in `polylogue/lib/run_activity.py` so CLI formatting and run observers consume the tightened run-count contracts without backsliding to weaker helpers ## Verification - `ruff check polylogue/archive_products.py polylogue/operations/archive.py polylogue/products/registry.py polylogue/storage/raw_state_models.py polylogue/storage/artifact_views.py polylogue/storage/repository_contracts.py polylogue/storage/session_product_profiles.py polylogue/storage/session_product_threads.py` - `mypy polylogue/archive_products.py polylogue/operations/archive.py polylogue/products/registry.py polylogue/storage/raw_state_models.py polylogue/storage/artifact_views.py polylogue/storage/repository_contracts.py polylogue/storage/session_product_profiles.py polylogue/storage/session_product_threads.py` - `pytest -q tests/unit/storage/test_session_product_profiles.py tests/unit/storage/test_product_materialization_laws.py tests/unit/storage/test_session_product_refresh.py tests/unit/cli/test_products.py tests/unit/cli/test_analytics.py` - `pytest -q tests/unit/storage/test_parse_tracking.py tests/unit/cli/test_check.py -k "parse or artifact"` - `ruff check polylogue/lib/run_activity.py polylogue/cli/formatting.py` - `mypy polylogue/lib/run_activity.py polylogue/cli/formatting.py` - `devtools verify`
After the schema/source and audit tranches, architectural pressure concentrated on the storage and durable-product boundary. Runtime state updates, product registry rendering, and session-product hydration still carried broad object-shaped plumbing and repeated provenance/query wiring even though those shapes were already known. Rewrites the archive-product contract layer in `archive_products.py` and `operations/archive.py` so query models inherit from explicit shared bases, search-active behavior is modeled directly, aggregate pagination is centralized, and product provenance / inference provenance construction is no longer repeated in every product type. Tightens `products/registry.py` around `ArchiveProductModel` instead of generic object payloads so product accessors and JSON rendering operate over explicit product contracts. Aligns runtime/storage follow-through in `storage/raw_state_models.py`, `artifact_views.py`, `repository_contracts.py`, `session_product_profiles.py`, and `session_product_threads.py` so typed payloads are normalized at the boundary instead of reconstructed through loose dict plumbing. Fixes the repo-wide count-surface mismatch in `lib/run_activity.py` so CLI formatting and run observers consume the tightened run-count contracts. Verification: ruff + mypy + pytest over storage / product / CLI formatting surfaces; devtools verify green. Closes #259
After the schema/source and audit tranches, architectural pressure concentrated on the storage and durable-product boundary. Runtime state updates, product registry rendering, and session-product hydration still carried broad object-shaped plumbing and repeated provenance/query wiring even though those shapes were already known. Rewrites the archive-product contract layer in `archive_products.py` and `operations/archive.py` so query models inherit from explicit shared bases, search-active behavior is modeled directly, aggregate pagination is centralized, and product provenance / inference provenance construction is no longer repeated in every product type. Tightens `products/registry.py` around `ArchiveProductModel` instead of generic object payloads so product accessors and JSON rendering operate over explicit product contracts. Aligns runtime/storage follow-through in `storage/raw_state_models.py`, `artifact_views.py`, `repository_contracts.py`, `session_product_profiles.py`, and `session_product_threads.py` so typed payloads are normalized at the boundary instead of reconstructed through loose dict plumbing. Fixes the repo-wide count-surface mismatch in `lib/run_activity.py` so CLI formatting and run observers consume the tightened run-count contracts. Verification: ruff + mypy + pytest over storage / product / CLI formatting surfaces; devtools verify green. Closes #259
After the schema/source and audit tranches, architectural pressure concentrated on the storage and durable-product boundary. Runtime state updates, product registry rendering, and session-product hydration still carried broad object-shaped plumbing and repeated provenance/query wiring even though those shapes were already known. Rewrites the archive-product contract layer in `archive_products.py` and `operations/archive.py` so query models inherit from explicit shared bases, search-active behavior is modeled directly, aggregate pagination is centralized, and product provenance / inference provenance construction is no longer repeated in every product type. Tightens `products/registry.py` around `ArchiveProductModel` instead of generic object payloads so product accessors and JSON rendering operate over explicit product contracts. Aligns runtime/storage follow-through in `storage/raw_state_models.py`, `artifact_views.py`, `repository_contracts.py`, `session_product_profiles.py`, and `session_product_threads.py` so typed payloads are normalized at the boundary instead of reconstructed through loose dict plumbing. Fixes the repo-wide count-surface mismatch in `lib/run_activity.py` so CLI formatting and run observers consume the tightened run-count contracts. Verification: ruff + mypy + pytest over storage / product / CLI formatting surfaces; devtools verify green. Closes #259
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 386e483861
ℹ️ 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".
|
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
Problem
Closes #259
The next remaining architectural pressure after the schema/source and audit tranches was concentrated in the storage and durable-product boundary layer. Runtime state updates, product registry rendering, and session-product hydration still carried broad object-shaped plumbing and repeated provenance/query wiring even though those shapes were already known.
Solution
polylogue/archive_products.pyandpolylogue/operations/archive.pyso query models inherit from explicit shared bases, search-active behavior is modeled directly, aggregate pagination is centralized, and product provenance/inference provenance construction is no longer repeated in every product typepolylogue/products/registry.pyaroundArchiveProductModelinstead of generic object payloads so product accessors and JSON rendering operate over explicit product contractspolylogue/storage/raw_state_models.py,polylogue/storage/artifact_views.py,polylogue/storage/repository_contracts.py,polylogue/storage/session_product_profiles.py, andpolylogue/storage/session_product_threads.pyso typed payloads are normalized at the boundary instead of reconstructed through loose dict plumbingpolylogue/lib/run_activity.pyso CLI formatting and run observers consume the tightened run-count contracts without backsliding to weaker helpersVerification
ruff check polylogue/archive_products.py polylogue/operations/archive.py polylogue/products/registry.py polylogue/storage/raw_state_models.py polylogue/storage/artifact_views.py polylogue/storage/repository_contracts.py polylogue/storage/session_product_profiles.py polylogue/storage/session_product_threads.pymypy polylogue/archive_products.py polylogue/operations/archive.py polylogue/products/registry.py polylogue/storage/raw_state_models.py polylogue/storage/artifact_views.py polylogue/storage/repository_contracts.py polylogue/storage/session_product_profiles.py polylogue/storage/session_product_threads.pypytest -q tests/unit/storage/test_session_product_profiles.py tests/unit/storage/test_product_materialization_laws.py tests/unit/storage/test_session_product_refresh.py tests/unit/cli/test_products.py tests/unit/cli/test_analytics.pypytest -q tests/unit/storage/test_parse_tracking.py tests/unit/cli/test_check.py -k "parse or artifact"ruff check polylogue/lib/run_activity.py polylogue/cli/formatting.pymypy polylogue/lib/run_activity.py polylogue/cli/formatting.pydevtools verify