danmayer/coverband
Ruby production code coverage collection and reporting (line of code usage)
Healthy across the board
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 4d ago
- ✓7 active contributors
- ✓MIT licensed
Show 3 more →Show less
- ✓CI configured
- ✓Tests present
- ⚠Concentrated ownership — top contributor handles 55% of recent commits
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/danmayer/coverband)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/danmayer/coverband on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: danmayer/coverband
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/danmayer/coverband shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across the board
- Last commit 4d ago
- 7 active contributors
- MIT licensed
- CI configured
- Tests present
- ⚠ Concentrated ownership — top contributor handles 55% of recent commits
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live danmayer/coverband
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/danmayer/coverband.
What it runs against: a local clone of danmayer/coverband — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in danmayer/coverband | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch main exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 34 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of danmayer/coverband. If you don't
# have one yet, run these first:
#
# git clone https://github.com/danmayer/coverband.git
# cd coverband
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of danmayer/coverband and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "danmayer/coverband(\\.git)?\\b" \\
&& ok "origin remote is danmayer/coverband" \\
|| miss "origin remote is not danmayer/coverband (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift — was MIT at generation time"
# 3. Default branch
git rev-parse --verify main >/dev/null 2>&1 \\
&& ok "default branch main exists" \\
|| miss "default branch main no longer exists"
# 4. Critical files exist
test -f "lib/coverband.rb" \\
&& ok "lib/coverband.rb" \\
|| miss "missing critical file: lib/coverband.rb"
test -f "lib/coverband/configuration.rb" \\
&& ok "lib/coverband/configuration.rb" \\
|| miss "missing critical file: lib/coverband/configuration.rb"
test -f "lib/coverband/collectors/coverage.rb" \\
&& ok "lib/coverband/collectors/coverage.rb" \\
|| miss "missing critical file: lib/coverband/collectors/coverage.rb"
test -f "lib/coverband/adapters/base.rb" \\
&& ok "lib/coverband/adapters/base.rb" \\
|| miss "missing critical file: lib/coverband/adapters/base.rb"
test -f "lib/coverband/reporters/web.rb" \\
&& ok "lib/coverband/reporters/web.rb" \\
|| miss "missing critical file: lib/coverband/reporters/web.rb"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 34 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~4d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/danmayer/coverband"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Coverband is a Ruby gem that measures production code usage by instrumenting line-of-code execution counters at runtime, without requiring test suites. It collects coverage data in Redis and reports via a mountable web UI, distinguishing between code loaded at boot (Rails eager load) and code executed during requests, allowing teams to identify dead code and optimize deployments. Adapter-based architecture: lib/coverband/adapters/ contains pluggable storage backends (RedisStore, FileStore, MemcachedStore, NullStore, HashRedisStore) allowing flexibility in data persistence. Core instrumentation lives in lib/coverband.rb; web UI code inferred in lib/coverband/ directories. Multiple Gemfile variants (Gemfile.rails7.0 through Gemfile.rails8.0) indicate version-specific test matrices.
👥Who it's for
Ruby on Rails developers and DevOps engineers who need visibility into which code paths are actually executed in production to identify unused features, optimize bundle sizes, and guide refactoring—particularly useful for teams managing large legacy Rails applications.
🌱Maturity & risk
Actively maintained and production-ready: the repo has CI/CD workflows (GitHub Actions in .github/workflows/main.yml), multiple Gemfile variants for Rails 7.0–8.0, strong test presence implied by SimpleCov comparison in README, and recent work on Rails 8.0 support. The project is well-documented with Discord community (badge in README) and follows Ruby conventions (.rubocop.yml, .standard.yml).
Low risk but has single-maintainer dependency (danmayer): no visible team in file structure. The gem depends on Redis being available (required; checked in order: COVERBAND_REDIS_URL → REDIS_URL → localhost:6379), and requires integration with Rack/Rails. No breaking change warnings visible, but multiple Rails versions are actively supported suggesting careful backward compatibility work.
Active areas of work
Active Rails version support expansion: Gemfiles for Rails 7.0, 7.1, 7.2, and 8.0 suggest recent work on compatibility. Agents.md and bin/coverband-mcp hint at new MCP (Model Context Protocol) integration. CI workflow (diagram.yml, main.yml) suggests automated testing and possibly visualization generation.
🚀Get running
git clone https://github.com/danmayer/coverband.git && cd coverband && bundle install && bundle exec rake test
Daily commands: bundle exec rake (inferred from Rakefile presence); web UI likely mounted via config.ru (Rack config file present); see README for Coverband.start calls in config/coverband.rb
🗺️Map of the codebase
lib/coverband.rb— Main entry point and configuration loader; initializes all coverage collection and reporting infrastructure.lib/coverband/configuration.rb— Core configuration system that defines all adapters, collectors, and runtime behavior; every integration depends on this.lib/coverband/collectors/coverage.rb— Primary coverage collection engine using Ruby's Coverage module; the heart of line-of-code instrumentation.lib/coverband/adapters/base.rb— Abstract base class for all data persistence backends (Redis, Memcached, files); defines the contract for storing coverage data.lib/coverband/reporters/web.rb— Web UI server and dashboard rendering; primary user interface for viewing coverage reports and metrics.lib/coverband/utils/source_file.rb— Source file parsing and line-level coverage analysis; translates raw coverage data into meaningful reports.lib/coverband/mcp/server.rb— Model Context Protocol server for AI integration; enables programmatic access to coverage data and analysis tools.
🛠️How to make changes
Add a New Tracker (Route, View, Translation, etc.)
- Create a new tracker class inheriting from
AbstractTrackerinlib/coverband/collectors/(lib/coverband/collectors/abstract_tracker.rb) - Implement
trackmethod to intercept and record executions of your target (routes, views, etc.) (lib/coverband/collectors/your_new_tracker.rb) - Register the tracker in the configuration system (
lib/coverband/configuration.rb) - Add an MCP tool if exposing via AI interface, following the pattern in
get_route_tracker_data.rb(lib/coverband/mcp/tools/get_your_tracker_data.rb)
Add a New Data Storage Adapter
- Create a new adapter class inheriting from
Baseinlib/coverband/adapters/(lib/coverband/adapters/base.rb) - Implement required methods:
clear,save,coverage,raw, anddelete_file(lib/coverband/adapters/your_new_store.rb) - Register the adapter in configuration so users can select it via
config.store(lib/coverband/configuration.rb) - Test coverage persistence with the adapter's specific client (Redis, S3, etc.) (
test/your_adapter_test.rb)
Add a New Reporter Format or Output Channel
- Create a reporter class inheriting from
Baseinlib/coverband/reporters/(lib/coverband/reporters/base.rb) - Implement the
reportmethod to format and output coverage data (lib/coverband/reporters/your_format_report.rb) - Register the reporter in the web UI routes or CLI task system (
lib/coverband/reporters/web.rb) - Use
SourceFileandResultutilities to access parsed coverage metadata (lib/coverband/utils/source_file.rb)
Add a New AI Tool via Model Context Protocol
- Create a new tool class in
lib/coverband/mcp/tools/following the pattern of existing tools (lib/coverband/mcp/tools/get_coverage_summary.rb) - Implement
name,description,input_schema, andexecutemethods (lib/coverband/mcp/tools/your_new_tool.rb) - Register the tool in the MCP server so it's discoverable by AI agents (
lib/coverband/mcp/server.rb) - Query coverage adapters and utilities (e.g.,
Coverband.configuration.store) to fetch data (lib/coverband/configuration.rb)
🔧Why these technologies
- Ruby Coverage module — Built-in, zero-dependency instrumentation of line execution; no external agent/APM overhead
- Redis (primary adapter) — Distributed, fast, supports atomic operations for concurrent coverage updates across multiple app instances
- Rack middleware + Railtie — Standard Ruby/Rails integration points; works transparently without code changes in user apps
- Model Context Protocol (MCP) — Standardized interface for AI agents to query and analyze coverage; enables LLM-driven code optimization workflows
⚖️Trade-offs already made
-
Line-level coverage vs. statement/branch coverage
- Why: Line-level is simpler to compute and understand in production without heavy instrumentation
- Consequence: Less granular than branch coverage; cannot distinguish between all code paths on a single line
-
Async/batch persistence of coverage data
- Why: Reduces I/O load on production app and storage backend; delta tracking minimizes data transfer
- Consequence: Brief window of data loss if process crashes; not suitable for strict compliance recording
-
Multiple storage adapters (Redis, Memcached, file, web service)
- Why: Flexibility for different deployment models (containerized, serverless, on-premise)
- Consequence: Complexity in adapter interface; users must choose and maintain appropriate backend
-
Web UI as built-in Rack app vs. external service
- Why: Easy deployment and no separate infrastructure; can run on any Rails/Rack app
- Consequence: Adds dependencies and routes to production app; requires careful middleware ordering
🚫Non-goals (don't propose these)
- Real-time line coverage (sub-second latency); data is aggregated asynchronously
- Support for compiled languages or non-Ruby code; Ruby-only instrumentation
- Distributed tracing or flame graphs; focused solely on line execution counts
- PII redaction or encryption; does not handle sensitive data in coverage reports
- Code injection/patching of third-party gems; instruments only application code by default
- Performance profiling or memory analysis; coverage measurement, not performance optimization
🪤Traps & gotchas
Redis is required and auto-discovered via COVERBAND_REDIS_URL, REDIS_URL env vars, or localhost:6379 default—if Redis is unavailable, coverage collection silently fails unless NullStore is explicitly set. TLS Redis (rediss://) requires Redis gem to detect the scheme. Multiple Gemfile variants (rails7.0, rails7.1, rails7.2, rails8.0) mean local testing must specify bundle install --gemfile=Gemfile.rails8.0 to test against specific Rails versions. JRuby support indicated by .jrubyrc but may have threading/instrumentation quirks.
🏗️Architecture
💡Concepts to learn
- Rack Middleware — Coverband integrates as Rack middleware to hook request lifecycle and collect coverage data without modifying Rails controller code
- Line-of-Code Instrumentation / Tracing — Core to Coverband: executing a hook at every line execution to count usage; understanding Ruby's trace_point or equivalent is essential to modifying collection logic
- Adapter Pattern — Coverband's storage layer (Redis, Memcached, File, Hash) is pluggable via adapters; understanding this pattern is key to adding new backends
- Background Thread Reporting — Coverband reports coverage asynchronously to avoid blocking request handling; understanding thread-safe data structures and flush intervals is critical for performance tuning
- Redis Persistence & TTL — Coverband stores aggregated counters in Redis; understanding key expiration, hash structures, and atomic increments ensures correct metrics and efficient memory use
- Eager Load vs. Runtime Code Paths — Coverband splits metrics between Rails boot-time eager loading and request-time execution; understanding this distinction allows teams to identify boot-only code vs. truly unused code
- Production Code Coverage (vs. Test Coverage) — Inverse of SimpleCov: Coverband measures real production usage, not test execution; this inverts the typical coverage mindset and requires different thinking about code health
🔗Related repos
colszowka/simplecov— Ruby test code coverage standard; Coverband explicitly positions itself as complementary for production usage metrics vs. test suite coveragepresidentbeef/brakeman— Ruby security scanner; shares instrumentation and code-analysis patterns with Coverband for production code visibilityruby/ruby-build— Manages Ruby version installation; relevant for contributors testing Coverband against multiple Ruby versionsrails/rails— Coverband's primary target framework; maintains compatibility across Rails 7.0–8.0 via version-specific Gemfilesredis/redis-rb— Redis client library that Coverband depends on for data persistence; TLS support (rediss://) critical to production deployments
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive tests for all adapter implementations
The repo has 7 different storage adapters (Redis, Memcached, FileStore, HashRedisStore, WebServiceStore, StdoutStore, NullStore) in lib/coverband/adapters/ but there's no clear test coverage visible for each adapter's specific behavior. Each adapter has unique responsibilities and failure modes that need explicit test cases. This is critical for a production code coverage tool where data loss or corruption is unacceptable.
- [ ] Create spec/coverband/adapters/ directory structure matching lib/coverband/adapters/
- [ ] Write adapter contract tests that all adapters must pass (store/retrieve/clear operations)
- [ ] Add specific tests for redis_store.rb testing connection pooling and serialization
- [ ] Add tests for file_store.rb testing concurrent file access and corruption recovery
- [ ] Add integration tests for memcached_store.rb and web_service_store.rb with mocked services
Add integration tests for collector-to-adapter pipelines
The repo has multiple collectors (coverage.rb, view_tracker.rb, route_tracker.rb, query_burst_tracker.rb, translation_tracker.rb) that write to adapters, but there's no evidence of end-to-end integration tests. The delta.rb collector particularly needs testing to ensure coverage deltas are correctly computed and persisted without data loss across the full pipeline.
- [ ] Create spec/integration/ directory for pipeline tests
- [ ] Write tests for coverage collector -> adapter pipeline verifying line-level data integrity
- [ ] Add tests for view_tracker collector -> adapter verifying view data isn't lost during serialization
- [ ] Add tests for delta.rb ensuring incremental coverage updates merge correctly across multiple processes
- [ ] Test all collector-adapter combinations with background_middleware.rb and report_middleware.rb
Add documentation and examples for the MCP server (bin/coverband-mcp)
The repo has a Model Context Protocol server (bin/coverband-mcp) and security documentation (docs/mcp_security.md) but no usage guide or examples. With the growing use of MCPs in AI development, contributors need clear documentation on how to invoke, configure, and extend this server. This is referenced in agents.md but needs concrete examples.
- [ ] Create docs/mcp_server_guide.md documenting the MCP server's available tools and capabilities
- [ ] Add example usage section showing how to invoke coverband-mcp with different configurations
- [ ] Document the relationship between bin/coverband-mcp and the web UI (Coverband Web) in docs/
- [ ] Add troubleshooting section addressing common MCP server connection issues
- [ ] Reference the MCP guide from README.md's 'Newer Features' section and agents.md
🌿Good first issues
- Add integration test for rediss:// (TLS Redis) endpoint using LocalStack or test container; currently only redis:// is validated in examples
- Document the line-of-code instrumentation mechanism (trace_point hooks, bytecode patching, or monkey-patching approach) in docs/internal_formats.md; currently absent but critical for understanding performance overhead
- Implement adapter for Prometheus remote_write or OpenTelemetry exporter to ship coverage metrics to observability platforms alongside existing Redis-only storage
⭐Top contributors
Click to expand
Top contributors
- @danmayer — 55 commits
- @google-labs-jules[bot] — 36 commits
- @dkniffin — 2 commits
- @alpaca-tc — 2 commits
- @doug-hall — 2 commits
📝Recent commits
Click to expand
Recent commits
b19b4ea— Merge pull request #644 from danmayer/feature/query-burst-tracker-only (danmayer)174a1b1— improve documentation (danmayer)c7d40a3— Fix views tracker sort rendering in abstract tracker (danmayer)ae31845— Add query burst tracker for runtime SQL monitoring (danmayer)decf6a3— add support for sorted view files (danmayer)247ac6f— handle unexpected oneshot line format (danmayer)889cf79— release 6.2.1 (danmayer)3b21e0a— Merge pull request #624 from danmayer/jules-14708725504680530634-4d39c6aa (danmayer)f944bb9— Fix search to include full filenames hidden by truncation (danmayer)fa9cb3a— Document TLS Redis support in README (danmayer)
🔒Security observations
Coverband is a production monitoring gem with moderate security posture. Key concerns include potential command injection in the MCP server implementation, lack of visible authentication for web service adapters, and potential XSS vulnerabilities in web UI components. The application handles sensitive code coverage data that could expose application structure if improperly secured. No critical hardcoded secrets were identified in the file structure, but authentication and authorization controls should be strengthened, particularly for web endpoints and background job integrations. The codebase would benefit from
- Medium · Potential Command Injection in MCP Server —
lib/coverband/mcp/server.rb, lib/coverband/mcp/http_handler.rb. The file 'lib/coverband/mcp/server.rb' and 'lib/coverband/mcp/http_handler.rb' implement an MCP (Model Context Protocol) server that accepts external input. Without visible input validation in the file structure, there's a risk of command injection if user-supplied data is passed to system commands or shell operations. Fix: Implement strict input validation and sanitization for all MCP tool inputs. Avoid using shell operations with user input. Use parameterized/safe APIs for any system calls. - Medium · Web Service Store Without Visible Authentication —
lib/coverband/adapters/web_service_store.rb. The 'lib/coverband/adapters/web_service_store.rb' adapter communicates with external web services to store coverage data. Without visible authentication mechanisms in the file structure, sensitive coverage data could be transmitted insecurely. Fix: Implement TLS/HTTPS enforcement, add API key or token-based authentication, and validate SSL certificates. Ensure sensitive data is encrypted in transit and at rest. - Medium · Potential XSS in Web UI Components —
lib/coverband/reporters/web.rb, lib/coverband/reporters/html_report.rb. The web UI components ('lib/coverband/reporters/web.rb' and related HTML reporting) may render dynamic coverage data in HTML without proper escaping if the data source is user-controlled or external. Fix: Ensure all dynamic data is properly HTML-escaped. Use template engines with auto-escaping enabled. Implement Content Security Policy (CSP) headers. Validate and sanitize all external data. - Medium · Sidekiq Integration Without Visible Security Constraints —
lib/coverband/integrations/sidekiq_swarm.rb, lib/coverband/integrations/resque.rb. The 'lib/coverband/integrations/sidekiq_swarm.rb' integration processes background jobs. Without visible authentication or authorization checks, unauthorized users could potentially trigger coverage collection. Fix: Implement authentication and authorization checks for background job processing. Restrict which users/roles can trigger coverage operations. Validate job parameters. - Low · Potential Information Disclosure via Coverage Reports —
lib/coverband/reporters/web.rb, lib/coverband/mcp/tools/. Coverage data and dead code analysis ('lib/coverband/mcp/tools/get_dead_methods.rb') could expose internal application structure, file paths, and method names to unauthorized users through web endpoints. Fix: Implement authentication and role-based access control for all coverage reporting endpoints. Consider restricting detailed coverage data to authenticated administrators only. Add audit logging for data access. - Low · Missing CSRF Protection in Web UI —
lib/coverband/reporters/web.rb. The web UI ('lib/coverband/reporters/web.rb') may have endpoints that modify state (e.g., updating coverage data) without visible CSRF token validation. Fix: Implement CSRF token validation for all state-modifying operations. Use SameSite cookie attributes. Validate origin headers for sensitive operations. - Low · Dependency Management Best Practices —
Gemfile, Gemfile.rails*.*, coverband.gemspec. No explicit dependency version pinning visible in the file structure. Multiple Gemfile variants (Gemfile.rails7.0, Gemfile.rails7.1, etc.) suggest compatibility testing but may lead to inconsistent dependency versions. Fix: Use Gemfile.lock to pin transitive dependencies. Regularly audit dependencies with 'bundle audit' or 'bundler-audit'. Keep dependencies up-to-date and monitor security advisories.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.