Skip to content
CAI
Software that uses CAICheck a score

danmayer/coverband

61.4

Adequate · 19 September 2026

7.1k

lines of production code

Ruby

with JavaScript

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby code coverage and usage tracking library that monitors line-level execution alongside runtime activity such as view rendering, route hits, and SQL query patterns. It provides a modular storage architecture supporting Redis, file systems, and various ActiveSupport cache backends to persist and merge coverage data reliably. The tool also features an optional MCP server that exposes coverage metrics and dead code analysis to AI assistants, enabling automated code quality insights.

How it got here

2013–2018 — Version 7.0.0 architecture overhaul

15 changes.

This period centered on the major release of Coverband 7.0.0, which introduced a breaking change to the storage format and a comprehensive architectural refactor. The work established a modular system with new abstract trackers for granular usage data, standardized adapters for diverse storage backends, and a unified reporting base class. Additionally, it expanded the web UI with dark mode support and new views for monitoring dead code, routes, and SQL performance.

2019 — MCP integration and storage refactoring

12 changes.

This period focused on introducing an optional MCP server for AI-assisted code analysis and refactoring the storage layer with a new document-based model to improve concurrency. Significant effort was also dedicated to adding comprehensive test coverage for the new storage adapters, collectors, and Lua-based Redis persistence scripts.

2022–2026 — MCP integration and storage refactoring

12 changes.

This period focused on integrating Model Context Protocol (MCP) support to enable AI assistant interaction with coverage data, alongside a comprehensive refactoring of the storage and tracker layers. The work introduced new MCP tools and HTTP endpoints while restructuring the backend to improve resilience, fix stale write issues, and enforce stricter generation protocols. Extensive test coverage was added for both the new AI features and the underlying storage architecture changes.

Features

Add MCP HTTP endpoint with Streamable transport and authentication

Coverband now exposes a Model Context Protocol (MCP) endpoint at /mcp, enabling AI assistants to integrate with coverage data via a StreamableHTTPTransport. This new Rack middleware supports GET, POST, DELETE, and OPTIONS methods for full protocol compliance, including CORS preflight handling. Access can be secured by configuring an MCP password, which requires clients to provide a Bearer token in the Authorization header; if no password is set, access is allowed. The handler can be mounted standalone or wrapped around the existing Coverband web UI.

lib/coverband/mcp · high confidence

Automated Lua 5.1 environment setup for CI

A new installation script (lua/install.sh) has been added to configure a Lua 5.1 runtime environment. The script uses hererocks to install Lua 5.1 and activates the environment, then automatically installs key development dependencies including busted, redis-lua, inspect, and lua-cjson via luarocks. This change supports the automation of Lua-based testing and execution in the CI pipeline.

lua · high confidence

Coverband 7.0.0 introduces MCP server integration and storage health diagnostics

Coverband has been updated to version 7.0.0, introducing a new optional Model Context Protocol (MCP) server for AI assistant integration, controlled via the \mcp\_enabled\ configuration flag and restricted to allowed environments. The release also adds a \StorageHealth\ module to expose structured diagnostics on coverage stores and trackers, reporting status, data loss, and unwritten deltas. Additionally, the \AtExit\ handler has been refactored to use a mutex for thread-safe registration and ensures view and translation reports are saved on exit when \report\_on\_exit\ is enabled.

lib/coverband · high confidence

Introduces new utility classes and rake tasks for file conversion, dead code detection, and reporting

This change adds several new utility components to the Coverband codebase. It introduces \AbsoluteFileConverter\ and \RelativeFileConverter\ to handle path normalization and caching for coverage data, and a \FileHasher\ for file integrity checks. A new \DeadMethods\ utility and associated rake tasks (\coverband:dead\_methods\, \coverband:scan\_all\) allow users to identify and report unused code. The update also adds a \ConfigurationTemplate\ for easier setup, a \Rails6Ext\ to backport routing redirect events, and a \JRubyExt\ to support JRuby environments. Additionally, it includes new rake tasks for generating static HTML and JSON coverage reports (\coverband:coverage\_html\, \coverband:coverage\_json\), an MCP server task for AI assistant integration, and an \install\ task to scaffold configuration files.

lib/coverband/utils · high confidence

New Lua script for persisting coverage data to Redis

