Repository navigation
Closed
Labels
Description
Context
This issue originally captured a large coverage gap in polylogue/schemas/
and polylogue/lib/. That baseline is now stale: after the intervening
schema, query, proof, and coverage-gate work, a 2026-04-23 package-focused
coverage report shows the combined polylogue/schemas/* and
polylogue/lib/* surface at roughly 86% coverage, already above the
original package-level ≥60% target.
The remaining risk is no longer "near-zero package coverage". It is that
some high-leverage semantic helpers still lack focused behavioral tests or
have only incidental coverage:
polylogue/lib/coverage.py— archive coverage diagnostics, currently
uncovered despite being readiness-facing.polylogue/lib/search_hits.py— evidence-bearing search-hit helpers used
by CLI/MCP/archive surfaces.polylogue/lib/query_runtime_matching.py— action/path/tool/text matching
semantics for immutable query plans.polylogue/schemas/pinning.py— human-reviewed schema annotation pinning
and rejection semantics.- Lower-covered schema outliers such as
pinning.py,extraction.py, and
operator_inference.pyshould be treated as behavior-contract targets,
not line-count targets.
Strengthened execution scope
Make this issue a semantic coverage slice, not a raw line-coverage chase:
- add focused tests around readiness diagnostics, search evidence, action-aware
query matching, and schema pinning/rejection behavior; - prefer tests that assert cross-surface payload shape or semantic decisions
over tests that simply import large modules; - use the new
devtools coverage-gatefrom test: add single-source coverage gate #382 as the ratchet evidence; - raise the global coverage floor from 84% to 85% only after the behavioral
tests justify it; - close this issue when the schema/lib query slice has durable tests and the
85% floor passes, leaving the broader 90% journey to chore: restore test coverage floor toward 90% #197.
Approach
Prioritize by product risk and mutation-kill value:
- Archive coverage diagnostics: empty archives, provider ranges, date gaps,
message totals, and truncated-session heuristic. - Search-hit evidence: query-term normalization, deterministic snippets,
retrieval-lane surfaces, and message-count-preserving hit updates. - Query runtime matching: action/path/tool/text filters including
none
semantics and exclusion behavior. - Schema pinning: invalid pins reject bad roles/actions, confirmed pins mark
schema nodes, rejected pins suppress annotations and evidence across nested
schema paths. - Coverage ratchet: run
devtools coverage-gateand raise
tool.coverage.report.fail_underto 85 only if the gate passes.
Acceptance criteria
- Focused tests cover the semantic contracts above in
polylogue/lib/and
polylogue/schemas/. devtools coverage-gatepasses with the committed coverage floor at 85%.devtools verify --quickpasses.- This issue closes with the 85% ratchet; chore: restore test coverage floor toward 90% #197 remains open for the remaining
87/89/90% increments.
Activity
Sinity commentedon Apr 23, 2026
Scratch log, 2026-04-23:
polylogue/schemas/*+polylogue/lib/*at roughly 86%, so the original near-zero/≥60 framing is outdated.lib/coverage.py), search evidence (lib/search_hits.py), query runtime matching (lib/query_runtime_matching.py), and schema annotation pinning (schemas/pinning.py), followed by a floor ratchet from 84% to 85% ifdevtools coverage-gatepasses.Sinity commentedon Apr 23, 2026
Execution log for the #193 ratchet slice.
What landed on the branch:
polylogue.lib.coverage,polylogue.lib.search_hits,polylogue.lib.query_runtime_matching, andpolylogue.schemas.pinningbundle_cardinality_contractdeadline disabled,conversations_wrapper_round_trips_documentsslow-generation health check suppressed)Verification on
feature/test/schema-lib-query-coverage:pytest -q tests/unit/lib/test_coverage_diagnostics.py tests/unit/lib/test_search_hits.py tests/unit/lib/test_query_runtime_matching.py tests/unit/core/test_schema_pinning.py->13 passedpytest -q tests/unit/sources/test_source_laws.py::test_iter_json_stream_conversations_wrapper_round_trips_documents tests/unit/sources/test_source_laws.py::test_parse_payload_bundle_cardinality_contract->5 passeddevtools coverage-gate --ignore-integration->5188 passed, total coverage85.21%devtools coverage-gate->5368 passed, total coverage86.02%devtools verify --quick-> passed locally and again on pre-pushOpening PR next. This closes the stale package-coverage gap for #193 and advances #197 by proving the 85% floor is supportable under the default gate.
test: cover schema and query semantic helpers (#383)
Sinity commentedon Apr 23, 2026
Merged via #383. The repo-wide coverage floor is now 85%, the default
devtools coverage-gatepasses at 86.02% total coverage, and the issue is closed with direct semantic tests over the remaininglib/schemasweak spots. #197 remains the broader ratchet track toward 90%.test: cover schema and query semantic helpers (#383)