Repository navigation
refactor(archive): move query semantics out of lib - #636
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 (66)
📝 WalkthroughWalkthroughThis pull request relocates query-related functionality from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 43 minutes and 12 seconds.Comment |
Polylogue Proof PackRefs: Affected Domains
Required Gates
Known Gaps
Oracle / Cost
|
There was a problem hiding this comment.
Pull request overview
Moves archive query semantics out of the generic polylogue.lib bucket into an explicit archive-domain package (polylogue.archive.query) and updates all repository references (imports, tests, devtools topology metadata, and docs) accordingly.
Changes:
- Relocated the query planner/runtime implementation from
polylogue.lib.querytopolylogue.archive.query. - Updated runtime consumers (CLI, MCP, operations, storage filter builder) and unit tests to use the new import paths.
- Updated topology/status rendering and mutation/topology metadata to treat
archive-queryas an explicit placement/ownership domain.
Reviewed changes
Copilot reviewed 61 out of 65 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/pipeline/test_tail_overlay_runtime.py | Updates query spec import to the new archive query package. |
| tests/unit/mcp/test_tool_contracts.py | Updates MCP tool contract tests to import query spec + miss diagnostics from archive query. |
| tests/unit/devtools/test_render_topology_status.py | Adjusts topology dashboard expectations for the new archive-query owner and archive paths. |
| tests/unit/core/test_repo_filter.py | Updates query spec import for filter-builder unit coverage. |
| tests/unit/core/test_query_retrieval_candidates.py | Updates retrieval candidate imports to polylogue.archive.query.*. |
| tests/unit/core/test_query_fields.py | Updates query field/plan/spec imports to the new archive query modules. |
| tests/unit/core/test_cwd_prefix_filter.py | Updates query spec import for cwd-prefix filter tests. |
| tests/unit/cli/test_query_support_runtime.py | Updates CLI query tests to use archive query spec. |
| tests/unit/cli/test_query_progress_runtime.py | Updates query progress tests to use archive query spec. |
| tests/unit/cli/test_query_exec_laws.py | Updates property/law tests to import spec + miss diagnostics from archive query. |
| tests/unit/cli/test_query_exec.py | Updates inline imports in CLI execution tests to the new archive query spec/errors. |
| tests/unit/cli/test_diagnostics.py | Updates diagnostics CLI tests to use archive query spec. |
| tests/unit/cli/test_bulk_export.py | Updates bulk export tests to use archive query spec. |
| tests/unit/archive/test_query_search_runtime.py | Migrates archive query search runtime tests to the new archive query modules + patch targets. |
| tests/unit/archive/test_query_runtime_matching.py | Updates runtime matching tests and patch targets to polylogue.archive.query.*. |
| tests/unit/archive/test_query_runtime_filters.py | Updates runtime filters tests and patch targets to polylogue.archive.query.*. |
| tests/unit/archive/test_query_miss_diagnostics.py | Updates miss diagnostics tests and patch target to polylogue.archive.query.*. |
| tests/unit/architecture/test_topology_invariants.py | Updates topology invariants to assert query lives under polylogue/archive/query. |
| polylogue/storage/backends/queries/filter_builder.py | Switches storage-side helper import to archive.query.fields. |
| polylogue/operations/specs.py | Updates operation code references to point at polylogue.archive.query.plan_execution. |
| polylogue/operations/archive.py | Updates archive operations to use polylogue.archive.query (spec/search hits/miss diagnostics). |
| polylogue/mcp/query_contracts.py | Updates MCP query contracts to import query spec from archive query. |
| polylogue/mcp/payloads.py | Updates TYPE_CHECKING imports for query miss diagnostics types to archive query. |
| polylogue/lib/search_hits.py | Retargets the summary conversion helper import to polylogue.archive.query.support. |
| polylogue/lib/filter/filters.py | Repoints filter adapter plumbing to the new archive query plan/fields/execution APIs. |
| polylogue/lib/filter/builder.py | Updates TYPE_CHECKING plan import to polylogue.archive.query.plan. |
| polylogue/cli/shared/product_command_contracts.py | Updates query parsing helpers import (QuerySpecError/date parsing) to archive query spec. |
| polylogue/cli/root_request.py | Updates root request query spec import to archive query. |
| polylogue/cli/query_stats.py | Updates TYPE_CHECKING query spec import to archive query. |
| polylogue/cli/query_semantic.py | Updates TYPE_CHECKING query spec import to archive query. |
| polylogue/cli/query_progress.py | Updates query progress dependencies (uses_action_read_model/spec) to archive query. |
| polylogue/cli/query_output.py | Updates TYPE_CHECKING query imports (spec/miss diagnostics) to archive query. |
| polylogue/cli/query_feedback.py | Updates TYPE_CHECKING query imports (spec/miss diagnostics) to archive query. |
| polylogue/cli/query_contracts.py | Updates CLI query contracts to import query spec from archive query. |
| polylogue/cli/query_actions.py | Updates TYPE_CHECKING query spec import to archive query. |
| polylogue/cli/query.py | Updates CLI query runtime to import QuerySpecError / miss diagnostics / search hits from archive query. |
| polylogue/cli/commands/diagnostics.py | Updates diagnostics command to import query spec from archive query. |
| polylogue/cli/click_option_groups.py | Updates CLI option groups to import query constants from archive query spec. |
| polylogue/artifacts/init.py | Updates artifact metadata code refs to the new archive query plan execution module. |
| polylogue/archive/query/support.py | Adds shared query support helpers in the new archive query package. |
| polylogue/archive/query/spec.py | Updates spec module to depend on archive query plan/fields (post-move wiring). |
| polylogue/archive/query/sorting.py | Adds sorting/finalization helpers in the new archive query package. |
| polylogue/archive/query/search_hits.py | Updates search-hits planning helpers to import from archive query submodules. |
| polylogue/archive/query/runtime_plan.py | Updates runtime plan utilities to import field predicates from archive query. |
| polylogue/archive/query/runtime_matching.py | Updates runtime matching module TYPE_CHECKING plan import to archive query. |
| polylogue/archive/query/runtime_filters.py | Updates runtime filter implementation to use archive query matching/support + TYPE_CHECKING plan import. |
| polylogue/archive/query/runtime.py | Updates runtime entrypoint imports to archive query runtime/filter/matching/plan modules. |
| polylogue/archive/query/retrieval_search.py | Updates retrieval search implementation imports to archive query and adjusts TYPE_CHECKING plan import. |
| polylogue/archive/query/retrieval_candidates.py | Updates candidate retrieval module imports to archive query support/search. |
| polylogue/archive/query/retrieval.py | Updates retrieval orchestrator imports to archive query retrieval modules. |
| polylogue/archive/query/plan_execution.py | Updates plan execution to use archive query plan/retrieval/support. |
| polylogue/archive/query/plan_description.py | Updates plan description to use archive query fields. |
| polylogue/archive/query/plan.py | Updates core plan module to import from archive query modules and rewire execution helpers. |
| polylogue/archive/query/miss_diagnostics.py | Updates miss diagnostics dependencies to archive query retrieval/spec. |
| polylogue/archive/query/fields.py | Adds canonical query-field descriptor registry + helpers in archive query package. |
| polylogue/archive/query/init.py | Establishes the new archive query package boundary. |
| polylogue/archive/init.py | Adds archive-domain package marker module/docstring. |
| docs/topology-status.md | Updates generated topology status for the new archive-query owner and file counts. |
| docs/test-quality-workflows.md | Updates mutation workflow docs to reference polylogue/archive/query/plan.py. |
| docs/plans/topology-target.yaml | Updates topology projection to assign archive query modules to archive-query and remove lib/query entries. |
| devtools/verify_cluster_cohesion.py | Updates cluster naming example/help to match archive/query cluster. |
| devtools/render_topology_status.py | Renames topology owner title from lib-query to archive-query. |
| devtools/mutation_scenario_catalog.py | Updates mutation scenario paths to target polylogue/archive/query/plan.py. |
| devtools/command_catalog.py | Updates verify-cluster-cohesion example usage to --cluster archive/query. |
| devtools/build_topology_projection.py | Updates topology classification rules to assign polylogue/archive/query/ to archive-query and map query_* to archive/query/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| # polylogue/lib/ subpackage rules — prefix → subpackage | ||
| # Archive-domain subpackage rules — prefix → subpackage |
Problem: the query planner/runtime package is archive-domain semantics, but it lived under polylogue.lib, which hides ownership and keeps the old library-bucket vocabulary alive.\n\nWhat changed: move polylogue.lib.query to polylogue.archive.query, update imports, move the query unit tests under tests/unit/archive, and regenerate topology/test-quality docs so the control plane records archive-query as an owned placement domain.\n\nVerification:\n- pytest -q tests/unit/archive/test_query_*.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_retrieval_candidates.py tests/unit/core/test_cwd_prefix_filter.py tests/unit/cli/test_query_exec.py tests/unit/cli/test_query_exec_laws.py tests/unit/devtools/test_render_topology_status.py tests/unit/architecture/test_topology_invariants.py\n- devtools verify-topology\n- devtools render-all --check\n\nRef #634\nRef #635
eac44a9 to
be62ebb
Compare
## Summary Moves the archive query planning/runtime package from `polylogue.lib.query` to `polylogue.archive.query` and updates all imports, tests, topology metadata, and generated documentation references. ## Problem The query planner, runtime filters, retrieval helpers, miss diagnostics, and query spec are archive-domain semantics. Keeping them under `polylogue.lib` preserves the old library-bucket vocabulary and makes the archive/core split in #634/#635 harder to execute cleanly. ## Solution - Moved `polylogue/lib/query/` to `polylogue/archive/query/`. - Moved query-specific unit tests from `tests/unit/lib/` to `tests/unit/archive/`. - Updated CLI, MCP, operations, storage filter builder, artifacts/proof metadata, and tests to import from the archive package. - Updated topology generation/status and mutation campaign metadata so the control plane records `archive-query` as an explicit placement domain. ## Verification - `pytest -q tests/unit/archive/test_query_*.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_retrieval_candidates.py tests/unit/core/test_cwd_prefix_filter.py tests/unit/cli/test_query_exec.py tests/unit/cli/test_query_exec_laws.py tests/unit/devtools/test_render_topology_status.py tests/unit/architecture/test_topology_invariants.py` → 208 passed - `devtools verify-topology` → realized=697 declared=697 blocking=False - `devtools render-all --check` → sync OK - push hook `devtools verify --quick` → all checks passed Ref #634 Ref #635 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Refactor** * Reorganized internal query module architecture for improved domain separation and maintainability. * **Documentation** * Updated topology status dashboard and mutation scenario documentation to reflect architectural changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Moves the archive query planning/runtime package from
polylogue.lib.querytopolylogue.archive.queryand updates all imports, tests, topology metadata, and generated documentation references.Problem
The query planner, runtime filters, retrieval helpers, miss diagnostics, and query spec are archive-domain semantics. Keeping them under
polylogue.libpreserves the old library-bucket vocabulary and makes the archive/core split in #634/#635 harder to execute cleanly.Solution
polylogue/lib/query/topolylogue/archive/query/.tests/unit/lib/totests/unit/archive/.archive-queryas an explicit placement domain.Verification
pytest -q tests/unit/archive/test_query_*.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_retrieval_candidates.py tests/unit/core/test_cwd_prefix_filter.py tests/unit/cli/test_query_exec.py tests/unit/cli/test_query_exec_laws.py tests/unit/devtools/test_render_topology_status.py tests/unit/architecture/test_topology_invariants.py→ 208 passeddevtools verify-topology→ realized=697 declared=697 blocking=Falsedevtools render-all --check→ sync OKdevtools verify --quick→ all checks passedRef #634
Ref #635
Summary by CodeRabbit
Release Notes
Refactor
Documentation