A new Lua script, persist-coverage.lua, has been added to the library to handle the persistence of code coverage data. This script decodes a JSON payload containing file metadata and coverage lines, then writes this information into Redis hashes. It specifically manages first-updated timestamps using HSETNX to preserve initial values, increments line coverage counts via HINCRBY, and records the last posting time for lines with positive coverage. The script also applies an expiration TTL to the resulting hashes if provided in the payload.

lua/lib · high confidence

New MCP server, storage architecture, and dead code detection

Coverband now includes an optional MCP server (lib/coverband/mcp/server.rb) that exposes coverage data, dead code analysis, and storage health to AI assistants via HTTP or stdio. The storage layer has been refactored with a new document-based model (lib/coverband/storage/document.rb, generation.rb, session.rb, writer.rb) to improve concurrency and data integrity. A new dead method detection utility (lib/coverband/utils/method\_definition\_scanner.rb) allows identifying unused code. Additionally, a generic ActiveSupport::Cache adapter (lib/coverband/adapters/active\_support\_cache\_store.rb) is now available, with the previous MemcachedStore deprecated in favor of it.

coverband · high confidence

New MCP tools for coverage, dead code, and runtime tracking

This change introduces a suite of new Model Context Protocol (MCP) tools in the \lib/coverband/mcp/tools\ directory, enabling AI assistants to query Coverband's production data. The new tools include \GetCoverageSummary\ for overall statistics, \GetFileCoverage\ for detailed line-by-line file data, and \GetDeadMethods\ to identify unexecuted methods. Additionally, it adds trackers for runtime usage: \GetRouteTrackerData\, \GetViewTrackerData\, and \GetTranslationTrackerData\ expose which Rails routes, views, and I18n keys have been hit or remain unused. A \GetUncoveredFiles\ tool helps locate files below a specific coverage threshold, and \GetStorageHealth\ exposes the state of the underlying storage protocol.

lib/coverband/mcp/tools · high confidence

New abstract tracker architecture and dedicated usage trackers for views, routes, translations, and SQL bursts

The collector layer has been refactored around a new \AbstractTracker\ base class that standardizes how usage data is tracked, stored, and reported. This change introduces several new, dedicated trackers: \ViewTracker\ (now supporting ViewComponent and Haml/Slim), \RouteTracker\ (tracking controller actions and redirects), \TranslationTracker\ (monitoring I18n key usage), and \QueryBurstTracker\ (aggregating SQL query counts and execution times per action/job). These trackers replace the previous monolithic or less structured approaches, providing more granular insights into unused views, unvisited routes, unused translation keys, and inefficient SQL patterns. The \Coverage\ collector remains for line-level coverage but is now decoupled from these usage-specific tracking concerns, allowing each tracker to manage its own storage and reporting lifecycle independently.

lib/coverband/collectors · high confidence

New background reporting and Resque/Sidekiq Swarm integrations

This change introduces a new background reporting mechanism that runs a dedicated thread to periodically save coverage data, configurable via \background\_reporting\_enabled\ and \background\_reporting\_sleep\_seconds\, with a new \BackgroundMiddleware\ to trigger it. It also adds specific integrations for Resque (capturing coverage on fork and job completion) and Sidekiq Swarm (starting coverage on fork), ensuring runtime coverage is captured correctly in these worker environments.

lib/coverband/integrations · high confidence

New coverage storage adapters and base infrastructure

The library introduces a new \Base\ adapter class that standardizes coverage merging, file hashing, and report expansion logic. It adds \ActiveSupportCacheStore\ to support generic caching backends (Redis, Memcached, Solid Cache, Postgres, MySQL, SQLite) via a single adapter, alongside dedicated \FileStore\ for local disk persistence and \HashRedisStore\ for optimized Redis storage using hashes and Lua scripts. A \NullStore\ and \StdoutStore\ are added for benchmarking and development, while \RedisCleanup\ provides a shared maintenance interface for removing legacy or orphaned keys from Redis. \SessionCoverage\ is introduced as a shared module for adapters that store data in single documents per type, handling delta recording and retry safety.

lib/coverband/adapters · high confidence

New web UI views for tracking views, routes, and query bursts

The web interface now includes dedicated views for tracking unused and used views, routes, and query bursts, allowing users to monitor runtime activity beyond standard code coverage. The new 'abstract\_tracker' view displays lists of unused and used keys (such as views or routes) with sorting options and, where applicable, detailed statistics like request counts and SQL metrics. The navigation bar has been updated to include links to these new trackers (Views, Routes, Query Bursts, Translations) when enabled in configuration. Additionally, the settings page now displays the store size in bytes and MiB, and the source file view distinguishes between load-time and runtime coverage metrics.

