You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: unify query semantics under field descriptors #321
The low-churn audit in #315 found that query semantics are still expressed through several parallel models: polylogue/lib/query_spec.py, polylogue/lib/query_plan.py, polylogue/lib/filter_builder.py, polylogue/storage/search_query_builders.py, polylogue/storage/backends/queries/filter_builder.py, CLI contracts, and MCP-facing parameter plumbing.
This is no longer type debt; it is semantic duplication. The same field inventory is manually restated for normalization, presence checks, human descriptions, storage pushdown, and surface metadata.
Scope
Introduce a query field descriptor/catalog layer that can own shared query field facts and drive the existing query surfaces without changing user-facing behavior.
Candidate responsibilities:
field normalization and defaults
filter-presence detection
human-readable query descriptions
storage pushdown eligibility and SQL parameter mapping
CLI/MCP/facade surface metadata where practical
Acceptance criteria
The descriptor catalog replaces at least one duplicated field inventory across spec, plan, filter, and storage layers.
Existing CLI, MCP, and facade behavior remains compatible unless a correctness bug is explicitly found.
Query tests cover descriptor-driven behavior instead of only snapshotting final output.
Added polylogue/lib/query_fields.py as the shared descriptor catalog for query field facts.
Replaced duplicated field inventories in query spec descriptions/presence, query plan descriptions/presence, plan-to-record-query mapping, SQL pushdown params, runtime capability predicates, search-hit blockers, and storage stats-join detection.
Added tests/unit/core/test_query_fields.py for descriptor-driven spec/plan descriptions, active field names, pushdown params, record-query tuple/list shape, and stats-join metadata.
Local verification:
focused ruff/mypy on touched files and descriptor tests;
Activity
Sinity commentedon Apr 22, 2026
Starting #321 on
feature/refactor/query-field-descriptors.Working scope:
devtools verifybefore PR.Scratch log:
.agent/scratch/321-query-field-descriptors.md.Sinity commentedon Apr 22, 2026
Implementation for #321 is up in PR #363: #363
What changed:
polylogue/lib/query_fields.pyas the shared descriptor catalog for query field facts.tests/unit/core/test_query_fields.pyfor descriptor-driven spec/plan descriptions, active field names, pushdown params, record-query tuple/list shape, and stats-join metadata.Local verification:
175 passed,119 passed);mypy polylogue/ tests/unit/core/test_query_fields.py;devtools render-all --check;devtools verify(all checks passed);devtools verify --quick(all checks passed).Scratch log:
.agent/scratch/321-query-field-descriptors.md.refactor: add query field descriptor catalog (#363)
chore: delete one orphan re-export shim
chore: delete one orphan re-export shim (#452)
refactor: add query field descriptor catalog (#363)
chore: delete one orphan re-export shim (#452)