Skip to content

Dead code / coverage sweep — 2026-06-03

Internal-optimisation theme for the next version. First step: verify the codebase has no unexercised dead code by running a line-coverage sweep and inspecting every file below 80%.

Added COVERAGE=1 instrumentation to spec/spec_helper.rb using Ruby’s built-in Coverage module (no extra gem; native extensions already in the Flake). Running COVERAGE=1 bundle exec rspec inside the Nix shell produces coverage_report.txt sorted by ascending coverage ratio.

Full suite: 5 376 examples, 0 failures at the time of the sweep.

FileCoverageVerdict
rigor/mcp/loop.rb38.1%Test gap — no spec existed
rigor/plugin/box.rb52.9%Environment-gated (RUBY_BOX=1, ADR-39)
rigor/testing.rb66.7%Test gapRigor.dump_type / assert_type convenience aliases uncovered
rigor/cli.rb72.5%Subcommand paths exercised via integration; residual gaps are I/O error branches
rigor/inference/precision_scanner.rb74.2%Test gapFileResult helpers and Union/Intersection/Difference classification branches
rigor/plugin/isolation.rb75.0%Environment-gated (ruby_box strategy needs RUBY_BOX=1); fork-based paths covered by existing spec
rigor/plugin/io_boundary.rb77.2%Intentional boundaryDefaultHttpClient uses real Net::HTTP; tests inject a fake client
rigor/mcp/server.rb77.6%Test gaprigor_triage and rigor_coverage tool calls untested
rigor/language_server/server.rb79.3%LSP paths exercised via runner; residual = error-path branches

None.

Every low-coverage file had an identifiable, non-dead reason: environment-gated feature flag, intentional I/O boundary, or a test that simply had not been written yet.

New / updated specWhat it covers
spec/rigor/mcp/loop_spec.rb (new)Normal dispatch, JSON-parse-error recovery, blank-line skip, notification (nil → no write), multi-request sequence
spec/rigor/testing_spec.rb (new)Rigor::Testing.dump_type / assert_type, and the Rigor.dump_type / Rigor.assert_type delegate aliases
spec/rigor/inference/precision_scanner_spec.rb (extended)FileResult ratio helpers (edge cases incl. zero-total), dynamic_count, Union/Intersection classification
spec/rigor/mcp/server_spec.rb (extended)rigor_triage round-trip, rigor_coverage round-trip, --top= and --params= argv threading

Suite after: 5 402 examples, 0 failures.

© 2026 TypedDuck. Licensed under CC BY-SA 4.0.