cov-loupe 3.0.0 → 4.0.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +230 -0
  3. data/CLAUDE.md +5 -0
  4. data/CODE_OF_CONDUCT.md +62 -0
  5. data/CONTRIBUTING.md +102 -0
  6. data/GEMINI.md +5 -0
  7. data/README.md +154 -51
  8. data/RELEASE_NOTES.md +452 -0
  9. data/dev/images/cov-loupe-icon-lores.png +0 -0
  10. data/dev/images/cov-loupe-icon-square.png +0 -0
  11. data/dev/images/cov-loupe-icon.png +0 -0
  12. data/dev/images/cov-loupe-logo.png +0 -0
  13. data/dev/prompts/README.md +74 -0
  14. data/dev/prompts/archive/architectural-review-and-actions-prompt.md +53 -0
  15. data/dev/prompts/archive/investigate-and-report-issues-prompt.md +33 -0
  16. data/dev/prompts/archive/produce-action-items-prompt.md +25 -0
  17. data/dev/prompts/guidelines/ai-code-evaluator-guidelines.md +337 -0
  18. data/dev/prompts/improve/refactor-test-suite.md +18 -0
  19. data/dev/prompts/improve/simplify-code-logic.md +133 -0
  20. data/dev/prompts/improve/update-documentation.md +21 -0
  21. data/dev/prompts/review/comprehensive-codebase-review.md +176 -0
  22. data/dev/prompts/review/identify-action-items.md +143 -0
  23. data/dev/prompts/review/verify-code-changes.md +54 -0
  24. data/dev/prompts/validate/create-screencast-outline.md +234 -0
  25. data/dev/prompts/validate/test-documentation-examples.md +180 -0
  26. data/docs/QUICKSTART.md +63 -0
  27. data/docs/assets/images/cov-loupe-logo-lores.png +0 -0
  28. data/docs/assets/images/cov-loupe-logo.png +0 -0
  29. data/docs/assets/images/favicon.png +0 -0
  30. data/docs/assets/stylesheets/branding.css +16 -0
  31. data/docs/assets/stylesheets/extra.css +15 -0
  32. data/docs/code_of_conduct.md +1 -0
  33. data/docs/contributing.md +1 -0
  34. data/docs/dev/ARCHITECTURE.md +56 -11
  35. data/docs/dev/DEVELOPMENT.md +116 -12
  36. data/docs/dev/FUTURE_ENHANCEMENTS.md +14 -0
  37. data/docs/dev/README.md +3 -2
  38. data/docs/dev/RELEASING.md +2 -0
  39. data/docs/dev/arch-decisions/README.md +10 -7
  40. data/docs/dev/arch-decisions/application-architecture.md +259 -0
  41. data/docs/dev/arch-decisions/coverage-data-quality.md +193 -0
  42. data/docs/dev/arch-decisions/output-character-mode.md +217 -0
  43. data/docs/dev/arch-decisions/path-resolution.md +90 -0
  44. data/docs/dev/arch-decisions/{004-x-arch-decision.md → policy-validation.md} +32 -28
  45. data/docs/dev/arch-decisions/{005-x-arch-decision.md → simplecov-integration.md} +47 -44
  46. data/docs/dev/presentations/cov-loupe-presentation.md +15 -13
  47. data/docs/examples/mcp-inputs.md +3 -0
  48. data/docs/examples/prompts.md +3 -0
  49. data/docs/examples/success_predicates.md +3 -0
  50. data/docs/fixtures/demo_project/.resultset.json +170 -0
  51. data/docs/fixtures/demo_project/README.md +6 -0
  52. data/docs/fixtures/demo_project/app/controllers/admin/audit_logs_controller.rb +19 -0
  53. data/docs/fixtures/demo_project/app/controllers/orders_controller.rb +26 -0
  54. data/docs/fixtures/demo_project/app/models/order.rb +20 -0
  55. data/docs/fixtures/demo_project/app/models/user.rb +19 -0
  56. data/docs/fixtures/demo_project/lib/api/client.rb +22 -0
  57. data/docs/fixtures/demo_project/lib/ops/jobs/cleanup_job.rb +16 -0
  58. data/docs/fixtures/demo_project/lib/ops/jobs/report_job.rb +17 -0
  59. data/docs/fixtures/demo_project/lib/payments/processor.rb +15 -0
  60. data/docs/fixtures/demo_project/lib/payments/refund_service.rb +15 -0
  61. data/docs/fixtures/demo_project/lib/payments/reporting/exporter.rb +16 -0
  62. data/docs/index.md +1 -0
  63. data/docs/license.md +3 -0
  64. data/docs/release_notes.md +3 -0
  65. data/docs/user/ADVANCED_USAGE.md +208 -115
  66. data/docs/user/CLI_FALLBACK_FOR_LLMS.md +2 -0
  67. data/docs/user/CLI_USAGE.md +276 -101
  68. data/docs/user/ERROR_HANDLING.md +4 -4
  69. data/docs/user/EXAMPLES.md +121 -128
  70. data/docs/user/INSTALLATION.md +9 -28
  71. data/docs/user/LIBRARY_API.md +227 -122
  72. data/docs/user/MCP_INTEGRATION.md +114 -203
  73. data/docs/user/README.md +5 -1
  74. data/docs/user/TROUBLESHOOTING.md +49 -27
  75. data/docs/user/installing-a-prelease-version-of-covloupe.md +43 -0
  76. data/docs/user/{V2-BREAKING-CHANGES.md → migrations/MIGRATING_TO_V2.md} +62 -72
  77. data/docs/user/migrations/MIGRATING_TO_V3.md +72 -0
  78. data/docs/user/migrations/MIGRATING_TO_V4.md +591 -0
  79. data/docs/user/migrations/README.md +22 -0
  80. data/docs/user/prompts/README.md +9 -0
  81. data/docs/user/prompts/non-web-coverage-analysis-prompt.md +103 -0
  82. data/docs/user/prompts/rails-coverage-analysis-prompt.md +94 -0
  83. data/docs/user/prompts/use-cli-not-mcp-prompt.md +53 -0
  84. data/examples/cli_demo.sh +77 -0
  85. data/examples/filter_and_table_demo-output.md +114 -0
  86. data/examples/filter_and_table_demo.rb +174 -0
  87. data/examples/fixtures/demo_project/coverage/.resultset.json +10 -0
  88. data/examples/mcp-inputs/README.md +66 -0
  89. data/examples/mcp-inputs/coverage_detailed.json +1 -0
  90. data/examples/mcp-inputs/coverage_raw.json +1 -0
  91. data/examples/mcp-inputs/coverage_summary.json +1 -0
  92. data/examples/mcp-inputs/list.json +1 -0
  93. data/examples/mcp-inputs/uncovered_lines.json +1 -0
  94. data/examples/prompts/README.md +27 -0
  95. data/examples/prompts/custom_resultset.txt +2 -0
  96. data/examples/prompts/detailed_with_source.txt +2 -0
  97. data/examples/prompts/list_lowest.txt +2 -0
  98. data/examples/prompts/summary.txt +2 -0
  99. data/examples/prompts/uncovered.txt +2 -0
  100. data/examples/success_predicates/README.md +198 -0
  101. data/examples/success_predicates/all_files_above_threshold_predicate.rb +21 -0
  102. data/examples/success_predicates/directory_specific_thresholds_predicate.rb +30 -0
  103. data/examples/success_predicates/project_coverage_minimum_predicate.rb +6 -0
  104. data/lib/cov_loupe/base_tool.rb +229 -20
  105. data/lib/cov_loupe/cli.rb +132 -23
  106. data/lib/cov_loupe/commands/base_command.rb +25 -6
  107. data/lib/cov_loupe/commands/command_factory.rb +0 -1
  108. data/lib/cov_loupe/commands/detailed_command.rb +10 -5
  109. data/lib/cov_loupe/commands/list_command.rb +2 -1
  110. data/lib/cov_loupe/commands/raw_command.rb +7 -5
  111. data/lib/cov_loupe/commands/summary_command.rb +12 -7
  112. data/lib/cov_loupe/commands/totals_command.rb +74 -10
  113. data/lib/cov_loupe/commands/uncovered_command.rb +7 -5
  114. data/lib/cov_loupe/commands/validate_command.rb +11 -3
  115. data/lib/cov_loupe/commands/version_command.rb +6 -4
  116. data/lib/cov_loupe/{app_config.rb → config/app_config.rb} +13 -5
  117. data/lib/cov_loupe/config/app_context.rb +43 -0
  118. data/lib/cov_loupe/config/boolean_type.rb +91 -0
  119. data/lib/cov_loupe/config/logger.rb +92 -0
  120. data/lib/cov_loupe/{option_normalizers.rb → config/option_normalizers.rb} +55 -24
  121. data/lib/cov_loupe/{option_parser_builder.rb → config/option_parser_builder.rb} +46 -24
  122. data/lib/cov_loupe/coverage/coverage_calculator.rb +53 -0
  123. data/lib/cov_loupe/coverage/coverage_reporter.rb +63 -0
  124. data/lib/cov_loupe/coverage/coverage_table_formatter.rb +133 -0
  125. data/lib/cov_loupe/{error_handler.rb → errors/error_handler.rb} +21 -33
  126. data/lib/cov_loupe/{errors.rb → errors/errors.rb} +48 -71
  127. data/lib/cov_loupe/formatters/formatters.rb +75 -0
  128. data/lib/cov_loupe/formatters/source_formatter.rb +18 -7
  129. data/lib/cov_loupe/formatters/table_formatter.rb +80 -0
  130. data/lib/cov_loupe/loaders/all.rb +15 -0
  131. data/lib/cov_loupe/loaders/all_cli.rb +10 -0
  132. data/lib/cov_loupe/loaders/all_mcp.rb +23 -0
  133. data/lib/cov_loupe/loaders/resultset_loader.rb +147 -0
  134. data/lib/cov_loupe/mcp_server.rb +3 -2
  135. data/lib/cov_loupe/model/model.rb +520 -0
  136. data/lib/cov_loupe/model/model_data.rb +13 -0
  137. data/lib/cov_loupe/model/model_data_cache.rb +116 -0
  138. data/lib/cov_loupe/option_parsers/env_options_parser.rb +17 -6
  139. data/lib/cov_loupe/option_parsers/error_helper.rb +16 -10
  140. data/lib/cov_loupe/output_chars.rb +192 -0
  141. data/lib/cov_loupe/paths/glob_utils.rb +100 -0
  142. data/lib/cov_loupe/{path_relativizer.rb → paths/path_relativizer.rb} +5 -13
  143. data/lib/cov_loupe/paths/path_utils.rb +265 -0
  144. data/lib/cov_loupe/paths/volume_case_sensitivity.rb +173 -0
  145. data/lib/cov_loupe/presenters/base_coverage_presenter.rb +9 -13
  146. data/lib/cov_loupe/presenters/coverage_payload_presenter.rb +21 -0
  147. data/lib/cov_loupe/presenters/payload_caching.rb +23 -0
  148. data/lib/cov_loupe/presenters/project_coverage_presenter.rb +73 -21
  149. data/lib/cov_loupe/presenters/project_totals_presenter.rb +16 -10
  150. data/lib/cov_loupe/repositories/coverage_repository.rb +149 -0
  151. data/lib/cov_loupe/resolvers/coverage_line_resolver.rb +90 -76
  152. data/lib/cov_loupe/resolvers/{resolver_factory.rb → resolver_helpers.rb} +6 -5
  153. data/lib/cov_loupe/resolvers/resultset_path_resolver.rb +40 -12
  154. data/lib/cov_loupe/scripts/command_execution.rb +113 -0
  155. data/lib/cov_loupe/scripts/latest_ci_status.rb +97 -0
  156. data/lib/cov_loupe/scripts/pre_release_check.rb +164 -0
  157. data/lib/cov_loupe/scripts/setup_doc_server.rb +23 -0
  158. data/lib/cov_loupe/scripts/start_doc_server.rb +24 -0
  159. data/lib/cov_loupe/staleness/stale_status.rb +23 -0
  160. data/lib/cov_loupe/staleness/staleness_checker.rb +328 -0
  161. data/lib/cov_loupe/staleness/staleness_message_formatter.rb +91 -0
  162. data/lib/cov_loupe/tools/coverage_detailed_tool.rb +14 -15
  163. data/lib/cov_loupe/tools/coverage_raw_tool.rb +14 -14
  164. data/lib/cov_loupe/tools/coverage_summary_tool.rb +16 -16
  165. data/lib/cov_loupe/tools/coverage_table_tool.rb +139 -21
  166. data/lib/cov_loupe/tools/coverage_totals_tool.rb +31 -13
  167. data/lib/cov_loupe/tools/help_tool.rb +16 -20
  168. data/lib/cov_loupe/tools/list_tool.rb +65 -0
  169. data/lib/cov_loupe/tools/uncovered_lines_tool.rb +14 -14
  170. data/lib/cov_loupe/tools/validate_tool.rb +18 -24
  171. data/lib/cov_loupe/tools/version_tool.rb +8 -3
  172. data/lib/cov_loupe/version.rb +1 -1
  173. data/lib/cov_loupe.rb +83 -55
  174. metadata +184 -154
  175. data/docs/dev/BRANCH_ONLY_COVERAGE.md +0 -158
  176. data/docs/dev/arch-decisions/001-x-arch-decision.md +0 -95
  177. data/docs/dev/arch-decisions/002-x-arch-decision.md +0 -159
  178. data/docs/dev/arch-decisions/003-x-arch-decision.md +0 -165
  179. data/lib/cov_loupe/app_context.rb +0 -26
  180. data/lib/cov_loupe/constants.rb +0 -22
  181. data/lib/cov_loupe/coverage_reporter.rb +0 -31
  182. data/lib/cov_loupe/formatters.rb +0 -51
  183. data/lib/cov_loupe/mode_detector.rb +0 -56
  184. data/lib/cov_loupe/model.rb +0 -339
  185. data/lib/cov_loupe/presenters/coverage_detailed_presenter.rb +0 -14
  186. data/lib/cov_loupe/presenters/coverage_raw_presenter.rb +0 -14
  187. data/lib/cov_loupe/presenters/coverage_summary_presenter.rb +0 -14
  188. data/lib/cov_loupe/presenters/coverage_uncovered_presenter.rb +0 -14
  189. data/lib/cov_loupe/resultset_loader.rb +0 -131
  190. data/lib/cov_loupe/staleness_checker.rb +0 -247
  191. data/lib/cov_loupe/table_formatter.rb +0 -64
  192. data/lib/cov_loupe/tools/all_files_coverage_tool.rb +0 -51
  193. data/lib/cov_loupe/util.rb +0 -88
  194. data/spec/MCP_INTEGRATION_TESTS_README.md +0 -111
  195. data/spec/TIMESTAMPS.md +0 -48
  196. data/spec/all_files_coverage_tool_spec.rb +0 -53
  197. data/spec/app_config_spec.rb +0 -142
  198. data/spec/base_tool_spec.rb +0 -62
  199. data/spec/cli/show_default_report_spec.rb +0 -33
  200. data/spec/cli_enumerated_options_spec.rb +0 -90
  201. data/spec/cli_error_spec.rb +0 -184
  202. data/spec/cli_format_spec.rb +0 -123
  203. data/spec/cli_json_options_spec.rb +0 -50
  204. data/spec/cli_source_spec.rb +0 -44
  205. data/spec/cli_spec.rb +0 -192
  206. data/spec/cli_table_spec.rb +0 -28
  207. data/spec/cli_usage_spec.rb +0 -42
  208. data/spec/commands/base_command_spec.rb +0 -107
  209. data/spec/commands/command_factory_spec.rb +0 -76
  210. data/spec/commands/detailed_command_spec.rb +0 -34
  211. data/spec/commands/list_command_spec.rb +0 -28
  212. data/spec/commands/raw_command_spec.rb +0 -69
  213. data/spec/commands/summary_command_spec.rb +0 -34
  214. data/spec/commands/totals_command_spec.rb +0 -34
  215. data/spec/commands/uncovered_command_spec.rb +0 -55
  216. data/spec/commands/validate_command_spec.rb +0 -213
  217. data/spec/commands/version_command_spec.rb +0 -38
  218. data/spec/constants_spec.rb +0 -61
  219. data/spec/cov_loupe/formatters/source_formatter_spec.rb +0 -267
  220. data/spec/cov_loupe/formatters_spec.rb +0 -76
  221. data/spec/cov_loupe/presenters/base_coverage_presenter_spec.rb +0 -79
  222. data/spec/cov_loupe_model_spec.rb +0 -454
  223. data/spec/cov_loupe_module_spec.rb +0 -37
  224. data/spec/cov_loupe_opts_spec.rb +0 -185
  225. data/spec/coverage_reporter_spec.rb +0 -102
  226. data/spec/coverage_table_tool_spec.rb +0 -59
  227. data/spec/coverage_totals_tool_spec.rb +0 -37
  228. data/spec/error_handler_spec.rb +0 -197
  229. data/spec/error_mode_spec.rb +0 -139
  230. data/spec/errors_edge_cases_spec.rb +0 -312
  231. data/spec/errors_stale_spec.rb +0 -83
  232. data/spec/file_based_mcp_tools_spec.rb +0 -99
  233. data/spec/help_tool_spec.rb +0 -26
  234. data/spec/integration_spec.rb +0 -789
  235. data/spec/logging_fallback_spec.rb +0 -128
  236. data/spec/mcp_logging_spec.rb +0 -44
  237. data/spec/mcp_server_integration_spec.rb +0 -23
  238. data/spec/mcp_server_spec.rb +0 -106
  239. data/spec/mode_detector_spec.rb +0 -153
  240. data/spec/model_error_handling_spec.rb +0 -269
  241. data/spec/model_staleness_spec.rb +0 -79
  242. data/spec/option_normalizers_spec.rb +0 -203
  243. data/spec/option_parsers/env_options_parser_spec.rb +0 -221
  244. data/spec/option_parsers/error_helper_spec.rb +0 -222
  245. data/spec/path_relativizer_spec.rb +0 -98
  246. data/spec/presenters/coverage_detailed_presenter_spec.rb +0 -19
  247. data/spec/presenters/coverage_raw_presenter_spec.rb +0 -15
  248. data/spec/presenters/coverage_summary_presenter_spec.rb +0 -15
  249. data/spec/presenters/coverage_uncovered_presenter_spec.rb +0 -16
  250. data/spec/presenters/project_coverage_presenter_spec.rb +0 -87
  251. data/spec/presenters/project_totals_presenter_spec.rb +0 -144
  252. data/spec/resolvers/coverage_line_resolver_spec.rb +0 -282
  253. data/spec/resolvers/resolver_factory_spec.rb +0 -61
  254. data/spec/resolvers/resultset_path_resolver_spec.rb +0 -60
  255. data/spec/resultset_loader_spec.rb +0 -167
  256. data/spec/shared_examples/README.md +0 -115
  257. data/spec/shared_examples/coverage_presenter_examples.rb +0 -66
  258. data/spec/shared_examples/file_based_mcp_tools.rb +0 -179
  259. data/spec/shared_examples/formatted_command_examples.rb +0 -64
  260. data/spec/shared_examples/mcp_tool_text_json_response.rb +0 -16
  261. data/spec/spec_helper.rb +0 -127
  262. data/spec/staleness_checker_spec.rb +0 -374
  263. data/spec/staleness_more_spec.rb +0 -42
  264. data/spec/support/cli_helpers.rb +0 -22
  265. data/spec/support/control_flow_helpers.rb +0 -20
  266. data/spec/support/fake_mcp.rb +0 -40
  267. data/spec/support/io_helpers.rb +0 -29
  268. data/spec/support/mcp_helpers.rb +0 -35
  269. data/spec/support/mcp_runner.rb +0 -66
  270. data/spec/support/mocking_helpers.rb +0 -30
  271. data/spec/table_format_spec.rb +0 -70
  272. data/spec/tools/validate_tool_spec.rb +0 -132
  273. data/spec/tools_error_handling_spec.rb +0 -130
  274. data/spec/util_spec.rb +0 -154
  275. data/spec/version_spec.rb +0 -123
  276. data/spec/version_tool_spec.rb +0 -141
  277. /data/{spec/fixtures/project1 → examples/fixtures/demo_project}/lib/bar.rb +0 -0
  278. /data/{spec/fixtures/project1 → examples/fixtures/demo_project}/lib/foo.rb +0 -0
  279. /data/lib/cov_loupe/{config_parser.rb → config/config_parser.rb} +0 -0
  280. /data/lib/cov_loupe/{predicate_evaluator.rb → config/predicate_evaluator.rb} +0 -0
  281. /data/lib/cov_loupe/{error_handler_factory.rb → errors/error_handler_factory.rb} +0 -0
