Repository navigation
test: cover schema and query semantic helpers - #383
Conversation
Problem: #193 had become stale as a package-level coverage ticket. The remaining weak spots were specific semantic helpers in lib and schema pinning, and they were not exercised directly. What changed: - add focused coverage diagnostics tests for provider ranges, gaps, and truncation accounting - add search hit tests for query term normalization, snippet anchoring, and lane-to-surface mapping - add query runtime matching tests for path, action, tool, sequence, and action-text matching - add schema pinning tests for invalid decisions, pin-set round trips, resolved paths, and confirmed/rejected annotation application Ref #193
Problem: #193 raised the repository-wide coverage floor, but the default coverage gate still had two Hypothesis-based source laws that could fail from generation speed or deadline pressure under full instrumentation. What changed: - raise the coverage fail-under threshold from 84 to 85 - disable the deadline on bundle-cardinality source laws where generated provider payloads are intentionally large under coverage tracing - suppress slow-generation health checks for conversations-wrapper streaming laws to match the sibling stream contracts Ref #193 Ref #197
|
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 (6)
📝 WalkthroughWalkthroughThis PR adds focused unit tests for semantic contracts in schema pinning, coverage diagnostics, query runtime matching, and search-hit utilities, alongside a coverage enforcement threshold increase from 84 to 85 and minor Hypothesis configuration adjustments. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels
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. Comment |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary Close the stale #193 package-coverage gap by adding direct semantic tests for the remaining weak helpers in `polylogue/lib` and `polylogue/schemas`, then ratchet the repository-wide coverage floor from 84% to 85% with a default coverage gate that still passes under full instrumentation. ## Problem Issue #193 started as a broad package-coverage ticket, but the package-level baseline had already moved. The real remaining gap was narrower: several semantic helpers in `polylogue.lib.coverage`, `polylogue.lib.search_hits`, `polylogue.lib.query_runtime_matching`, and `polylogue.schemas.pinning` were still lightly exercised, and the repo-level coverage ratchet needed proof that the full default gate could sustain a higher floor without flaking on Hypothesis-generated source laws. Closes #193 Ref #197 ## Solution - add focused tests for coverage diagnostics, search-hit construction, query runtime action/path/tool matching, and schema pin confirmation/rejection behavior - ratchet `[tool.coverage.report].fail_under` from 84 to 85 in `pyproject.toml` - stabilize the two source-law tests that failed only under coverage instrumentation by disabling the deadline for generated provider bundle cardinality checks and suppressing slow-generation health checks for the conversations-wrapper stream law - keep the history explicit with one commit for semantic coverage additions and one commit for the ratchet/stability slice ## Verification - `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 passed` - `pytest -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 passed` - `devtools coverage-gate --ignore-integration` - `5188 passed`, total coverage `85.21%` - `devtools coverage-gate` - `5368 passed`, total coverage `86.02%` - `devtools verify --quick` - passed locally and again in the pre-push hook
Summary
Close the stale #193 package-coverage gap by adding direct semantic tests for the remaining weak helpers in
polylogue/libandpolylogue/schemas, then ratchet the repository-wide coverage floor from 84% to 85% with a default coverage gate that still passes under full instrumentation.Problem
Issue #193 started as a broad package-coverage ticket, but the package-level baseline had already moved. The real remaining gap was narrower: several semantic helpers in
polylogue.lib.coverage,polylogue.lib.search_hits,polylogue.lib.query_runtime_matching, andpolylogue.schemas.pinningwere still lightly exercised, and the repo-level coverage ratchet needed proof that the full default gate could sustain a higher floor without flaking on Hypothesis-generated source laws.Closes #193
Ref #197
Solution
[tool.coverage.report].fail_underfrom 84 to 85 inpyproject.tomlVerification
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.py13 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_contract5 passeddevtools coverage-gate --ignore-integration5188 passed, total coverage85.21%devtools coverage-gate5368 passed, total coverage86.02%devtools verify --quickSummary by CodeRabbit
Tests
Chores