views · high confidence

Optional MCP server for AI assistant integration

A new executable script (bin/coverband-mcp) has been added to allow Coverband to act as an MCP server for AI assistants. This feature is disabled by default for security; users must explicitly enable it via the \mcp\_enabled\ configuration option and can optionally set a password (\mcp\_password\) and restrict access to specific environments (\mcp\_allowed\_environments\). The script validates these settings at startup, displaying a security status summary before launching the server with stdio transport.

bin · high confidence

Behavioural changes

Coverband 7.0.0 introduces breaking storage format changes and new cache adapter

This release upgrades the gem to version 7.0.0, introducing significant breaking changes to the storage format for both Redis and cache adapters, which means stored coverage data will not survive the upgrade and must be accumulated fresh. A new \ActiveSupportCacheStore\ adapter is added, allowing coverage storage in any ActiveSupport cache backend (including Solid Cache for Postgres/MySQL/SQLite), while the \MemcachedStore\ is deprecated in favor of this new adapter. The release also drops support for older Ruby and Rails versions, removes deprecated configuration options like S3 settings and gem tracking, and replaces the generation lifecycle mixin with a new coordinator system. Additionally, the web report now features a dark theme that follows the operating system's color scheme preference.

(repo-wide) · high confidence

Introduce new tracker storage architecture with Redis hash and document repositories

The tracker storage layer has been refactored to use a new adapter structure consisting of a base abstract class, a DocumentRepository for general cache-backed storage, and a RedisHashRepository for native Redis hash operations on presence trackers. This change introduces a Factory to select the appropriate repository based on merge semantics (idempotent vs additive) and backend type, aiming to fix issues with stale writes, orphan cleanup, and silent failures by enforcing a stricter generation protocol and explicit ownership of unstored work.

_lib/coverband/adapters/tracker\storage · high confidence

Introduces alternative patch mechanism and refactors core configuration

The library now supports an alternative patching strategy via the new \lib/alternative\_coverband\_patch.rb\ file, which sets the \COVERBAND\_ALTERNATE\_PATCH\ flag, allowing users to opt into a different instrumentation method. The core \lib/coverband.rb\ has been significantly refactored to simplify configuration by removing the strict requirement for a configuration file, instead falling back to defaults or a service-specific config if present. This change also introduces new public methods for managing coverage reporting cycles, including \prefetch\_report\_pointers!\ and \discard\_pending!\ to optimize storage interactions, and \track\_key\ to allow explicit tracking of keys by registered trackers. Additionally, the main file now requires a comprehensive set of new storage, adapter, tracker, and reporter components, indicating a structural shift towards a more modular and extensible architecture.

lib · high confidence

Refactored report generation with a new Base class and dedicated reporters

The report generation logic has been restructured to use a new \Coverband::Reporters::Base\ class that centralizes data fetching, path normalization, and merging. Specific reporters (\ConsoleReport\, \HTMLReport\, \JSONReport\) now inherit from this base, ensuring consistent handling of coverage data across the command line and web interfaces. The \JSONReport\ now supports an optional \line\_coverage\ parameter to include detailed line-by-line data in the JSON output, and the \Web\ reporter routes requests to these new reporters while maintaining existing endpoints for settings, debug data, and file details.

lib/coverband/reporters · high confidence

Refactored storage layer with generation coordination and resilience improvements

The storage backend has been restructured to introduce a GenerationCoordinator that manages key lifecycle and synchronization, replacing previous ad-hoc pointer handling with a structured protocol. This change includes a new GenerationChange event system to explicitly track state transitions (such as initialization, confirmation, and eviction) rather than relying on implicit state checks. Resilience is improved via a ReadFallback module that degrades reads gracefully when the cache is unavailable, preventing crashes during report rendering, and an IOGuard module that correctly scopes storage I/O to avoid interfering with application-level query tracking. Additionally, a unified RedisTarget implementation standardizes cache interactions, ensuring consistent behavior across different storage backends and fixing issues related to key freezing and stale pointer reads.

lib/coverband/storage · high confidence

Web report UI modernized with CSS variables and dead-code review session