data/RELEASE_NOTES.md ADDED
@@ -0,0 +1,452 @@
1
+ # Release Notes
2
+
3
+ [Back to main README](docs/index.md)
4
+
5
+
6
+ ## v4.0.0, v4.0.0.pre (Breaking)
7
+
8
+ - **Removed Branch Coverage Support**: Removed logic that synthesized line coverage from branch-only coverage data. This feature was complex and rarely used. Users should use standard line coverage configuration in SimpleCov.
9
+ - Removed `docs/dev/BRANCH_ONLY_COVERAGE.md`.
10
+ - **⚠️ MCP mode now requires `-m/--mode mcp` flag**: Automatic mode detection has been removed. MCP users **must** update their MCP server configuration to include `-m mcp` or `--mode mcp` or the server will run in CLI mode and hang. See migration guide for setup commands.
11
+ - **Old**: Mode was auto-detected based on TTY/stdin status, with optional `--force-mode cli|mcp|auto` override
12
+ - **New**: Mode defaults to `cli`. Use `-m mcp` or `--mode mcp` to run as MCP server. No auto-detection.
13
+ - **Rationale**: Auto-detection caused issues with piped input, CI environments, and CLI-only flags (e.g., `cov-loupe --format json` would hang in MCP mode)
14
+ - **Unified stale coverage enforcement**: New `--raise-on-stale` / `raise_on_stale` boolean replaces the old `--staleness`/`check_stale` combo across CLI, Ruby, and MCP interfaces. When true, `cov-loupe` raises if any file or the project totals are stale; when false, staleness is reported but execution continues.
15
+ - **Ruby API method renamed**: `CoverageModel#all_files_coverage` renamed to `CoverageModel#list` for consistency with CLI subcommand naming.
16
+ - **Ruby API return type changed**: `CoverageModel#list` now returns a **hash** with comprehensive staleness information instead of just an array of files. The hash includes keys: `files` (array), `skipped_files`, `missing_tracked_files`, `newer_files`, and `deleted_files`. Update code to use `model.list['files']` when you need just the file array.
17
+ - **Ruby API signature change**: `CovLoupe::Resolvers::CoverageLineResolver` now requires `root:` (no default), and `ResolverHelpers.lookup_lines` / `create_coverage_resolver` require `root:` as well.
18
+ - **Dependency update**: Replaced unmaintained `awesome_print` with `amazing_print` (`~> 2.0`).
19
+ - CLI: `--format amazing_print` is now the preferred way to specify the pretty-print formatter. `-f ap` and `--format awesome_print` are still supported.
20
+ - Library: `require 'awesome_print'` is replaced by `require 'amazing_print'`.
21
+ - Library: Internal format symbol changed from `:awesome_print` to `:amazing_print`.
22
+ - `CovLoupe::AppConfig#format` now returns `:amazing_print` when configured for that output.
23
+ - `CovLoupe::Formatters.format(obj, :amazing_print)` is the new API method.
24
+ - **Internal Logger API changed**: `CovLoupe::Logger.new` now requires `mode:` (symbol) instead of `mcp_mode:` (boolean).
25
+ - Use `CovLoupe::Logger.new(target: t, mode: :cli|:mcp|:library)` instead of `mcp_mode: true/false`.
26
+ - **Deleted files now raise `FileNotFoundError`**: Previously, querying a file that was deleted after coverage was generated would incorrectly return stale coverage data. This was misleading for metrics and violated the documented API contract. Now properly raises `FileNotFoundError` for missing files, regardless of whether coverage data exists in the resultset.
27
+ - **Old**: `model.summary_for('deleted_file.rb')` would return coverage data with exit 0
28
+ - **New**: `model.summary_for('deleted_file.rb')` raises `CovLoupe::FileNotFoundError`
29
+ - **Rationale**: Deleted files represent stale data that pollutes metrics. The API documentation already promised `FileNotFoundError` for missing files; the implementation now matches the contract.
30
+ - **Staleness check errors now return 'E' marker**: Previously, when staleness checking itself failed (e.g., file permission errors, resolver failures, unexpected exceptions), the `stale` field returned `false`, making errors indistinguishable from fresh files. Now returns `'E'` to explicitly indicate a failed staleness check.
31
+ - **Old**: `{ "file": "...", "stale": false }` (error silently treated as fresh)
32
+ - **New**: `{ "file": "...", "stale": "E" }` (error explicitly flagged)
33
+ - **Impact**: Code checking `stale == false` or using truthiness checks (`if payload['stale']`) will need updating. Error is still logged for debugging.
34
+ - **Frequency**: Rare - only affects error conditions during staleness checking (not normal staleness detection)
35
+ - **Path resolution now handles case-sensitivity and path separators correctly (NEW in v4.0.0)**: Path normalization now independently handles two concerns: (1) slash normalization for Windows backslashes, and (2) case-folding for case-insensitive volumes. Case-sensitivity is detected lazily on first use by testing the project root volume (prefers using existing files via `File.identical?` to avoid writes; falls back to temporary file creation if needed).
36
+ - **Windows**: Paths are now case-insensitive with backslash normalization (`C:\Foo\Bar.rb` matches `c:/foo/bar.rb`)
37
+ - **macOS**: Most macOS users have case-insensitive APFS volumes - path lookups like `lib/Foo.rb` will now correctly match `lib/foo.rb` in coverage data. This may surface previously-hidden case mismatches in test code.
38
+ - **Linux**: Typically case-sensitive (no change in behavior for most users)
39
+ - **Special cases**: Correctly handles case-sensitive APFS volumes (macOS formatted with `-s`) and external drives
40
+ - **Limitation**: All coverage files are assumed to be on the same volume as the project root. Mixed-volume coverage data (e.g., files from both case-sensitive and case-insensitive volumes) is not supported.
41
+ - **Why**: A filesystem type (APFS, ext4, NTFS) can have multiple volumes with different case-sensitivity settings. Platform assumptions are insufficient. Runtime detection is the only accurate approach.
42
+ - **Stricter staleness detection for line count mismatches**: Removed the trailing newline adjustment heuristic that could mask legitimate code additions (false negatives). Previously, if a file's line count was exactly one more than the coverage data and the file was missing a trailing newline, the staleness checker would adjust the count and report the file as fresh. This heuristic was risky because it couldn't distinguish between a harmless missing newline and a developer adding a line of code while simultaneously removing the trailing newline. All line count mismatches are now treated as significant staleness indicators.
43
+ - **Old**: File with 101 lines (no trailing newline) matching 100 coverage lines → reported as fresh (adjusted)
44
+ - **New**: File with 101 lines matching 100 coverage lines → reported as stale (length mismatch)
45
+ - **Impact**: More conservative staleness detection may flag some files that were previously considered fresh. This is intentional to prevent false negatives.
46
+ - **Rationale**: Prioritizes accuracy over convenience. Better to flag a file as stale and re-run tests than to miss actual code changes.
47
+ - **⚠️ `--tracked-globs` default changed to empty array**: The `--tracked-globs` CLI option now defaults to `[]` (empty) instead of `lib/**/*.rb,app/**/*.rb,src/**/*.rb`. The Ruby API also changed from `nil` to `[]` for consistency (both behave identically, so no functional change). This prevents silently excluding coverage results that don't match assumed project patterns and avoids false positives when detecting missing files.
48
+ - **Old**: CLI defaulted to `lib/**/*.rb,app/**/*.rb,src/**/*.rb` - files outside these patterns were excluded from output
49
+ - **New**: CLI and Ruby API default to `[]` (empty) - shows all files in the resultset without filtering
50
+ - **Affects**: CLI (`cov-loupe list`) and Ruby API signature (`CoverageModel.new` - behavior unchanged, only default parameter value changed for consistency)
51
+ - **Impact**: CLI users who relied on automatic filtering or missing-file detection will need to explicitly set `--tracked-globs`
52
+ - **Migration (CLI)**: Set `COV_LOUPE_OPTS="--tracked-globs lib/**/*.rb,app/**/*.rb"` in your shell config to match your SimpleCov `track_files` patterns
53
+ - **Migration (Ruby API)**: No action needed - behavior unchanged (nil and [] both normalize to empty array)
54
+ - **Rationale**:
55
+ - **Transparency**: Shows all coverage data without hiding files that don't match assumptions
56
+ - **No false positives**: Broad patterns flag migrations, bin scripts, etc. as "missing"
57
+ - **Project variety**: Different projects use different structures (lib/, app/, src/, config/, etc.)
58
+ - **Important**: Files lacking any coverage at all (not loaded during tests) will not appear in the resultset and therefore won't be visible with the default empty array. To detect such files, you must set `--tracked-globs`
59
+
60
+ ### ✨ Enhancements
61
+
62
+ - **Project totals now include coverage breakdowns**: The `totals` subcommand and `coverage_totals_tool` now return explicit `with_coverage` and `without_coverage` breakdowns, plus tracking metadata, so totals clearly separate fresh coverage from missing coverage.
63
+
64
+ **Example output:**
65
+ ```json
66
+ {
67
+ "lines": { "total": 100, "covered": 90, "uncovered": 10, "percent_covered": 90.0 },
68
+ "tracking": { "enabled": true, "globs": ["lib/**/*.rb"] },
69
+ "files": {
70
+ "total": 10,
71
+ "with_coverage": {
72
+ "total": 9,
73
+ "ok": 8,
74
+ "stale": {
75
+ "total": 1,
76
+ "by_type": {
77
+ "missing_from_disk": 0,
78
+ "newer": 1,
79
+ "length_mismatch": 0,
80
+ "unreadable": 0
81
+ }
82
+ }
83
+ },
84
+ "without_coverage": {
85
+ "total": 1,
86
+ "by_type": {
87
+ "missing_from_coverage": 1,
88
+ "unreadable": 0,
89
+ "skipped": 0
90
+ }
91
+ }
92
+ }
93
+ }
94
+ ```
95
+
96
+ Table format also includes a file breakdown section after totals.
97
+
98
+ **Breaking change:** The JSON shape for totals has changed (the old `percentage` and `excluded_files` fields are removed).
99
+
100
+ **📖 For complete migration guide, see [docs/user/migrations/MIGRATING_TO_V4.md](docs/user/migrations/MIGRATING_TO_V4.md)**
101
+
102
+ ## v3.0.0
103
+
104
+ ### 🚨 BREAKING CHANGE: GEM RENAMED simplecov-mcp → cov-loupe
105
+
106
+ This is a **major version bump** because the gem has been completely renamed from **simplecov-mcp** to **cov-loupe**. This requires manual intervention to migrate.
107
+
108
+ #### What Changed
109
+ - **Gem name**: `simplecov-mcp` → `cov-loupe`
110
+ - **Executable**: `simplecov-mcp` → `cov-loupe`
111
+ - **Repository**: `github.com/keithrbennett/simplecov-mcp` → `github.com/keithrbennett/cov-loupe`
112
+ - **Module name**: `SimpleCovMcp` → `CovLoupe`
113
+ - **Require path**: `require 'simplecov_mcp'` → `require 'cov_loupe'`
114
+ - **Environment variable**: `SIMPLECOV_MCP_OPTS` → `COV_LOUPE_OPTS`
115
+ - **Log file**: `simplecov_mcp.log` → `cov_loupe.log`
116
+ - **Documentation alias**: `smcp` → `clp`
117
+
118
+ #### What Stayed the Same
119
+ - **All functionality**: No breaking changes to features or APIs
120
+
121
+ #### Migration Steps
122
+ 1. Uninstall old gem: `gem uninstall simplecov-mcp`
123
+ 2. Install new gem: `gem install cov-loupe`
124
+ 3. Update scripts/aliases: Change `simplecov-mcp` to `cov-loupe`
125
+ 4. Update Ruby code: Rename `SimpleCovMcp` to `CovLoupe` and update requires.
126
+ 5. Update env vars: Rename `SIMPLECOV_MCP_OPTS` to `COV_LOUPE_OPTS`
127
+
128
+ **📖 For complete migration guide, see [docs/user/migrations/MIGRATING_TO_V3.md](docs/user/migrations/MIGRATING_TO_V3.md)**
129
+
130
+ **Note**: The old `simplecov-mcp` gem (v2.0.1) will remain available on RubyGems but will not receive further updates.
131
+
132
+ ### ✨ Other Changes
133
+ - Add logo and avatar images, display in readme
134
+
135
+ ## v2.0.1
136
+
137
+ - Improve help text
138
+ - Add a prompt
139
+
140
+
141
+ ## v2.0.0
142
+
143
+ ### 🚨 BREAKING CHANGES
144
+
145
+ Version 2.0 introduces several breaking changes to improve consistency and align with Ruby conventions. Key changes include:
146
+
147
+ - **CLI**: Global options must now precede subcommands (e.g., `simplecov-mcp --format json list` instead of `simplecov-mcp list --format json`)
148
+ - **Options renamed**: `--stale` → `--staleness`, `--source-context` → `--context-lines`, `--json` → `--format`
149
+ - **Error modes**: `on` → `log`, `trace` → `debug`
150
+ - **Subcommands**: `--success-predicate` flag replaced with `validate` subcommand
151
+ - **Source option**: Now requires explicit mode (`--source full` or `--source uncovered`)
152
+ - **Default sort**: Changed from ascending to descending (best coverage first)
153
+ - **MCP tools**: Parameter `stale` renamed to `staleness`, error modes updated
154
+ - **Ruby API**: `CLIConfig` renamed to `AppConfig`, field changes (`json` → `format`, `stale_mode` → `staleness`)
155
+
156
+ **📖 For complete migration guide with examples, see [docs/user/migrations/MIGRATING_TO_V2.md](docs/user/migrations/MIGRATING_TO_V2.md)**
157
+
158
+ ### ✨ New Features
159
+
160
+ - **validate subcommand**: File mode (`validate <file>`) and inline mode (`validate -i <code>`)
161
+ - **MCP support**: New `validate_tool` with `code` and `file` parameters
162
+
163
+ ---
164
+
165
+ ## v1.1.0
166
+
167
+ - Add a `totals` CLI subcommand and matching `coverage_totals_tool` that report covered/total/uncovered line counts plus the average coverage percent.
168
+ - Refactor command line and environment argument handling
169
+
170
+ ## v1.0.1 (2025-10-23)
171
+
172
+ - Make error output more helpful when a result set file is not found, esp. when the command name is run without args in a non-project directory.
173
+
174
+ ## v1.0.0 (2025-10-18)
175
+
176
+ 🎉 **Major Release: Production-Ready Coverage Analysis Tool**
177
+
178
+ This release represents a complete maturation of simplecov-mcp from experimental proof-of-concept to production-ready tool. The v1.0.0 milestone brings comprehensive documentation, robust error handling, extensive test coverage, architectural improvements, and a polished user experience across all three interfaces (MCP server, CLI, and Ruby library).
179
+
180
+ ### 🌟 Major Features
181
+
182
+ #### Multi-Suite Coverage Merging
183
+ - **Automatic merging** of multiple test suites from a single `.resultset.json` file (e.g., RSpec + Cucumber)
184
+ - **Lazy loading** of SimpleCov dependency - only loaded when multi-suite merging is needed
185
+ - **Performance optimized** - single-suite projects remain fast with no SimpleCov runtime overhead
186
+ - See `docs/user/ADVANCED_USAGE.md` for configuration details
187
+
188
+ #### Branch Coverage Support (with Limitations)
189
+ - **Branch-level data handling** - reads and processes SimpleCov branch coverage data
190
+ - **Line-level aggregation** - branch hits are summed per line since individual branch tracking isn't supported yet
191
+ - **Graceful degradation** - use native SimpleCov HTML reports for detailed branch-by-branch analysis
192
+ - See `docs/dev/BRANCH_ONLY_COVERAGE.md` for details and limitations
193
+
194
+ #### Enhanced Staleness Detection
195
+ - **Three staleness indicators**:
196
+ - `M` - File modified after coverage run (timestamp-based)
197
+ - `T` - File timestamp unavailable or coverage missing
198
+ - `L` - Line count mismatch between source and coverage
199
+ - **Per-file reporting** in all outputs (CLI tables, JSON, MCP responses)
200
+ - **Configurable modes**: `--stale off|error` for CI/CD integration
201
+ - Improved edge case handling for files outside project root
202
+
203
+ #### Success Predicates for CI/CD
204
+ - **Custom exit code logic** via `--success-predicate` flag
205
+ - **Ruby code evaluation** - Load lambdas or other callable objects to define coverage policies
206
+ - **Flexible policy definitions** - Check minimum thresholds, file-based rules, directory-specific requirements, etc.
207
+ - **Examples provided** in `examples/success_predicates/`:
208
+ - Project-wide minimum coverage
209
+ - Per-directory thresholds
210
+ - Class-based policies
211
+ - Maximum low-coverage file count
212
+ - See `docs/user/ADVANCED_USAGE.md#success-predicates` for usage and security considerations
213
+
214
+ #### Comprehensive CLI Enhancements
215
+ - **Default command improved** - `simplecov-mcp` shows sorted coverage table (no subcommand needed)
216
+ - **Flexible sorting** - `--sort-order a|d` or `--sort-order ascending|descending`
217
+ - **Annotated source code** - `--source=full|uncovered` with `--source-context N` for context lines
218
+ - **Optional colorization** - `-C/--color [BOOLEAN]` for source code output
219
+ - **Tracked globs** - `--tracked-globs PATTERN` to filter files or detect new untested files
220
+ - **User-specified defaults via environment variable** - `SIMPLECOV_MCP_OPTS` environment variable value is prepended to ARGV for option parsing
221
+ - **Configurable logging** - `--log-file PATH` or `stdout`/`stderr` (default: `./simplecov_mcp.log`)
222
+
223
+ ### 🏗️ Architecture & Code Quality
224
+
225
+ #### Major Refactoring
226
+ - **Command pattern** - CLI subcommands extracted to individual command classes (`lib/simplecov_mcp/commands/`)
227
+ - **Presenter pattern** - Shared presentation logic for all output formats (`lib/simplecov_mcp/presenters/`)
228
+ - **Resolver pattern** - Path and coverage line resolution extracted to dedicated classes (`lib/simplecov_mcp/resolvers/`)
229
+ - **Factory pattern** - Error handlers and command instantiation centralized
230
+ - **Shared test examples** - DRY test suite with shared behaviors documented in `spec/shared_examples/README.md`
231
+
232
+ #### Error Handling Overhaul
233
+ - **Context-aware errors** - Different error strategies for CLI, library, and MCP server modes
234
+ - **Three error modes**: `off`, `log`, `debug` (configurable via `--error-mode` or `SIMPLECOV_MCP_OPTS`)
235
+ - **Custom exception hierarchy** - `SimpleCovMcp::Error` base class with specific subtypes
236
+ - **Logging fallback** - Graceful degradation to stderr when log file is unavailable (CLI/library modes only)
237
+ - **Structured MCP errors** - JSON-RPC compliant error responses with proper error codes
238
+ - See `docs/user/ERROR_HANDLING.md` for complete reference
239
+
240
+ #### Improved Path Resolution
241
+ - **Multi-strategy matching**:
242
+ 1. Exact absolute path
243
+ 2. Path without working directory prefix
244
+ 3. Basename (filename) fallback
245
+ - **New `PathRelativizer` class** - Consistent relative path handling across codebase
246
+ - **Configurable root** - `--root PATH` option to resolve relative paths against different directories
247
+
248
+ #### Test Coverage Excellence
249
+ - **Comprehensive test suite** - 546 examples across 55 test files
250
+ - **High coverage** - 98.49% line coverage, 90.36% branch coverage (self-reported via SimpleCov)
251
+ - **Integration tests** - Real-world scenarios in `spec/integration_spec.rb`
252
+ - **MCP integration tests** - JSON-RPC protocol validation in `spec/mcp_server_integration_spec.rb`
253
+ - **Edge case testing** - Exhaustive error condition coverage in `spec/errors_edge_cases_spec.rb`
254
+ - **Test documentation** - `spec/MCP_INTEGRATION_TESTS_README.md` and `spec/TIMESTAMPS.md`
255
+
256
+ ### 📚 Documentation Overhaul
257
+
258
+ #### Comprehensive Documentation Suite
259
+ All documentation moved under audience-specific directories (`docs/user` for usage guides, `docs/dev` for contributor content):
260
+
261
+ **Getting Started:**
262
+ - `docs/user/INSTALLATION.md` - Installation for all environments (gem, Bundler, source, RVM, rbenv, etc.)
263
+ - `docs/user/CLI_USAGE.md` - Complete command-line reference with examples
264
+ - `docs/user/EXAMPLES.md` - Common use cases and workflows
265
+
266
+ **Advanced Usage:**
267
+ - `docs/user/ADVANCED_USAGE.md` - Success predicates, multi-suite merging, resultset configuration
268
+ - `docs/user/MCP_INTEGRATION.md` - AI assistant setup (Claude Code, Cursor, Zed, etc.)
269
+ - `docs/user/LIBRARY_API.md` - Complete Ruby API documentation with recipes
270
+
271
+ **Reference:**
272
+ - `docs/user/ERROR_HANDLING.md` - Error modes, exception types, logging
273
+ - `docs/user/TROUBLESHOOTING.md` - Common issues and solutions
274
+ - `docs/dev/ARCHITECTURE.md` - System design and component overview
275
+ - `docs/dev/DEVELOPMENT.md` - Contributing guide
276
+ - `docs/dev/BRANCH_ONLY_COVERAGE.md` - Branch coverage support and limitations
277
+
278
+ **Architectural Decisions:**
279
+ - `docs/dev/arch-decisions/*.md` - 5 detailed ADRs documenting major design decisions
280
+ - `docs/dev/arch-decisions/README.md` - Index and overview
281
+
282
+ **Additional Resources:**
283
+ - `docs/dev/presentations/simplecov-mcp-presentation.md` - Slide deck for talks/demos
284
+ - `examples/success_predicates/README.md` - Success predicate examples and patterns
285
+ - `prompts/*.md` - AI prompt templates for coverage analysis
286
+
287
+ #### Improved README
288
+ - **Value proposition first** - Clear explanation of what simplecov-mcp does and why it matters
289
+ - **Quick Start section** - Get running in 3 steps
290
+ - **Audience-based organization** - Documentation grouped by user journey (Getting Started, Advanced, Reference)
291
+ - **Next Steps section** - Clear calls-to-action at end
292
+ - **Reduced length** - Main README streamlined from 967 lines to 272 lines by extracting content to dedicated docs
293
+
294
+ ### 🔧 Developer Experience
295
+
296
+ #### Configuration Improvements
297
+ - **Environment variable options** - `SIMPLECOV_MCP_OPTS` prepended to ARGV for option parsing
298
+ - **Force CLI mode** - `--force-cli` flag to disable MCP server mode detection
299
+ - **Flexible resultset location** - Multiple resolution strategies with sensible defaults
300
+ - **Normalized options** - Consistent internal representation of enumerated options (symbols)
301
+
302
+ #### Logging Enhancements
303
+ - **Configurable log file** - `--log-file PATH` (or `-l`) command-line option
304
+ - **Programmatic control** - `SimpleCovMcp.default_log_file=` and `SimpleCovMcp.active_log_file=` for runtime changes
305
+ - **Mode-aware logging** - MCP mode prohibits `stdout` logging (would corrupt JSON-RPC protocol), allows `stderr` or file
306
+ - **Timestamped log entries** - All log messages include ISO 8601 timestamps
307
+
308
+ #### Build & Release
309
+ - **Dependabot integration** - Automated dependency updates (`.github/dependabot.yml`)
310
+ - **License added** - MIT License (`LICENSE` file)
311
+ - **Gemspec improvements** - Tighter version constraints, correct file list
312
+ - **Version command** - `simplecov-mcp version` for easy version checking
313
+
314
+ ### 🐛 Bug Fixes
315
+
316
+ #### CLI Fixes
317
+ - **Subcommand extraction** - Fixed `--source` flag incorrectly treated as subcommand (see the subcommand list in `lib/simplecov_mcp/constants.rb`)
318
+ - **Option argument parsing** - Centralized list of options expecting arguments to prevent similar bugs
319
+ - **Invalid option handling** - Clean error messages for unrecognized CLI flags
320
+ - **Help text formatting** - Improved readability and consistency
321
+
322
+ #### Path Resolution Fixes
323
+ - **Double-path bug** - Fixed resultset resolver creating invalid paths like `spec/fixtures/project1/spec/fixtures/project1/coverage`
324
+ - **Relative path handling** - Stopped indiscriminately running `File.absolute_path(resultset, @root)` on already-absolute paths
325
+ - **Files outside root** - Graceful handling of coverage data for files outside project root directory
326
+
327
+ #### Coverage Processing Fixes
328
+ - **Branch-only coverage** - No longer crashes on resultsets with branch data but no line data
329
+ - **String timestamps** - Handles both integer and string timestamps in resultset JSON
330
+ - **Multiple resultsets** - Proper merging when `.resultset.json` contains multiple test suite entries
331
+ - **Line count mismatches** - Accurate staleness detection handles trailing newline differences between source and coverage data
332
+
333
+ #### Error Handling Fixes
334
+ - **Library mode exceptions** - Consistent `SimpleCovMcp::Error` exceptions (not bare `RuntimeError`)
335
+ - **MCP error format** - JSON-RPC compliant error responses
336
+ - **Missing resultset** - Clear error messages with actionable suggestions
337
+ - **Fallback logging** - stderr logging when primary log destination is unavailable (not in MCP mode)
338
+
339
+ ### 🔄 Breaking Changes
340
+
341
+ #### Naming Consistency
342
+ - **Module name** - Now consistently `SimpleCovMcp` (matching SimpleCov's single-word style)
343
+ - **Legacy shim removed** - `SimpleCov::Mcp` entry point no longer supported
344
+ - **Require path** - Changed from `simple_cov/mcp` to `simplecov_mcp`
345
+ - **File paths** - All files moved from `lib/simple_cov_mcp/` to `lib/simplecov_mcp/`
346
+
347
+ #### Option Changes
348
+ - **Removed environment variables**: `SIMPLECOV_RESULTSET`, `SIMPLECOV_MCP_CLI`, `SIMPLECOV_MCP_DEBUG`, `SIMPLECOV_MCP_LOG`
349
+ - **New environment variable**: `SIMPLECOV_MCP_OPTS` - use this instead (supports all CLI options including `--log-file`)
350
+ - **CLI flag removed**: `--cli` (replaced by `--force-cli`)
351
+ - **Error mode enum**: Changed from `--debug` to `--error-mode trace|on|off`
352
+ - **Subcommand changes**: `table` and `all-files` subcommands merged into `list`
353
+
354
+ #### API Changes
355
+ - **CoverageModel constructor** - Options now use consistent symbol keys (not mixed strings/symbols)
356
+ - **Staleness return values** - Changed from boolean to letter codes (`'M'`, `'T'`, `'L'`, or `false`)
357
+ - **Error classes** - Custom exception hierarchy replaces generic `RuntimeError`
358
+
359
+ ### 📊 Statistics
360
+
361
+ - **175 files changed** with 15,712 insertions and 2,142 deletions
362
+ - **152 commits** since v0.3.0
363
+ - **Comprehensive documentation** - 12 major documentation files in `docs/`, 5 ADRs, 7 example scripts
364
+ - **Test coverage** - Self-reported coverage via SimpleCov (view with `simplecov-mcp list`)
365
+
366
+ ### 🙏 Acknowledgments
367
+
368
+ This release benefited from extensive AI pair programming sessions with Codex, Claude Code, GLM-4.6 (Z-AI), Gemini, and Warp.
369
+
370
+ See `CLAUDE.md`, `AGENTS.md`, and `GEMINI.md` for AI agent integration notes.
371
+
372
+ ### 📦 Upgrade Guide
373
+
374
+ #### From v0.3.0
375
+
376
+ 1. **Update require statements:**
377
+ ```ruby
378
+ # Old
379
+ require 'simple_cov/mcp'
380
+
381
+ # New
382
+ require 'simplecov_mcp'
383
+ ```
384
+
385
+ 2. **Update environment variables:**
386
+ ```sh
387
+ # Old
388
+ export SIMPLECOV_RESULTSET=/path/to/coverage
389
+ export SIMPLECOV_MCP_DEBUG=1
390
+
391
+ # New
392
+ export SIMPLECOV_MCP_OPTS="--resultset /path/to/coverage --error-mode trace"
393
+ ```
394
+
395
+ 3. **Update CLI commands:**
396
+ ```sh
397
+ # Old
398
+ simplecov-mcp table
399
+ simplecov-mcp all-files
400
+
401
+ # New (merged into 'list')
402
+ simplecov-mcp list
403
+ simplecov-mcp # default command is 'list'
404
+ ```
405
+
406
+ 4. **Update MCP configurations:**
407
+ - Review `docs/user/MCP_INTEGRATION.md` for updated setup instructions
408
+ - Log file now defaults to `./simplecov_mcp.log` (was `~/simplecov_mcp.log`)
409
+
410
+ 5. **Handle new error types in library code:**
411
+ ```ruby
412
+ # Old
413
+ rescue RuntimeError => e
414
+
415
+ # New
416
+ rescue SimpleCovMcp::FileError => e
417
+ rescue SimpleCovMcp::ConfigurationError => e
418
+ rescue SimpleCovMcp::Error => e # catch-all
419
+ ```
420
+
421
+ ### 🔮 Possible Future Improvements
422
+
423
+ - **Per-file staleness timestamps** in multi-suite scenarios
424
+ - **Multiple resultset file merging** (currently only merges suites within single file)
425
+ - **Full branch coverage support** with individual branch tracking
426
+ - **Web interface** for interactive coverage exploration
427
+ - **Additional output formats** (HTML reports, badges, etc.)
428
+
429
+ ### 🔗 Links
430
+
431
+ - **Changelog:** [RELEASE_NOTES.md](docs/release_notes.md)
432
+ - **GitHub:** https://github.com/keithrbennett/simplecov-mcp
433
+ - **RubyGems:** https://rubygems.org/gems/simplecov-mcp
434
+ - **Issues:** https://github.com/keithrbennett/simplecov-mcp/issues
435
+
436
+ ---
437
+
438
+ **Full Changelog**: v0.3.0...v1.0.0
439
+
440
+ ---
441
+
442
+ ## v0.2.1
443
+
444
+ * Fixed JSON data key issue and resulting test failure.
445
+
446
+ ## v0.2.0
447
+
448
+ * Massive enhancements and improvements.
449
+
450
+ ## v0.1.0
451
+
452
+ * Initial version.
Binary file
Binary file
Binary file
@@ -0,0 +1,74 @@
1
+ # AI Prompts for cov-loupe Development
2
+
3
+ This directory contains prompts for AI coding assistants to help with codebase maintenance and improvement.
4
+
5
+ ## Quick Reference
6
+
7
+ ### Review Code
8
+
9
+ **[Comprehensive Codebase Review](review/comprehensive-codebase-review.md)**
10
+ - **When:** Periodic health checks, understanding overall state, pre-release assessments
11
+ - **Output:** Balanced assessment (strengths + weaknesses) with scoring across 10 dimensions
12
+ - **Question answered:** "How are we doing overall?"
13
+ - **Time:** 2-4 hours
14
+
15
+ **[Identify Action Items](review/identify-action-items.md)**
16
+ - **When:** Planning sprints, "what needs fixing NOW?"
17
+ - **Output:** Issues-only report with severity/effort, actionable prompts for each
18
+ - **Question answered:** "What should we fix next?"
19
+ - **Time:** 1-2 hours
20
+
21
+ **[Verify Code Changes](review/verify-code-changes.md)**
22
+ - **When:** After implementing a feature/fix, before committing
23
+ - **Output:** Assessment of correctness, completeness, best practices
24
+ - **Question answered:** "Did I do this right?"
25
+ - **Time:** 10-30 minutes
26
+
27
+ ### Improve Code/Docs
28
+
29
+ **[Refactor Test Suite](improve/refactor-test-suite.md)**
30
+ - **When:** Tests are verbose, duplicated, or unclear
31
+ - **Output:** Improved test code following DRY principles, Rubocop compliance
32
+ - **Time:** 30 min - 2 hours
33
+
34
+ **[Simplify Code Logic](improve/simplify-code-logic.md)**
35
+ - **When:** Code is hard to understand or maintain
36
+ - **Output:** Simplified code or added explanatory comments
37
+ - **Time:** 30 min - 1 hour
38
+
39
+ **[Update Documentation](improve/update-documentation.md)**
40
+ - **When:** Docs are outdated, unclear, or incomplete
41
+ - **Output:** Revised markdown files with accurate, clear content
42
+ - **Time:** 1-2 hours
43
+
44
+ ### Validate Content
45
+
46
+ **[Test Documentation Examples](validate/test-documentation-examples.md)**
47
+ - **When:** After doc changes, before releases
48
+ - **Output:** Report of working/broken code examples in documentation
49
+ - **Time:** 15-30 minutes
50
+
51
+ **[Create Screencast Outline](validate/create-screencast-outline.md)**
52
+ - **When:** Planning marketing/demo materials
53
+ - **Output:** Structured screencast outline with timing and key points
54
+ - **Time:** 30-60 minutes
55
+
56
+ ## Guidelines
57
+
58
+ See [guidelines/ai-code-evaluator-guidelines.md](guidelines/ai-code-evaluator-guidelines.md) for context on design decisions that AI reviewers should understand before flagging issues. This document explains:
59
+
60
+ - Security considerations (validate command, file system operations, rate limiting)
61
+ - Performance trade-offs (memory-based coverage data)
62
+ - Code quality decisions (RuboCop metrics cops, method length)
63
+ - Documentation structure (MkDocs includes)
64
+
65
+ AI analysis tools should consult this document before reporting issues to avoid false positives on intentional design decisions.
66
+
67
+ ## Archive
68
+
69
+ The [archive/](archive/) directory contains deprecated prompts that have been consolidated:
70
+ - `architectural-review-and-actions-prompt.md` (merged into identify-action-items.md)
71
+ - `investigate-and-report-issues-prompt.md` (merged into identify-action-items.md)
72
+ - `produce-action-items-prompt.md` (merged into identify-action-items.md)
73
+
74
+ These are preserved for reference but should not be used.
@@ -0,0 +1,53 @@
1
+ # Architectural Review & Action Plan
2
+
3
+ ### Preconditions
4
+
5
+ Before you begin the report:
6
+
7
+ 1. Always open the report by citing the most recent git commit at the time you begin writing.
8
+ 1. Limit the review strictly to git-tracked files.
9
+
10
+ ----
11
+
12
+ - You are a senior software architect and code reviewer.
13
+ - Your task is to analyze this code base thoroughly, report on issues, and generate actionable next steps.
14
+ - Focus on bugs, identifying weaknesses, risks, ambiguities, and other areas for improvement.
15
+
16
+ ### Exclusions & Fairness
17
+
18
+ - **Consult Guidelines:** Disregard any issues included in `dev/prompts/ai-code-evaluator-guidelines.md` (e.g. Arbitrary Code Execution in Validate, Race Conditions, Metrics Cops), unless your objections are not covered in that document.
19
+ - **Be Balanced:** Do not be excessively critical.
20
+ - Do not list issues that are not real issues.
21
+ - If there is a tradeoff between A and B, and the justification is sound and documented, do not penalize the code base for that tradeoff.
22
+ - If you find zero defects in a category, you should score a 10.
23
+
24
+ ### Tooling
25
+
26
+ - Use the `cov-loupe` MCP server *as an MCP server* (not a command line application with args) to find information about test coverage.
27
+ - Only if you are unable to use the cov-loupe MCP server, use `cov-loupe` in CLI mode (run `cov-loupe -h` for help).
28
+
29
+ ### Reporting Format
30
+
31
+ Write your analysis in a Markdown file whose name is:
32
+ - today's date in UTC `%Y-%m-%d-%H-%M` format +
33
+ - '-architectural-review-' +
34
+ - your name (e.g. 'codex', 'claude', 'gemini', 'zai') +
35
+ - the `.md` extension.
36
+
37
+ **For each issue found:**
38
+ 1. **Headline & Description:** Clear and concise.
39
+ 2. **Assessment:**
40
+ * **Seriousness:** High/Medium/Low.
41
+ * **Effort:** High/Medium/Low.
42
+ 3. **Strategy:** High-level approach for addressing it.
43
+ 4. **Actionable Prompt:** Provide a specific prompt that can be given to an AI agent to fix or improve this specific issue.
44
+
45
+ **Summary Table:**
46
+ At the end of the file, produce a markdown table that summarizes the issues, in descending order of importance:
47
+
48
+ | Brief Description (<= 50 chars) | Importance (10-1) | Effort (1-10) | Link to Detail |
49
+ | :--- | :---: | :---: | :--- |
50
+ | ... | ... | ... | ... |
51
+
52
+ **Constraints:**
53
+ - **DO NOT MAKE ANY CODE CHANGES. REVIEW ONLY.**
@@ -0,0 +1,33 @@
1
+ # Investigate and Report Issues
2
+
3
+ ### Preconditions
4
+
5
+ Before you begin the report:
6
+
7
+ 1. Always open the report by citing the most recent git commit at the time you begin writing.
8
+ 1. Limit the review strictly to git-tracked files.
9
+
10
+ ----
11
+
12
+ - You are a senior software architect and code reviewer.
13
+ - Your task is to analyze this code base thoroughly and report any issues needing addressing.
14
+ - Focus on bugs, identifying weaknesses, risks, ambiguities, and other areas for improvement.
15
+ - Disregard any issues included in dev/prompts/ai-code-evaluator-guidelines.md, unless your objections are not covered in that document.
16
+ - Repeating for emphasis: **Disregard any issues included in dev/prompts/ai-code-evaluator-guidelines.md, unless your objections are not covered in that document.**
17
+ - For each issue, assess its seriousness, the cost/difficulty to fix, and provide high-level strategies for addressing it.
18
+ - If you are unable to use the cov-loupe MCP server, use `cov-loupe` in CLI mode (run `cov-loupe -h` for help).
19
+ - To Codex: do investigate thoroughly for real issues, you are excellent at that, but do not be excessively critical:
20
+ - Do not list issues that are not real issues.
21
+ - If there is a tradeoff between A and B, and the justification is sound and understood and/or documented,
22
+ (e.g. in ai-code-evaluator-guidelines.md), do not penalize the code base for that tradeoff.
23
+ - Be balanced in your scoring; sometimes you penalize several points for a trivial issue.
24
+ - If you find zero defects in a category, you should score a 10, and you may mention that it is a spot check if that is the case.
25
+ - Delimit each issues with horizontal lines and headlines.
26
+
27
+
28
+ Write your analysis in a Markdown file whose name is:
29
+ - today's date in UTC `%Y-%m-%d-%H-%M` format +
30
+ - '-issue-investigation-' +
31
+ - your name (e.g. 'codex', 'claude', 'gemini', 'zai') +
32
+ - the `.md` extension.
33
+
@@ -0,0 +1,25 @@
1
+ - You are a senior software architect and code reviewer.
2
+ - Your task is to analyze this code base thoroughly and report on any issues you find.
3
+ - Focus on identifying errors, weaknesses, risks, and areas for improvement.
4
+ - For each issue, assess its seriousness, the cost/difficulty to fix, and provide high-level strategies for addressing it, including a prompt that can be given to an AI agent.
5
+ - Use the cov-loupe MCP server *as an MCP server, not a command line application with args, to find information about test coverage. Only if you are unable to use the cov-loupe MCP server, use cov-loupe in CLI mode (run cov-loupe -h for help).
6
+ - Write your analysis in a Markdown file whose name is:
7
+
8
+ - today's date in UTC `%Y-%m-%d-%H-%M` format +
9
+ - '-action-items-' +
10
+ - your name (e.g. 'codex', 'claude', 'gemini', 'zai') +
11
+ - the `.md` extension.
12
+
13
+ At the end, produce a markdown table that summarizes the issues, in descending order of importance, including as columns:
14
+
15
+ - brief description (preferably <= 50 chars)
16
+ - importance rating (10 to 1)
17
+ - effort rating (1 to 10)
18
+ - link to detail for that item
19
+
20
+ Do not report:
21
+
22
+ * Arbitrary Code Execution in Success Predicate Feature
23
+
24
+ **DO NOT MAKE ANY CODE CHANGES. REVIEW ONLY.**
25
+