Repository navigation
fix(query): cover API facade names in descriptors - #698
Conversation
Problem: #621 requires public query/read names to be owned by descriptors across CLI, MCP, API, and storage. MCP names were covered, but API facade names like search(source=...) still mapped to query concepts implicitly.\n\nWhat changed: add API-facing query names to QueryFieldDescriptor, expose api_query_field_names(), and assert the facade query/read method signatures are covered by query and read descriptors.\n\nVerification: pytest tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py -q; ruff format --check polylogue/archive/query/fields.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py; ruff check polylogue/archive/query/fields.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py
|
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 (3)
📝 WalkthroughWalkthroughThe PR extends ChangesAPI Field Coverage Validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Polylogue Proof PackRefs: Affected Domains
Focused Gates
Required PR Gates
Optional Confidence Gates
Known Gaps
Oracle / Cost
|
There was a problem hiding this comment.
Pull request overview
This PR extends the query descriptor registry to explicitly own API-facing query parameter names (in addition to existing MCP names) and adds drift-guard tests that ensure the public Python facade’s query/read method signatures stay fully covered by the query/read descriptor catalogs (Ref #621).
Changes:
- Add
api_namestoQueryFieldDescriptorplusapi_query_field_names()for API name inventory. - Record API aliases for key facade query params (
query,provider/source,since,limit) in the query descriptor catalog. - Add unit tests that introspect
PolylogueArchiveMixinmethod signatures and assert all public parameters are covered by query/read descriptors.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
polylogue/archive/query/fields.py |
Adds API-name ownership to query descriptors and exposes api_query_field_names() for drift-guarding. |
tests/unit/core/test_query_fields.py |
Adds coverage test ensuring search() / list_conversations() facade params are owned by query/read descriptor vocabularies. |
tests/unit/core/test_query_read_fields.py |
Adds coverage test ensuring point-read facade method params are owned by read descriptors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for method_name in method_names: | ||
| params = set(signature(getattr(PolylogueArchiveMixin, method_name)).parameters) | ||
| params.discard("self") | ||
| assert params - covered == set() |
| for method_name in method_names: | ||
| params = set(signature(getattr(PolylogueArchiveMixin, method_name)).parameters) | ||
| params.discard("self") | ||
| assert params - covered == set() |
## Summary Adds API-facing query-name ownership to the query descriptor registry and tests the public facade query/read signatures against the query/read descriptor catalogs. ## Problem #621 is about making one descriptor vocabulary own the public query/read surface. MCP query names were already covered, but the Python facade still had implicit mappings like `search(source=...)` selecting providers without any descriptor-level ownership. That leaves API names outside the drift guard even though they are part of the public surface. ## Solution - Added `api_names` to `QueryFieldDescriptor` and exposed `api_query_field_names()`. - Recorded API names for the facade search/list query concepts: `query`, provider aliases `provider`/`source`, `since`, and query `limit`. - Added tests that inspect `PolylogueArchiveMixin.search()` and `list_conversations()` and require every public parameter to be covered by query or read descriptors. - Added tests that inspect point-read facade methods (`get_conversation`, `get_conversations`, `get_messages_paginated`, `get_raw_artifacts_for_conversation`, and `resume_brief`) and require every read parameter to be covered by read descriptors. Ref #621 ## Verification - `pytest tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py -q` → 12 passed. - `ruff format --check polylogue/archive/query/fields.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py` → 3 files already formatted. - `ruff check polylogue/archive/query/fields.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py` → all checks passed. - `devtools verify --quick` → all checks passed. - Pre-push `devtools verify --quick` → all checks passed.
Summary
Adds API-facing query-name ownership to the query descriptor registry and tests the public facade query/read signatures against the query/read descriptor catalogs.
Problem
#621 is about making one descriptor vocabulary own the public query/read surface. MCP query names were already covered, but the Python facade still had implicit mappings like
search(source=...)selecting providers without any descriptor-level ownership. That leaves API names outside the drift guard even though they are part of the public surface.Solution
api_namestoQueryFieldDescriptorand exposedapi_query_field_names().query, provider aliasesprovider/source,since, and querylimit.PolylogueArchiveMixin.search()andlist_conversations()and require every public parameter to be covered by query or read descriptors.get_conversation,get_conversations,get_messages_paginated,get_raw_artifacts_for_conversation, andresume_brief) and require every read parameter to be covered by read descriptors.Ref #621
Verification
pytest tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py -q→ 12 passed.ruff format --check polylogue/archive/query/fields.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py→ 3 files already formatted.ruff check polylogue/archive/query/fields.py tests/unit/core/test_query_fields.py tests/unit/core/test_query_read_fields.py→ all checks passed.devtools verify --quick→ all checks passed.devtools verify --quick→ all checks passed.Summary by CodeRabbit