Skip to content

test: ratchet coverage floor to 90 - #389

Merged
Sinity merged 1 commit into
masterfrom
feature/test/coverage-ratchet-high-floor
Apr 23, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/test/coverage-ratchet-high-floor

Conversation

@Sinity

@Sinity Sinity commented Apr 23, 2026 •

Copy link
Copy Markdown
Owner

Summary
Raise the committed coverage floor from 89 to 90 after direct owning-module tests over the remaining run/proof/operator control surfaces, plus targeted hardening for two suite-load Hypothesis health-check flakes.

Problem
#197 was still open with the floor committed at 89 even though the remaining active-path debt had narrowed into branch-heavy helpers in run orchestration, proof diff/rendering, and operator commands. The full coverage gate could also trip on isolated Hypothesis HealthCheck.too_slow failures under suite load, which made the last ratchet unstable even when the invariants themselves held.

Solution
Add direct runtime tests for cli.machine_main, cli.check_rendering_plain, cli.commands.products, cli.commands.run, proof.diffing, proof.rendering, pipeline.prepare, pipeline.observers, pipeline.run_stages, and pipeline.run_state. Harden the two property laws that flaked under full-suite instrumentation by applying the same HealthCheck.too_slow suppression policy already used elsewhere in the repo. With the measured gate now stable at 90.14, ratchet pyproject.toml to fail_under = 90.

Verification

  • pytest -q tests/unit/cli/test_check_rendering_plain_runtime.py tests/unit/cli/test_machine_main_runtime.py tests/unit/cli/test_products_command_runtime.py tests/unit/cli/test_run_command_runtime.py tests/unit/pipeline/test_prepare_runtime.py tests/unit/pipeline/test_run_stages_runtime.py tests/unit/pipeline/test_run_state_runtime.py tests/unit/pipeline/test_observers_runtime.py tests/unit/proof/test_diffing_runtime.py tests/unit/proof/test_rendering_runtime.py -> 60 passed in 12.42s
  • pytest -q tests/unit/storage/test_fts5.py::test_escape_fts5_match_text_safe tests/unit/sources/test_unified_semantic_laws.py::test_typed_content_blocks_extract_without_crash -> 2 passed in 10.27s
  • devtools coverage-gate -> 5643 passed in 289.45s, Total coverage: 90.14%
  • devtools verify --quick -> passed

Closes #197

Summary by CodeRabbit

  • Tests

    • Added comprehensive test suites for CLI commands, pipeline orchestration, and proof rendering functionality.
  • Chores

    • Increased code coverage reporting threshold from 89% to 90%.

Problem
The repository was still committed at an 89% coverage floor, while the
remaining active-path debt sat in branch-heavy run, proof, and operator
helpers. The full coverage gate also still carried suite-load Hypothesis
health-check flakes that could fail even when the underlying invariants
held.

What changed
Add direct runtime tests for the remaining command and pipeline control
surfaces: machine main, plain check rendering, products export/status,
run command dispatch, proof diff/rendering, and pipeline prepare,
observers, run stages, and run state. Stabilize the two property-law
suite-load flakes with the same HealthCheck.too_slow policy already used
elsewhere in the suite, then ratchet the committed coverage floor to 90.

Compatibility
No product behavior changed. This is a test-only ratchet plus property
law hardening.

Ref #197
@coderabbitai

coderabbitai Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2a476839-36f0-4865-9f85-f0e2dd7fe51f

📥 Commits

Reviewing files that changed from the base of the PR and between 2badf03 and 1a7a370.

📒 Files selected for processing (13)
  • pyproject.toml
  • tests/unit/cli/test_check_rendering_plain_runtime.py
  • tests/unit/cli/test_machine_main_runtime.py
  • tests/unit/cli/test_products_command_runtime.py
  • tests/unit/cli/test_run_command_runtime.py
  • tests/unit/pipeline/test_observers_runtime.py
  • tests/unit/pipeline/test_prepare_runtime.py
  • tests/unit/pipeline/test_run_stages_runtime.py
  • tests/unit/pipeline/test_run_state_runtime.py
  • tests/unit/proof/test_diffing_runtime.py
  • tests/unit/proof/test_rendering_runtime.py
  • tests/unit/sources/test_unified_semantic_laws.py
  • tests/unit/storage/test_fts5.py

📝 Walkthrough

Walkthrough

This pull request adds comprehensive test coverage across CLI command handlers, pipeline orchestration, and proof verification subsystems. It increases the coverage floor threshold from 89% to 90% in pyproject.toml and introduces 10 new test modules (plus minor configuration adjustments to 2 existing tests) totaling ~2,150 lines of test code targeting previously uncovered execution paths in run/pipeline, proof/rendering, and operator command surfaces.

