Repository navigation
refactor: reduce weak payload plumbing across lib and storage runtime - #268
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 4 minutes and 16 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 (21)
✨ 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: fadae8516a
ℹ️ 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".
…#268) Ref #263 ## Summary - reduce weak metadata and analytics payload plumbing across repository write and archive analytics seams - route action-readiness checks through the typed action-event artifact state contract - share typed session payload documents across session profiles, work events, and work threads - normalize legacy session-product fallback payloads and MCP metadata adapters around those tightened contracts ## Problem Recent substrate renewal tightened JSON and session-product contracts, but the lib/storage runtime still had several weak seams: - metadata/tag operations still widened through loose dict/object shapes - provider analytics rows and action-readiness checks were not consistently using their typed runtime contracts - session profile, work event, and thread payloads duplicated near-identical dict schemas in multiple modules - legacy fallback hydration and MCP metadata surfaces still depended on ad hoc adapter logic that became brittle once payload shapes were made explicit ## Solution - updated repository metadata/tag protocols and write paths to use shared JSON document/value contracts - introduced typed provider analytics rows and consumed them through archive operations instead of untyped row dicts - replaced awaitable probing in retrieval readiness with direct `ActionEventArtifactState` consumption - added `polylogue/lib/session_payload_documents.py` and rewired session profile, work event, and thread runtime/storage helpers to share those document contracts - localized compatibility work in the legacy mapper and MCP metadata wrapper so stricter runtime payloads do not leak regressions into old rows or surface serialization ## Verification - `devtools verify` - `pytest -q tests/unit/storage/test_session_product_refresh.py tests/unit/storage/test_product_materialization_laws.py tests/unit/mcp/test_tool_contracts.py -k 'thread or profile or work_event or phase or enrichment'` - `pytest -q tests/unit/storage/test_session_product_mapper_fallbacks.py tests/unit/storage/test_session_product_refresh.py tests/unit/mcp/test_tool_contracts.py -k 'metadata or timeline or work_event or session_profile_record_falls_back'`
…#268) Recent substrate renewal tightened JSON and session-product contracts, but the lib/storage runtime still had several weak seams: metadata/tag operations widened through loose dict/object shapes; provider analytics rows and action-readiness checks were not consistently using their typed runtime contracts; session profile, work event, and thread payloads duplicated near-identical dict schemas in multiple modules; legacy fallback hydration and MCP metadata surfaces depended on ad hoc adapter logic that became brittle once payload shapes were made explicit. Updates repository metadata/tag protocols and write paths to use shared JSON document/value contracts. Introduces typed provider analytics rows and consumes them through archive operations instead of untyped row dicts. Replaces awaitable probing in retrieval readiness with direct `ActionEventArtifactState` consumption. Adds `lib/session_payload_documents.py` and rewires session profile, work event, and thread runtime/storage helpers to share those document contracts. Localizes compatibility work in the legacy mapper and MCP metadata wrapper so stricter runtime payloads don't leak regressions into old rows or surface serialization. Verification: pytest over session-product, MCP tool-contract, and mapper-fallback suites; devtools verify green. Ref #263
…#268) Recent substrate renewal tightened JSON and session-product contracts, but the lib/storage runtime still had several weak seams: metadata/tag operations widened through loose dict/object shapes; provider analytics rows and action-readiness checks were not consistently using their typed runtime contracts; session profile, work event, and thread payloads duplicated near-identical dict schemas in multiple modules; legacy fallback hydration and MCP metadata surfaces depended on ad hoc adapter logic that became brittle once payload shapes were made explicit. Updates repository metadata/tag protocols and write paths to use shared JSON document/value contracts. Introduces typed provider analytics rows and consumes them through archive operations instead of untyped row dicts. Replaces awaitable probing in retrieval readiness with direct `ActionEventArtifactState` consumption. Adds `lib/session_payload_documents.py` and rewires session profile, work event, and thread runtime/storage helpers to share those document contracts. Localizes compatibility work in the legacy mapper and MCP metadata wrapper so stricter runtime payloads don't leak regressions into old rows or surface serialization. Verification: pytest over session-product, MCP tool-contract, and mapper-fallback suites; devtools verify green. Ref #263
…#268) Recent substrate renewal tightened JSON and session-product contracts, but the lib/storage runtime still had several weak seams: metadata/tag operations widened through loose dict/object shapes; provider analytics rows and action-readiness checks were not consistently using their typed runtime contracts; session profile, work event, and thread payloads duplicated near-identical dict schemas in multiple modules; legacy fallback hydration and MCP metadata surfaces depended on ad hoc adapter logic that became brittle once payload shapes were made explicit. Updates repository metadata/tag protocols and write paths to use shared JSON document/value contracts. Introduces typed provider analytics rows and consumes them through archive operations instead of untyped row dicts. Replaces awaitable probing in retrieval readiness with direct `ActionEventArtifactState` consumption. Adds `lib/session_payload_documents.py` and rewires session profile, work event, and thread runtime/storage helpers to share those document contracts. Localizes compatibility work in the legacy mapper and MCP metadata wrapper so stricter runtime payloads don't leak regressions into old rows or surface serialization. Verification: pytest over session-product, MCP tool-contract, and mapper-fallback suites; devtools verify green. Ref #263
|
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. |
Ref #263
Summary
Problem
Recent substrate renewal tightened JSON and session-product contracts, but the lib/storage runtime still had several weak seams:
Solution
ActionEventArtifactStateconsumptionpolylogue/lib/session_payload_documents.pyand rewired session profile, work event, and thread runtime/storage helpers to share those document contractsVerification
devtools verifypytest -q tests/unit/storage/test_session_product_refresh.py tests/unit/storage/test_product_materialization_laws.py tests/unit/mcp/test_tool_contracts.py -k 'thread or profile or work_event or phase or enrichment'pytest -q tests/unit/storage/test_session_product_mapper_fallbacks.py tests/unit/storage/test_session_product_refresh.py tests/unit/mcp/test_tool_contracts.py -k 'metadata or timeline or work_event or session_profile_record_falls_back'