The web report's styling has been refactored to use CSS custom properties (e.g., --cb-link, --cb-page-bg) for all colors, enabling easier theme management and dark mode support. A new 'dead-code review session' feature is introduced, allowing users to mark files for deletion, hide specific paths, and export marked items to CSV. The JavaScript logic for this session is extracted into a pure module (dead\_code\_session.js) for better testability. Additionally, the report now includes a loading UI and improved AJAX handling for large file lists, while jQuery is updated to version 1.6.2.

public · high confidence

Test coverage

Added Rails 7 dummy application for test coverage; Added Rails 8 dummy application for testing; Added basic Rack application test fixture; Added benchmarking suite for performance and memory profiling; Added comprehensive test coverage for all storage adapters; Added forked full-stack tests for Rails coverage, views, and routes; Added integration tests for background reporting and middleware; Added integration tests for deferred eager loading and MCP features; Added test coverage for Coverband reporters and web interface; Added test coverage for Coverband utility components; Added test coverage for MCP HTTP handler, security, and server components; Added test coverage for MCP tools; Added test coverage for collectors and registry components; Added test fixtures for code scanning and coverage analysis; Added test infrastructure for unique file handling and Rails integration; Added test suite for persist-coverage Lua script; Added tests for Coverband configuration, storage health, and tracker registration; Added tests for Coverband memory leak benchmark checks; Added tests for storage generation coordination, I/O guarding, and merge protocol conformance; Added unit tests for the dead code session logic module.

Dependencies

Updated Ruby version requirement and dependency configuration

The gem now requires Ruby 3.1 or later, dropping support for older versions. The Gemfile has been updated to explicitly include development dependencies such as rails, haml, slim, and webrick, while also pinning connection\_pool to version 2.5 to ensure compatibility with ActiveSupport 8.1's MemCacheStore. Additionally, the gemspec now lists base64 as a runtime dependency and includes various development tools like standard, rubocop, and minitest, reflecting a shift in the project's testing and linting infrastructure.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 61.

Lenses

  • Code Health 93
  • Architecture 88
  • Maturity 75
  • Readiness 74
  • Security 90
  • Accessibility 42

Changes since last survey

  • 300 commits — 243 feature/other, 57 fixes

By area

  • lib/coverband — 89 commits
  • (repo) — 85 commits
  • (root) — 54 commits
  • test/coverband — 23 commits
  • .github/workflows — 17 commits
  • public/application.css — 7 commits
  • test/benchmarks — 5 commits
  • test/forked — 5 commits
  • lib/coverband.rb — 3 commits
  • coverband/log.272267 — 2 commits
  • docs/active_support_cache_adapter_plan.md — 2 commits
  • public/application.js — 2 commits
  • test/rails7_dummy — 2 commits
  • public/dead_code_session.js — 1 commit
  • test/integration — 1 commit
  • test/rails8_dummy — 1 commit
  • views/abstract_tracker.erb — 1 commit

Notable commits

  • fix: Add generic ActiveSupport::Cache adapter and fix the merge conflict
  • fix: Fix CI failure by replacing Redis action with service container
  • fix: Fix MCP test issues
  • fix: Fix Rack 1.6 compatibility in web reporter
  • fix: Fix array_add to avoid map!.with_index issues in Ruby 3.1-3.3
  • fix: Fix concrete_target glob to match packwerk pack directories
  • fix: Fix coverband:coverage_server rake task not being compatible with Rack 3 / Rackup
  • fix: Fix prefetch staleness, unsafe orphan cleanup, and silent failures
  • fix: Fix protocol gaps found in review
  • fix: Fix remaining protocol gaps from review
  • fix: Fix ruby-head memory check and the Solid Cache CI step
  • fix: Fix search to include full filenames hidden by truncation
  • fix: Fix unterminated quote in the workflow solid cache condition
  • fix: Fix unused views report
  • fix: Fix views tracker sort rendering in abstract tracker
  • fix: Fix: use empty string in Rack::Static urls instead of incorrect usage
  • fix: Merge pull request #560 from fatkodima/fix-unused-views
  • fix: Merge pull request #564 from fatkodima/fix-clear-tasks
  • fix: Merge pull request #570 from Tapjoy/fix/rack3
  • fix: Merge pull request #606 from danmayer/fix-inefficient-short-name-regexp-12930959518074750901
  • …and 280 more

Architecture

  • 0 containers · 1 bounded contexts · 0 dependency edges (baseline)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

danmayer/coverband was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 485c37d4e0330e91adde069b60c9d30c4f46f938 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-13a154b7f5d1.