Changes

Cohort / File(s) Summary
Configuration
pyproject.toml
Raises [tool.coverage.report].fail_under from 89 to 90 to enforce stricter coverage threshold.
CLI Command Runtime Tests
tests/unit/cli/test_check_rendering_plain_runtime.py, test_machine_main_runtime.py, test_products_command_runtime.py, test_run_command_runtime.py
Comprehensive tests for CLI rendering (plain output, status icons), entry-point control flow (error normalization, exit codes), product command lifecycle (context construction, callbacks, validation), and run command stages (option resolution, watch mode, embed routing).
Pipeline Orchestration Runtime Tests
tests/unit/pipeline/test_observers_runtime.py, test_prepare_runtime.py, test_run_stages_runtime.py, test_run_state_runtime.py
Tests for observer patterns (composite/notification/webhook/exec), bundle preparation (save/persist workflows), stage execution (schema/materialization/render/index/site/embed), and execution state finalization (count aggregation, drift tracking).
Proof Verification Runtime Tests
tests/unit/proof/test_diffing_runtime.py, test_rendering_runtime.py
Validates diff/reporting logic (path normalization, affected obligation routing, gate rendering) and markdown catalog rendering with schema/provider/scenario subjects and trust metadata.
Hypothesis Configuration Tuning
tests/unit/sources/test_unified_semantic_laws.py, tests/unit/storage/test_fts5.py
Configures property-based tests to run 40 examples and suppress too_slow health checks.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

type:test, area:cli, area:pipeline, area:qa

Poem

🐰 A rabbit hops through test-lit halls,
where coverage climbs and logic calls.
Ninety percent! The floor's been raised—
nine-zero gates are now in place.
Direct paths tested, debt retired,
the proof is there—run, proof, inspired! 🎯

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/test/coverage-ratchet-high-floor

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit 3101c30 into master Apr 23, 2026
10 of 12 checks passed
@Sinity
Sinity deleted the feature/test/coverage-ratchet-high-floor branch April 23, 2026 17:55
@Sinity

Sinity commented May 1, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@Sinity
Sinity requested a review from Copilot May 1, 2026 01:54
@Sinity
Sinity removed the request for review from Copilot May 1, 2026 02:15
Sinity added a commit that referenced this pull request May 7, 2026
Summary
Raise the committed coverage floor from 89 to 90 after direct
owning-module tests over the remaining run/proof/operator control
surfaces, plus targeted hardening for two suite-load Hypothesis
health-check flakes.

Problem
#197 was still open with the floor committed at 89 even though the
remaining active-path debt had narrowed into branch-heavy helpers in run
orchestration, proof diff/rendering, and operator commands. The full
coverage gate could also trip on isolated Hypothesis
`HealthCheck.too_slow` failures under suite load, which made the last
ratchet unstable even when the invariants themselves held.

Solution
Add direct runtime tests for `cli.machine_main`,
`cli.check_rendering_plain`, `cli.commands.products`,
`cli.commands.run`, `proof.diffing`, `proof.rendering`,
`pipeline.prepare`, `pipeline.observers`, `pipeline.run_stages`, and
`pipeline.run_state`. Harden the two property laws that flaked under
full-suite instrumentation by applying the same `HealthCheck.too_slow`
suppression policy already used elsewhere in the repo. With the measured
gate now stable at 90.14, ratchet `pyproject.toml` to `fail_under = 90`.

Verification
- `pytest -q tests/unit/cli/test_check_rendering_plain_runtime.py
tests/unit/cli/test_machine_main_runtime.py
tests/unit/cli/test_products_command_runtime.py
tests/unit/cli/test_run_command_runtime.py
tests/unit/pipeline/test_prepare_runtime.py
tests/unit/pipeline/test_run_stages_runtime.py
tests/unit/pipeline/test_run_state_runtime.py
tests/unit/pipeline/test_observers_runtime.py
tests/unit/proof/test_diffing_runtime.py
tests/unit/proof/test_rendering_runtime.py` -> `60 passed in 12.42s`
- `pytest -q
tests/unit/storage/test_fts5.py::test_escape_fts5_match_text_safe
tests/unit/sources/test_unified_semantic_laws.py::test_typed_content_blocks_extract_without_crash`
-> `2 passed in 10.27s`
- `devtools coverage-gate` -> `5643 passed in 289.45s`, `Total coverage:
90.14%`
- `devtools verify --quick` -> passed

Closes #197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore: restore test coverage floor toward 90%

1 participant