Repository navigation
refactor(archive): move stats and coverage out of lib - #666
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ 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 (16)
✨ 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. Review rate limit: 0/1 reviews remaining, refill in 46 minutes and 5 seconds.Comment |
Polylogue Proof PackRefs: Affected Domains
Required Gates
Known Gaps
Oracle / Cost
|
There was a problem hiding this comment.
Pull request overview
Refactors archive-domain diagnostics by relocating statistics and coverage utilities out of polylogue.lib into polylogue.archive, tightening the intended “lib as facade/primitive surface” boundary while updating topology metadata and unit tests accordingly.
Changes:
- Moved archive diagnostics modules to
polylogue.archive(stats.py,coverage.py) and updated all internal imports (MCP, operations, protocols, repository, TUI). - Relocated direct unit tests for these modules into the archive test bucket.
- Updated topology projection inputs/status so these modules are no longer treated as
lib-rootprimitives.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/mcp/test_tool_contracts.py | Update ArchiveStats import to polylogue.archive.stats. |
| tests/unit/mcp/test_server_surfaces.py | Update ArchiveStats import to polylogue.archive.stats. |
| tests/unit/archive/test_query_miss_diagnostics.py | Update ArchiveStats import to polylogue.archive.stats. |
| tests/unit/archive/test_coverage_diagnostics.py | Update analyze_coverage import to polylogue.archive.coverage. |
| tests/unit/archive/test_archive_stats.py | Update ArchiveStats import to polylogue.archive.stats. |
| polylogue/ui/tui/screens/dashboard.py | Update ArchiveStats import to polylogue.archive.stats. |
| polylogue/storage/repository/vectors/repository_vectors.py | Update ArchiveStats imports/types to polylogue.archive.stats. |
| polylogue/protocols.py | Update TYPE_CHECKING ArchiveStats import to polylogue.archive.stats. |
| polylogue/operations/archive.py | Update TYPE_CHECKING ArchiveStats alias import to polylogue.archive.stats. |
| polylogue/mcp/server_product_tools.py | Update analyze_coverage import to polylogue.archive.coverage. |
| polylogue/mcp/payloads.py | Update TYPE_CHECKING ArchiveStats import to polylogue.archive.stats. |
| polylogue/archive/stats.py | New home for ArchiveStats dataclass and serialization helpers. |
| polylogue/archive/coverage.py | New home for coverage diagnostics; adjusts type-only import to archive conversation models. |
| docs/topology-status.md | Refresh topology counts after reclassification/moves. |
| docs/plans/topology-target.yaml | Reclassify moved files under polylogue/archive/* and remove lib/* entries. |
| devtools/build_topology_projection.py | Stop classifying stats.py/coverage.py as lib-root primitives. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
## Summary Move archive statistics and coverage diagnostics from `polylogue.lib` into `polylogue.archive`, and move their direct unit tests into the archive test bucket. ## Problem `coverage.py` and `stats.py` describe archive-domain diagnostics and value payloads, but they still lived in the generic `lib` root. That kept the remaining `lib` surface broader than its intended primitive/facade role. ## Solution - Rename `polylogue/lib/coverage.py` to `polylogue/archive/coverage.py`. - Rename `polylogue/lib/stats.py` to `polylogue/archive/stats.py`. - Update MCP, operations, protocol, repository, TUI, and test imports. - Update topology generation so these files are no longer classified as `lib-root` primitives. - Move direct coverage/stat tests under `tests/unit/archive/`. Ref #635 ## Verification - `devtools build-topology-projection && devtools verify-topology` — realized=697 declared=697 blocking=False - `ruff check polylogue/ tests/ devtools/` — all checks passed - `mypy polylogue/` — no issues found in 697 source files - `pytest -q tests/unit/archive/test_coverage_diagnostics.py tests/unit/archive/test_archive_stats.py tests/unit/archive/test_query_miss_diagnostics.py tests/unit/mcp/test_tool_contracts.py tests/unit/mcp/test_server_surfaces.py tests/unit/core/test_facade_api.py` — 147 passed - `devtools render-all --check` — sync OK - pre-push `devtools verify --quick` — all checks passed
Summary
Move archive statistics and coverage diagnostics from
polylogue.libintopolylogue.archive, and move their direct unit tests into the archive test bucket.Problem
coverage.pyandstats.pydescribe archive-domain diagnostics and value payloads, but they still lived in the genericlibroot. That kept the remaininglibsurface broader than its intended primitive/facade role.Solution
polylogue/lib/coverage.pytopolylogue/archive/coverage.py.polylogue/lib/stats.pytopolylogue/archive/stats.py.lib-rootprimitives.tests/unit/archive/.Ref #635
Verification
devtools build-topology-projection && devtools verify-topology— realized=697 declared=697 blocking=Falseruff check polylogue/ tests/ devtools/— all checks passedmypy polylogue/— no issues found in 697 source filespytest -q tests/unit/archive/test_coverage_diagnostics.py tests/unit/archive/test_archive_stats.py tests/unit/archive/test_query_miss_diagnostics.py tests/unit/mcp/test_tool_contracts.py tests/unit/mcp/test_server_surfaces.py tests/unit/core/test_facade_api.py— 147 passeddevtools render-all --check— sync OKdevtools verify --quick— all checks passed