Repository navigation
test: ratchet coverage floor to 86 - #384
Conversation
Problem The next #197 coverage ratchet needed real semantic coverage over the query/runtime helpers and schema operator paths rather than broad but shallow line inflation. What changed Add focused unit tests for payload coercion, query runtime filtering, search retrieval helpers, schema extraction and operator workflows, runtime registry helpers, archive stats, session summaries, authored payload helpers, and projection/message collection contracts. Compatibility No production behavior changes. This is test-only coverage expansion. Ref #197
Problem #197 needed the next coverage floor increase, but the full gate still had noisy failure modes in property and integration checks that made the ratchet unreliable. What changed Suppress Hypothesis too-slow health checks on the slow semantic law suites, relax the open --print-path integration assertions to allow the expected progress stderr, and raise coverage fail_under from 85 to 86. Verification This commit is justified by a full coverage-gate pass at 86.77% after these hardening changes. Ref #197
Problem The quick verification baseline failed in strict mypy because tests/unit/devtools/test_render_cli_reference.py imports write_if_changed through devtools.render_cli_reference, but that module did not declare the symbol in its explicit export surface. What changed Add an __all__ declaration for the CLI reference renderer module so its tested helpers are part of the public module contract. Compatibility No behavior change; this only makes the existing module surface explicit. 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 (17)
📝 WalkthroughWalkthroughThis pull request adds extensive unit test coverage across multiple modules (core, lib, scenarios, sources) to validate existing functionality, increments the coverage threshold from 85 to 86 in pyproject.toml, updates Hypothesis health check configurations in property-based tests, and adds an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
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. Bravo. ℹ️ 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 Raise the coverage floor from 85 to 86 with a semantic coverage tranche over query/runtime/schema helpers, plus the gate hardening needed to make that ratchet reliable. ## Problem Ref #197 tracks the staged push toward a materially higher repository coverage floor. The next step could not be an arbitrary percentage bump: it needed meaningful tests over under-covered semantic helpers and a stable full coverage lane. The branch also surfaced a strict-mypy export defect in `devtools.render_cli_reference` while running the required quick baseline. ## Solution - add focused unit coverage for payload coercion, query runtime filtering and retrieval helpers, schema extraction and operator workflows, runtime registry helpers, archive stats, session summaries, authored payload helpers, and projection/message collection contracts - harden the slow semantic/property suites for coverage execution and relax the `open --print-path` integration assertions to accept the expected optional progress stderr - raise `[tool.coverage.report].fail_under` from 85 to 86 after the full gate measured 86.77% - make `devtools.render_cli_reference` explicitly export its tested helper surface so `devtools verify --quick` stays green ## Verification - `mypy --strict tests/unit/core/test_session_summaries.py tests/unit/core/test_operator_inference.py tests/unit/lib/test_query_search_runtime.py tests/unit/lib/test_query_runtime_filters.py tests/unit/core/test_conversation_semantics.py tests/unit/core/test_models.py` - `pytest -q tests/unit/core/test_conversation_semantics.py::TestConversationProjectionContracts::test_projection_transform_and_terminal_helpers_cover_empty_and_render_paths` - `pytest -q tests/unit/core/test_session_summaries.py::test_summarize_day_aggregates_cost_duration_words_and_repos` - `devtools coverage-gate` - `5411 passed in 257.11s (0:04:17)` - `Required test coverage of 86% reached. Total coverage: 86.77%` - `devtools verify --quick` Ref #197
Summary
Raise the coverage floor from 85 to 86 with a semantic coverage tranche over query/runtime/schema helpers, plus the gate hardening needed to make that ratchet reliable.
Problem
Ref #197 tracks the staged push toward a materially higher repository coverage floor. The next step could not be an arbitrary percentage bump: it needed meaningful tests over under-covered semantic helpers and a stable full coverage lane. The branch also surfaced a strict-mypy export defect in
devtools.render_cli_referencewhile running the required quick baseline.Solution
open --print-pathintegration assertions to accept the expected optional progress stderr[tool.coverage.report].fail_underfrom 85 to 86 after the full gate measured 86.77%devtools.render_cli_referenceexplicitly export its tested helper surface sodevtools verify --quickstays greenVerification
mypy --strict tests/unit/core/test_session_summaries.py tests/unit/core/test_operator_inference.py tests/unit/lib/test_query_search_runtime.py tests/unit/lib/test_query_runtime_filters.py tests/unit/core/test_conversation_semantics.py tests/unit/core/test_models.pypytest -q tests/unit/core/test_conversation_semantics.py::TestConversationProjectionContracts::test_projection_transform_and_terminal_helpers_cover_empty_and_render_pathspytest -q tests/unit/core/test_session_summaries.py::test_summarize_day_aggregates_cost_duration_words_and_reposdevtools coverage-gate5411 passed in 257.11s (0:04:17)Required test coverage of 86% reached. Total coverage: 86.77%devtools verify --quickRef #197
Summary by CodeRabbit
Tests
Chores