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.
- checksums.yaml +4 -4
- data/AGENTS.md +230 -0
- data/CLAUDE.md +5 -0
- data/CODE_OF_CONDUCT.md +62 -0
- data/CONTRIBUTING.md +102 -0
- data/GEMINI.md +5 -0
- data/README.md +154 -51
- data/RELEASE_NOTES.md +452 -0
- data/dev/images/cov-loupe-icon-lores.png +0 -0
- data/dev/images/cov-loupe-icon-square.png +0 -0
- data/dev/images/cov-loupe-icon.png +0 -0
- data/dev/images/cov-loupe-logo.png +0 -0
- data/dev/prompts/README.md +74 -0
- data/dev/prompts/archive/architectural-review-and-actions-prompt.md +53 -0
- data/dev/prompts/archive/investigate-and-report-issues-prompt.md +33 -0
- data/dev/prompts/archive/produce-action-items-prompt.md +25 -0
- data/dev/prompts/guidelines/ai-code-evaluator-guidelines.md +337 -0
- data/dev/prompts/improve/refactor-test-suite.md +18 -0
- data/dev/prompts/improve/simplify-code-logic.md +133 -0
- data/dev/prompts/improve/update-documentation.md +21 -0
- data/dev/prompts/review/comprehensive-codebase-review.md +176 -0
- data/dev/prompts/review/identify-action-items.md +143 -0
- data/dev/prompts/review/verify-code-changes.md +54 -0
- data/dev/prompts/validate/create-screencast-outline.md +234 -0
- data/dev/prompts/validate/test-documentation-examples.md +180 -0
- data/docs/QUICKSTART.md +63 -0
- data/docs/assets/images/cov-loupe-logo-lores.png +0 -0
- data/docs/assets/images/cov-loupe-logo.png +0 -0
- data/docs/assets/images/favicon.png +0 -0
- data/docs/assets/stylesheets/branding.css +16 -0
- data/docs/assets/stylesheets/extra.css +15 -0
- data/docs/code_of_conduct.md +1 -0
- data/docs/contributing.md +1 -0
- data/docs/dev/ARCHITECTURE.md +56 -11
- data/docs/dev/DEVELOPMENT.md +116 -12
- data/docs/dev/FUTURE_ENHANCEMENTS.md +14 -0
- data/docs/dev/README.md +3 -2
- data/docs/dev/RELEASING.md +2 -0
- data/docs/dev/arch-decisions/README.md +10 -7
- data/docs/dev/arch-decisions/application-architecture.md +259 -0
- data/docs/dev/arch-decisions/coverage-data-quality.md +193 -0
- data/docs/dev/arch-decisions/output-character-mode.md +217 -0
- data/docs/dev/arch-decisions/path-resolution.md +90 -0
- data/docs/dev/arch-decisions/{004-x-arch-decision.md → policy-validation.md} +32 -28
- data/docs/dev/arch-decisions/{005-x-arch-decision.md → simplecov-integration.md} +47 -44
- data/docs/dev/presentations/cov-loupe-presentation.md +15 -13
- data/docs/examples/mcp-inputs.md +3 -0
- data/docs/examples/prompts.md +3 -0
- data/docs/examples/success_predicates.md +3 -0
- data/docs/fixtures/demo_project/.resultset.json +170 -0
- data/docs/fixtures/demo_project/README.md +6 -0
- data/docs/fixtures/demo_project/app/controllers/admin/audit_logs_controller.rb +19 -0
- data/docs/fixtures/demo_project/app/controllers/orders_controller.rb +26 -0
- data/docs/fixtures/demo_project/app/models/order.rb +20 -0
- data/docs/fixtures/demo_project/app/models/user.rb +19 -0
- data/docs/fixtures/demo_project/lib/api/client.rb +22 -0
- data/docs/fixtures/demo_project/lib/ops/jobs/cleanup_job.rb +16 -0
- data/docs/fixtures/demo_project/lib/ops/jobs/report_job.rb +17 -0
- data/docs/fixtures/demo_project/lib/payments/processor.rb +15 -0
- data/docs/fixtures/demo_project/lib/payments/refund_service.rb +15 -0
- data/docs/fixtures/demo_project/lib/payments/reporting/exporter.rb +16 -0
- data/docs/index.md +1 -0
- data/docs/license.md +3 -0
- data/docs/release_notes.md +3 -0
- data/docs/user/ADVANCED_USAGE.md +208 -115
- data/docs/user/CLI_FALLBACK_FOR_LLMS.md +2 -0
- data/docs/user/CLI_USAGE.md +276 -101
- data/docs/user/ERROR_HANDLING.md +4 -4
- data/docs/user/EXAMPLES.md +121 -128
- data/docs/user/INSTALLATION.md +9 -28
- data/docs/user/LIBRARY_API.md +227 -122
- data/docs/user/MCP_INTEGRATION.md +114 -203
- data/docs/user/README.md +5 -1
- data/docs/user/TROUBLESHOOTING.md +49 -27
- data/docs/user/installing-a-prelease-version-of-covloupe.md +43 -0
- data/docs/user/{V2-BREAKING-CHANGES.md → migrations/MIGRATING_TO_V2.md} +62 -72
- data/docs/user/migrations/MIGRATING_TO_V3.md +72 -0
- data/docs/user/migrations/MIGRATING_TO_V4.md +591 -0
- data/docs/user/migrations/README.md +22 -0
- data/docs/user/prompts/README.md +9 -0
- data/docs/user/prompts/non-web-coverage-analysis-prompt.md +103 -0
- data/docs/user/prompts/rails-coverage-analysis-prompt.md +94 -0
- data/docs/user/prompts/use-cli-not-mcp-prompt.md +53 -0
- data/examples/cli_demo.sh +77 -0
- data/examples/filter_and_table_demo-output.md +114 -0
- data/examples/filter_and_table_demo.rb +174 -0
- data/examples/fixtures/demo_project/coverage/.resultset.json +10 -0
- data/examples/mcp-inputs/README.md +66 -0
- data/examples/mcp-inputs/coverage_detailed.json +1 -0
- data/examples/mcp-inputs/coverage_raw.json +1 -0
- data/examples/mcp-inputs/coverage_summary.json +1 -0
- data/examples/mcp-inputs/list.json +1 -0
- data/examples/mcp-inputs/uncovered_lines.json +1 -0
- data/examples/prompts/README.md +27 -0
- data/examples/prompts/custom_resultset.txt +2 -0
- data/examples/prompts/detailed_with_source.txt +2 -0
- data/examples/prompts/list_lowest.txt +2 -0
- data/examples/prompts/summary.txt +2 -0
- data/examples/prompts/uncovered.txt +2 -0
- data/examples/success_predicates/README.md +198 -0
- data/examples/success_predicates/all_files_above_threshold_predicate.rb +21 -0
- data/examples/success_predicates/directory_specific_thresholds_predicate.rb +30 -0
- data/examples/success_predicates/project_coverage_minimum_predicate.rb +6 -0
- data/lib/cov_loupe/base_tool.rb +229 -20
- data/lib/cov_loupe/cli.rb +132 -23
- data/lib/cov_loupe/commands/base_command.rb +25 -6
- data/lib/cov_loupe/commands/command_factory.rb +0 -1
- data/lib/cov_loupe/commands/detailed_command.rb +10 -5
- data/lib/cov_loupe/commands/list_command.rb +2 -1
- data/lib/cov_loupe/commands/raw_command.rb +7 -5
- data/lib/cov_loupe/commands/summary_command.rb +12 -7
- data/lib/cov_loupe/commands/totals_command.rb +74 -10
- data/lib/cov_loupe/commands/uncovered_command.rb +7 -5
- data/lib/cov_loupe/commands/validate_command.rb +11 -3
- data/lib/cov_loupe/commands/version_command.rb +6 -4
- data/lib/cov_loupe/{app_config.rb → config/app_config.rb} +13 -5
- data/lib/cov_loupe/config/app_context.rb +43 -0
- data/lib/cov_loupe/config/boolean_type.rb +91 -0
- data/lib/cov_loupe/config/logger.rb +92 -0
- data/lib/cov_loupe/{option_normalizers.rb → config/option_normalizers.rb} +55 -24
- data/lib/cov_loupe/{option_parser_builder.rb → config/option_parser_builder.rb} +46 -24
- data/lib/cov_loupe/coverage/coverage_calculator.rb +53 -0
- data/lib/cov_loupe/coverage/coverage_reporter.rb +63 -0
- data/lib/cov_loupe/coverage/coverage_table_formatter.rb +133 -0
- data/lib/cov_loupe/{error_handler.rb → errors/error_handler.rb} +21 -33
- data/lib/cov_loupe/{errors.rb → errors/errors.rb} +48 -71
- data/lib/cov_loupe/formatters/formatters.rb +75 -0
- data/lib/cov_loupe/formatters/source_formatter.rb +18 -7
- data/lib/cov_loupe/formatters/table_formatter.rb +80 -0
- data/lib/cov_loupe/loaders/all.rb +15 -0
- data/lib/cov_loupe/loaders/all_cli.rb +10 -0
- data/lib/cov_loupe/loaders/all_mcp.rb +23 -0
- data/lib/cov_loupe/loaders/resultset_loader.rb +147 -0
- data/lib/cov_loupe/mcp_server.rb +3 -2
- data/lib/cov_loupe/model/model.rb +520 -0
- data/lib/cov_loupe/model/model_data.rb +13 -0
- data/lib/cov_loupe/model/model_data_cache.rb +116 -0
- data/lib/cov_loupe/option_parsers/env_options_parser.rb +17 -6
- data/lib/cov_loupe/option_parsers/error_helper.rb +16 -10
- data/lib/cov_loupe/output_chars.rb +192 -0
- data/lib/cov_loupe/paths/glob_utils.rb +100 -0
- data/lib/cov_loupe/{path_relativizer.rb → paths/path_relativizer.rb} +5 -13
- data/lib/cov_loupe/paths/path_utils.rb +265 -0
- data/lib/cov_loupe/paths/volume_case_sensitivity.rb +173 -0
- data/lib/cov_loupe/presenters/base_coverage_presenter.rb +9 -13
- data/lib/cov_loupe/presenters/coverage_payload_presenter.rb +21 -0
- data/lib/cov_loupe/presenters/payload_caching.rb +23 -0
- data/lib/cov_loupe/presenters/project_coverage_presenter.rb +73 -21
- data/lib/cov_loupe/presenters/project_totals_presenter.rb +16 -10
- data/lib/cov_loupe/repositories/coverage_repository.rb +149 -0
- data/lib/cov_loupe/resolvers/coverage_line_resolver.rb +90 -76
- data/lib/cov_loupe/resolvers/{resolver_factory.rb → resolver_helpers.rb} +6 -5
- data/lib/cov_loupe/resolvers/resultset_path_resolver.rb +40 -12
- data/lib/cov_loupe/scripts/command_execution.rb +113 -0
- data/lib/cov_loupe/scripts/latest_ci_status.rb +97 -0
- data/lib/cov_loupe/scripts/pre_release_check.rb +164 -0
- data/lib/cov_loupe/scripts/setup_doc_server.rb +23 -0
- data/lib/cov_loupe/scripts/start_doc_server.rb +24 -0
- data/lib/cov_loupe/staleness/stale_status.rb +23 -0
- data/lib/cov_loupe/staleness/staleness_checker.rb +328 -0
- data/lib/cov_loupe/staleness/staleness_message_formatter.rb +91 -0
- data/lib/cov_loupe/tools/coverage_detailed_tool.rb +14 -15
- data/lib/cov_loupe/tools/coverage_raw_tool.rb +14 -14
- data/lib/cov_loupe/tools/coverage_summary_tool.rb +16 -16
- data/lib/cov_loupe/tools/coverage_table_tool.rb +139 -21
- data/lib/cov_loupe/tools/coverage_totals_tool.rb +31 -13
- data/lib/cov_loupe/tools/help_tool.rb +16 -20
- data/lib/cov_loupe/tools/list_tool.rb +65 -0
- data/lib/cov_loupe/tools/uncovered_lines_tool.rb +14 -14
- data/lib/cov_loupe/tools/validate_tool.rb +18 -24
- data/lib/cov_loupe/tools/version_tool.rb +8 -3
- data/lib/cov_loupe/version.rb +1 -1
- data/lib/cov_loupe.rb +83 -55
- metadata +184 -154
- data/docs/dev/BRANCH_ONLY_COVERAGE.md +0 -158
- data/docs/dev/arch-decisions/001-x-arch-decision.md +0 -95
- data/docs/dev/arch-decisions/002-x-arch-decision.md +0 -159
- data/docs/dev/arch-decisions/003-x-arch-decision.md +0 -165
- data/lib/cov_loupe/app_context.rb +0 -26
- data/lib/cov_loupe/constants.rb +0 -22
- data/lib/cov_loupe/coverage_reporter.rb +0 -31
- data/lib/cov_loupe/formatters.rb +0 -51
- data/lib/cov_loupe/mode_detector.rb +0 -56
- data/lib/cov_loupe/model.rb +0 -339
- data/lib/cov_loupe/presenters/coverage_detailed_presenter.rb +0 -14
- data/lib/cov_loupe/presenters/coverage_raw_presenter.rb +0 -14
- data/lib/cov_loupe/presenters/coverage_summary_presenter.rb +0 -14
- data/lib/cov_loupe/presenters/coverage_uncovered_presenter.rb +0 -14
- data/lib/cov_loupe/resultset_loader.rb +0 -131
- data/lib/cov_loupe/staleness_checker.rb +0 -247
- data/lib/cov_loupe/table_formatter.rb +0 -64
- data/lib/cov_loupe/tools/all_files_coverage_tool.rb +0 -51
- data/lib/cov_loupe/util.rb +0 -88
- data/spec/MCP_INTEGRATION_TESTS_README.md +0 -111
- data/spec/TIMESTAMPS.md +0 -48
- data/spec/all_files_coverage_tool_spec.rb +0 -53
- data/spec/app_config_spec.rb +0 -142
- data/spec/base_tool_spec.rb +0 -62
- data/spec/cli/show_default_report_spec.rb +0 -33
- data/spec/cli_enumerated_options_spec.rb +0 -90
- data/spec/cli_error_spec.rb +0 -184
- data/spec/cli_format_spec.rb +0 -123
- data/spec/cli_json_options_spec.rb +0 -50
- data/spec/cli_source_spec.rb +0 -44
- data/spec/cli_spec.rb +0 -192
- data/spec/cli_table_spec.rb +0 -28
- data/spec/cli_usage_spec.rb +0 -42
- data/spec/commands/base_command_spec.rb +0 -107
- data/spec/commands/command_factory_spec.rb +0 -76
- data/spec/commands/detailed_command_spec.rb +0 -34
- data/spec/commands/list_command_spec.rb +0 -28
- data/spec/commands/raw_command_spec.rb +0 -69
- data/spec/commands/summary_command_spec.rb +0 -34
- data/spec/commands/totals_command_spec.rb +0 -34
- data/spec/commands/uncovered_command_spec.rb +0 -55
- data/spec/commands/validate_command_spec.rb +0 -213
- data/spec/commands/version_command_spec.rb +0 -38
- data/spec/constants_spec.rb +0 -61
- data/spec/cov_loupe/formatters/source_formatter_spec.rb +0 -267
- data/spec/cov_loupe/formatters_spec.rb +0 -76
- data/spec/cov_loupe/presenters/base_coverage_presenter_spec.rb +0 -79
- data/spec/cov_loupe_model_spec.rb +0 -454
- data/spec/cov_loupe_module_spec.rb +0 -37
- data/spec/cov_loupe_opts_spec.rb +0 -185
- data/spec/coverage_reporter_spec.rb +0 -102
- data/spec/coverage_table_tool_spec.rb +0 -59
- data/spec/coverage_totals_tool_spec.rb +0 -37
- data/spec/error_handler_spec.rb +0 -197
- data/spec/error_mode_spec.rb +0 -139
- data/spec/errors_edge_cases_spec.rb +0 -312
- data/spec/errors_stale_spec.rb +0 -83
- data/spec/file_based_mcp_tools_spec.rb +0 -99
- data/spec/help_tool_spec.rb +0 -26
- data/spec/integration_spec.rb +0 -789
- data/spec/logging_fallback_spec.rb +0 -128
- data/spec/mcp_logging_spec.rb +0 -44
- data/spec/mcp_server_integration_spec.rb +0 -23
- data/spec/mcp_server_spec.rb +0 -106
- data/spec/mode_detector_spec.rb +0 -153
- data/spec/model_error_handling_spec.rb +0 -269
- data/spec/model_staleness_spec.rb +0 -79
- data/spec/option_normalizers_spec.rb +0 -203
- data/spec/option_parsers/env_options_parser_spec.rb +0 -221
- data/spec/option_parsers/error_helper_spec.rb +0 -222
- data/spec/path_relativizer_spec.rb +0 -98
- data/spec/presenters/coverage_detailed_presenter_spec.rb +0 -19
- data/spec/presenters/coverage_raw_presenter_spec.rb +0 -15
- data/spec/presenters/coverage_summary_presenter_spec.rb +0 -15
- data/spec/presenters/coverage_uncovered_presenter_spec.rb +0 -16
- data/spec/presenters/project_coverage_presenter_spec.rb +0 -87
- data/spec/presenters/project_totals_presenter_spec.rb +0 -144
- data/spec/resolvers/coverage_line_resolver_spec.rb +0 -282
- data/spec/resolvers/resolver_factory_spec.rb +0 -61
- data/spec/resolvers/resultset_path_resolver_spec.rb +0 -60
- data/spec/resultset_loader_spec.rb +0 -167
- data/spec/shared_examples/README.md +0 -115
- data/spec/shared_examples/coverage_presenter_examples.rb +0 -66
- data/spec/shared_examples/file_based_mcp_tools.rb +0 -179
- data/spec/shared_examples/formatted_command_examples.rb +0 -64
- data/spec/shared_examples/mcp_tool_text_json_response.rb +0 -16
- data/spec/spec_helper.rb +0 -127
- data/spec/staleness_checker_spec.rb +0 -374
- data/spec/staleness_more_spec.rb +0 -42
- data/spec/support/cli_helpers.rb +0 -22
- data/spec/support/control_flow_helpers.rb +0 -20
- data/spec/support/fake_mcp.rb +0 -40
- data/spec/support/io_helpers.rb +0 -29
- data/spec/support/mcp_helpers.rb +0 -35
- data/spec/support/mcp_runner.rb +0 -66
- data/spec/support/mocking_helpers.rb +0 -30
- data/spec/table_format_spec.rb +0 -70
- data/spec/tools/validate_tool_spec.rb +0 -132
- data/spec/tools_error_handling_spec.rb +0 -130
- data/spec/util_spec.rb +0 -154
- data/spec/version_spec.rb +0 -123
- data/spec/version_tool_spec.rb +0 -141
- /data/{spec/fixtures/project1 → examples/fixtures/demo_project}/lib/bar.rb +0 -0
- /data/{spec/fixtures/project1 → examples/fixtures/demo_project}/lib/foo.rb +0 -0
- /data/lib/cov_loupe/{config_parser.rb → config/config_parser.rb} +0 -0
- /data/lib/cov_loupe/{predicate_evaluator.rb → config/predicate_evaluator.rb} +0 -0
- /data/lib/cov_loupe/{error_handler_factory.rb → errors/error_handler_factory.rb} +0 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Test Documentation Examples
|
|
2
|
+
|
|
3
|
+
**Purpose:** Verify that all command examples in documentation work correctly and produce expected outputs.
|
|
4
|
+
|
|
5
|
+
## When to Use This
|
|
6
|
+
|
|
7
|
+
- After making documentation changes
|
|
8
|
+
- Before releases
|
|
9
|
+
- After CLI or API changes that might affect examples
|
|
10
|
+
- When suspecting docs are out of sync with code
|
|
11
|
+
|
|
12
|
+
## Scope
|
|
13
|
+
|
|
14
|
+
### Files to Test
|
|
15
|
+
|
|
16
|
+
Run all command examples found in:
|
|
17
|
+
- `README.md`
|
|
18
|
+
- `docs/user/**/*.md`
|
|
19
|
+
- `docs/dev/**/*.md`
|
|
20
|
+
|
|
21
|
+
### Files to Exclude
|
|
22
|
+
|
|
23
|
+
Do NOT test examples in:
|
|
24
|
+
- `docs/dev/arch-decisions/**/*.md`
|
|
25
|
+
- `docs/dev/presentations/**/*.md`
|
|
26
|
+
|
|
27
|
+
## Process
|
|
28
|
+
|
|
29
|
+
### 1. Extract Command Examples
|
|
30
|
+
|
|
31
|
+
Identify all code blocks that contain executable commands:
|
|
32
|
+
- Bash/shell commands
|
|
33
|
+
- CLI invocations
|
|
34
|
+
- Code that should produce specific output
|
|
35
|
+
|
|
36
|
+
Look for:
|
|
37
|
+
- Code blocks marked with `bash`, `sh`, `shell`, or `console`
|
|
38
|
+
- Inline code that appears to be runnable commands
|
|
39
|
+
- Example command outputs
|
|
40
|
+
|
|
41
|
+
### 2. Test Each Command
|
|
42
|
+
|
|
43
|
+
For each command found:
|
|
44
|
+
|
|
45
|
+
1. **Set up environment** (if needed):
|
|
46
|
+
- Install dependencies
|
|
47
|
+
- Create test files/fixtures
|
|
48
|
+
- Set environment variables
|
|
49
|
+
|
|
50
|
+
2. **Execute the command** in an appropriate context:
|
|
51
|
+
- Use the correct working directory
|
|
52
|
+
- Ensure required files exist
|
|
53
|
+
- Handle commands that require specific prerequisites
|
|
54
|
+
|
|
55
|
+
3. **Verify output**:
|
|
56
|
+
- Check exit code (0 for success unless failure is expected)
|
|
57
|
+
- Compare actual output with documented output
|
|
58
|
+
- Verify expected files are created
|
|
59
|
+
- Check for error messages if shown in docs
|
|
60
|
+
|
|
61
|
+
4. **Clean up** (if needed):
|
|
62
|
+
- Remove temporary files
|
|
63
|
+
- Reset environment
|
|
64
|
+
|
|
65
|
+
### 3. Document Failures
|
|
66
|
+
|
|
67
|
+
For each failing example, record:
|
|
68
|
+
|
|
69
|
+
- **File:** Which documentation file contains the failing example
|
|
70
|
+
- **Line/Section:** Where in the file (approximate line or section heading)
|
|
71
|
+
- **Command:** The exact command that failed
|
|
72
|
+
- **Expected:** What the documentation shows should happen
|
|
73
|
+
- **Actual:** What actually happened
|
|
74
|
+
- **Error:** Any error messages
|
|
75
|
+
- **Suggested Fix:** How to correct the documentation or code
|
|
76
|
+
|
|
77
|
+
## Common Issues to Check
|
|
78
|
+
|
|
79
|
+
### Syntax Changes
|
|
80
|
+
- Command options that have changed (`--old-flag` → `--new-flag`)
|
|
81
|
+
- Subcommands that have been renamed or removed
|
|
82
|
+
- New required parameters
|
|
83
|
+
|
|
84
|
+
### Path Assumptions
|
|
85
|
+
- Commands that assume specific working directories
|
|
86
|
+
- Relative vs absolute paths
|
|
87
|
+
- File paths that may not exist in all environments
|
|
88
|
+
|
|
89
|
+
### Output Format Changes
|
|
90
|
+
- JSON structure changes
|
|
91
|
+
- Table column changes
|
|
92
|
+
- Different error message text
|
|
93
|
+
|
|
94
|
+
### Prerequisites
|
|
95
|
+
- Missing setup steps (e.g., "First run X before running Y")
|
|
96
|
+
- Undocumented dependencies
|
|
97
|
+
- Configuration that must be set
|
|
98
|
+
|
|
99
|
+
### Version-Specific Examples
|
|
100
|
+
- Examples that only work with specific versions
|
|
101
|
+
- Deprecated features still documented
|
|
102
|
+
|
|
103
|
+
## Output Format
|
|
104
|
+
|
|
105
|
+
### If All Examples Pass
|
|
106
|
+
|
|
107
|
+
Briefly report success:
|
|
108
|
+
```
|
|
109
|
+
Tested X command examples across Y documentation files.
|
|
110
|
+
All examples executed successfully.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### If Examples Fail
|
|
114
|
+
|
|
115
|
+
Create a detailed report with:
|
|
116
|
+
|
|
117
|
+
```markdown
|
|
118
|
+
# Documentation Example Test Results
|
|
119
|
+
|
|
120
|
+
**Date:** YYYY-MM-DD
|
|
121
|
+
**Tested Files:** X
|
|
122
|
+
**Total Examples:** Y
|
|
123
|
+
**Failed:** Z
|
|
124
|
+
|
|
125
|
+
## Failures
|
|
126
|
+
|
|
127
|
+
### README.md
|
|
128
|
+
|
|
129
|
+
#### Line 42: cov-loupe list command
|
|
130
|
+
**Command:**
|
|
131
|
+
\`\`\`bash
|
|
132
|
+
cov-loupe list --format json
|
|
133
|
+
\`\`\`
|
|
134
|
+
|
|
135
|
+
**Expected:**
|
|
136
|
+
JSON output with coverage data
|
|
137
|
+
|
|
138
|
+
**Actual:**
|
|
139
|
+
```
|
|
140
|
+
Error: unknown option '--format'
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
**Issue:**
|
|
144
|
+
The `--format` flag has been replaced with `-f` or `--output-format`
|
|
145
|
+
|
|
146
|
+
**Suggested Fix:**
|
|
147
|
+
Update documentation to use:
|
|
148
|
+
\`\`\`bash
|
|
149
|
+
cov-loupe list --output-format json
|
|
150
|
+
\`\`\`
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### docs/user/getting-started.md
|
|
155
|
+
|
|
156
|
+
#### Line 78: Running with custom resultset
|
|
157
|
+
|
|
158
|
+
... (continue for each failure)
|
|
159
|
+
|
|
160
|
+
## Summary
|
|
161
|
+
|
|
162
|
+
- Update format flag in README.md line 42
|
|
163
|
+
- Add missing setup step in getting-started.md before line 78
|
|
164
|
+
- Fix output example in advanced-usage.md line 156 (JSON structure changed)
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Notes
|
|
168
|
+
|
|
169
|
+
- **Don't modify code:** This is a validation task, not a fix task. Document what needs changing.
|
|
170
|
+
- **Test in clean environment:** If possible, test in a fresh environment to catch missing setup steps.
|
|
171
|
+
- **Check both success and failure examples:** If documentation shows an error example, verify it produces that error.
|
|
172
|
+
- **Version compatibility:** Note if examples only work with specific versions.
|
|
173
|
+
|
|
174
|
+
## Follow-Up Actions
|
|
175
|
+
|
|
176
|
+
After identifying failures:
|
|
177
|
+
1. Create issues for documentation fixes
|
|
178
|
+
2. Update documentation files
|
|
179
|
+
3. Consider adding automated tests for critical examples
|
|
180
|
+
4. Re-run this validation after fixes
|
data/docs/QUICKSTART.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Quick Start
|
|
2
|
+
|
|
3
|
+
[Back to main README](index.md)
|
|
4
|
+
|
|
5
|
+
Get up and running with cov-loupe in 3 steps.
|
|
6
|
+
|
|
7
|
+
## 1. Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
gem install cov-loupe
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 2. Generate Coverage
|
|
14
|
+
|
|
15
|
+
Run your test suite with SimpleCov enabled:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
bundle exec rspec # or your test command
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This creates `coverage/.resultset.json`.
|
|
22
|
+
|
|
23
|
+
## 3. View Coverage
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
cov-loupe
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
You'll see a table showing coverage for each file, sorted by highest coverage first (lowest at the bottom).
|
|
30
|
+
|
|
31
|
+
## Common Commands
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
# Check a specific file
|
|
35
|
+
cov-loupe summary lib/my_file.rb
|
|
36
|
+
|
|
37
|
+
# See uncovered lines
|
|
38
|
+
cov-loupe uncovered lib/my_file.rb
|
|
39
|
+
|
|
40
|
+
# Get overall project stats
|
|
41
|
+
cov-loupe totals
|
|
42
|
+
|
|
43
|
+
# View all commands
|
|
44
|
+
cov-loupe --help
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Next Steps
|
|
48
|
+
|
|
49
|
+
- **[Installation Guide](user/INSTALLATION.md)** - Platform-specific setup, environment variables
|
|
50
|
+
- **[CLI Usage](user/CLI_USAGE.md)** - Complete command reference
|
|
51
|
+
- **[Examples](user/EXAMPLES.md)** - Common workflows and recipes
|
|
52
|
+
- **[MCP Integration](user/MCP_INTEGRATION.md)** - Connect to AI assistants (Claude, ChatGPT)
|
|
53
|
+
- **[Troubleshooting](user/TROUBLESHOOTING.md)** - Common issues and solutions
|
|
54
|
+
|
|
55
|
+
## Integration with AI Assistants
|
|
56
|
+
|
|
57
|
+
If you're using Claude Code, ChatGPT, or another MCP-compatible assistant:
|
|
58
|
+
|
|
59
|
+
1. Install the MCP server (see [MCP Integration Guide](user/MCP_INTEGRATION.md))
|
|
60
|
+
2. Use ready-made prompts from [Prompt Library](user/prompts/README.md)
|
|
61
|
+
3. Let AI analyze your coverage and suggest improvements
|
|
62
|
+
|
|
63
|
+
[Back to main README](index.md)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/* Increase logo size */
|
|
2
|
+
.md-header__button.md-logo img,
|
|
3
|
+
.md-header__button.md-logo svg {
|
|
4
|
+
height: 2.8rem; /* Increased from default */
|
|
5
|
+
width: auto;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/* Adjust header title to accommodate larger logo */
|
|
9
|
+
.md-header__title {
|
|
10
|
+
margin-left: 0.5rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Optional: Add a subtle hover effect to the logo */
|
|
14
|
+
.md-header__button.md-logo:hover {
|
|
15
|
+
opacity: 0.8;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* Enhance code blocks */
|
|
2
|
+
.highlight {
|
|
3
|
+
border-radius: 0.2rem;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
/* Improve table styling */
|
|
7
|
+
table {
|
|
8
|
+
border-radius: 0.2rem;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/* Add subtle shadows to content cards */
|
|
13
|
+
.md-content {
|
|
14
|
+
box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.05);
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include-markdown "../CODE_OF_CONDUCT.md" %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{% include-markdown "../CONTRIBUTING.md" %}
|
data/docs/dev/ARCHITECTURE.md
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
# Architecture
|
|
2
2
|
|
|
3
|
-
[Back to main README](../README.md)
|
|
3
|
+
[Back to main README](../index.md) | [Architecture Decision Records](arch-decisions/README.md)
|
|
4
4
|
|
|
5
5
|
cov-loupe is organized around a single coverage data model that feeds three delivery channels: a command-line interface, an MCP server for LLM agents, and a light-weight Ruby API. The codebase is intentionally modular—shared logic for loading, normalizing, and validating SimpleCov data lives in `lib/cov_loupe/`, while adapters wrap that core for each runtime mode.
|
|
6
6
|
|
|
7
7
|
## Runtime Entry Points
|
|
8
8
|
|
|
9
9
|
- **Executable** – `exe/cov-loupe` bootstraps the gem, enforces Ruby >= 3.2, and delegates to `CovLoupe.run(ARGV)`.
|
|
10
|
-
- **Mode Negotiation** – `CovLoupe.run` inspects environment defaults from `COV_LOUPE_OPTS
|
|
10
|
+
- **Mode Negotiation** – `CovLoupe.run` inspects environment defaults from `COV_LOUPE_OPTS` and parses the `-m/--mode` flag. It defaults to CLI mode and instantiates `CovLoupe::CoverageCLI`. When `-m mcp` or `--mode mcp` is specified, it instantiates `CovLoupe::MCPServer` for MCP protocol communication over STDIO.
|
|
11
11
|
- **Embedded Usage** – Applications embed the gem by instantiating `CovLoupe::CoverageModel` directly, optionally wrapping work in `CovLoupe.with_context` to install a library-oriented error handler.
|
|
12
12
|
|
|
13
13
|
## Coverage Data Pipeline
|
|
14
14
|
|
|
15
|
-
1. **Resultset discovery** – The tool locates the `.resultset.json` file by checking a series of default paths or by using a path specified by the user. For a detailed explanation of the configuration options, see the [Configuring the Resultset](../
|
|
15
|
+
1. **Resultset discovery** – The tool locates the `.resultset.json` file by checking a series of default paths or by using a path specified by the user. For a detailed explanation of the configuration options, see the [Configuring the Resultset](../index.md#configuring-the-resultset) section in the main README.
|
|
16
16
|
2. **Parsing and normalization** – `CoverageModel` loads the chosen resultset once, extracts all test suites that expose `coverage` data (e.g., "RSpec", "Minitest"), merges them if multiple suites exist, and maps all file keys to absolute paths anchored at the configured project root. Timestamps are cached for staleness checks.
|
|
17
|
-
3. **Path relativizing** – `PathRelativizer` produces relative paths for user-facing payloads without mutating the canonical data. Tool responses pass through `CoverageModel#relativize` before leaving the process.
|
|
17
|
+
3. **Path relativizing** – `PathRelativizer` (powered by the centralized `PathUtils` module) produces relative paths for user-facing payloads without mutating the canonical data. Tool responses pass through `CoverageModel#relativize` before leaving the process.
|
|
18
18
|
4. **Derived metrics** – `CovUtil.summary`, `CovUtil.uncovered`, and `CovUtil.detailed` compute coverage stats from the raw `lines` arrays. `CoverageModel` exposes `summary_for`, `uncovered_for`, `detailed_for`, and `raw_for` helpers that wrap these utilities.
|
|
19
|
-
5. **Staleness detection** – `StalenessChecker` compares source mtimes/line counts to coverage metadata. CLI flags and MCP arguments can promote warnings to hard failures (`--
|
|
19
|
+
5. **Staleness detection** – `StalenessChecker` compares source mtimes/line counts to coverage metadata. CLI flags and MCP arguments can promote warnings to hard failures (`--raise-on-stale true`) or simply mark rows as stale for display.
|
|
20
20
|
|
|
21
21
|
## Interfaces
|
|
22
22
|
|
|
23
23
|
### CLI (`CovLoupe::CoverageCLI`)
|
|
24
24
|
|
|
25
|
-
- Builds on Ruby’s `OptionParser`, with global options such as `--resultset`, `--
|
|
25
|
+
- Builds on Ruby’s `OptionParser`, with global options such as `--resultset`, `--raise-on-stale`, `-fJ`, and `--source` modes.
|
|
26
26
|
- Subcommands (`list`, `summary`, `raw`, `uncovered`, `detailed`, `version`) translate to calls on `CoverageModel`.
|
|
27
27
|
- Uses `ErrorHandlerFactory.for_cli` to convert unexpected exceptions into friendly user messages while honoring `--error-mode`.
|
|
28
28
|
- Formatting logic (tables, JSON) lives in the model to keep presentation consistent with MCP responses.
|
|
@@ -30,7 +30,8 @@ cov-loupe is organized around a single coverage data model that feeds three deli
|
|
|
30
30
|
### MCP Server (`CovLoupe::MCPServer`)
|
|
31
31
|
|
|
32
32
|
- Assembles a list of tool classes and mounts them in `MCP::Server` using STDIO transport.
|
|
33
|
-
- Relies on the same core model; each
|
|
33
|
+
- Relies on the same core model; each MCP request creates a fresh `CoverageModel` instance, but the underlying coverage data is cached in a global `ModelDataCache` singleton. The cache automatically reloads when the resultset file changes (validated via file signature: mtime, subsecond mtime, size, inode, and MD5 digest).
|
|
34
|
+
- Configuration precedence in MCP: per-request JSON parameters override CLI arguments passed when the server starts (including `COV_LOUPE_OPTS`), which in turn override built-in defaults.
|
|
34
35
|
- Error handling delegates to `BaseTool.handle_mcp_error`, which swaps in the MCP-specific handler and emits `MCP::Tool::Response` objects.
|
|
35
36
|
|
|
36
37
|
### Library API
|
|
@@ -41,7 +42,7 @@ cov-loupe is organized around a single coverage data model that feeds three deli
|
|
|
41
42
|
## MCP Tool Stack
|
|
42
43
|
|
|
43
44
|
- `CovLoupe::BaseTool` centralizes JSON schema definitions, error conversion, and response serialization for the MCP protocol.
|
|
44
|
-
- Individual tools reside in `lib/cov_loupe/tools/` and follow a consistent shape: define an input schema, call into `CoverageModel`, then serialize via `respond_json`. Examples include `
|
|
45
|
+
- Individual tools reside in `lib/cov_loupe/tools/` and follow a consistent shape: define an input schema, call into `CoverageModel`, then serialize via `respond_json`. Examples include `ListTool`, `CoverageSummaryTool`, and `UncoveredLinesTool`.
|
|
45
46
|
- Tools are registered in `CovLoupe::MCPServer#run`. Adding a new tool only requires creating a subclass and appending it to that list.
|
|
46
47
|
|
|
47
48
|
## Error Handling & Logging
|
|
@@ -55,17 +56,61 @@ cov-loupe is organized around a single coverage data model that feeds three deli
|
|
|
55
56
|
- `ErrorHandlerFactory` wires the appropriate handler per runtime: CLI, MCP server, or embedded library, each of which installs its handler inside a fresh `AppContext` before executing user work.
|
|
56
57
|
- Diagnostics are written via `CovUtil.log` to `cov_loupe.log` in the current directory by default; override with CLI `--log-file`, set `CovLoupe.default_log_file` for future contexts, or temporarily tweak `CovLoupe.active_log_file` when a caller needs a different destination mid-run.
|
|
57
58
|
|
|
59
|
+
## Output Character Mode
|
|
60
|
+
|
|
61
|
+
cov-loupe provides a global output character mode that controls ASCII vs Unicode output across both CLI and MCP interfaces. This feature ensures compatibility with terminals and systems that cannot display Unicode characters while providing rich Unicode output (box-drawing characters, fancy tables) for environments that support it.
|
|
62
|
+
|
|
63
|
+
### Configuration
|
|
64
|
+
|
|
65
|
+
- **CLI flag** – `-O/--output-chars MODE` accepts `default`, `fancy`, or `ascii` (case-insensitive, with short forms `d`, `f`, `a`)
|
|
66
|
+
- **MCP parameter** – Optional `output_chars` parameter in tool requests overrides server default
|
|
67
|
+
- **Mode resolution** – `:default` resolves at runtime: UTF-8 terminal capability check for fancy, otherwise ASCII
|
|
68
|
+
|
|
69
|
+
### Implementation
|
|
70
|
+
|
|
71
|
+
- **Core conversion** – `OutputChars.convert` uses an internal transliteration map with `?` fallback for characters without ASCII equivalents
|
|
72
|
+
- **Charsets** – Separate charset definitions for fancy (Unicode box-drawing) and ASCII modes
|
|
73
|
+
- **Formatters** – All formatters (JSON, YAML, AmazingPrint, tables, source) respect the output_chars parameter
|
|
74
|
+
- JSON uses `JSON.generate(..., ascii_only: true)` for ASCII mode
|
|
75
|
+
- YAML and AmazingPrint post-process output through `OutputChars.convert`
|
|
76
|
+
- Tables use appropriate charset and convert cell contents
|
|
77
|
+
- Source output uses ASCII-safe markers (`+/-` instead of Unicode `✓/·`)
|
|
78
|
+
|
|
79
|
+
### Scope of Conversion
|
|
80
|
+
|
|
81
|
+
**Converted in ASCII mode:**
|
|
82
|
+
- CLI error messages and option parser errors
|
|
83
|
+
- Staleness error messages and file paths
|
|
84
|
+
- Command literal strings (via `convert_text` helper in BaseCommand)
|
|
85
|
+
- MCP tool JSON responses (via `respond_json` with `ascii_only: true`)
|
|
86
|
+
- All formatted output (tables, source, JSON, YAML)
|
|
87
|
+
|
|
88
|
+
**Not converted in ASCII mode:**
|
|
89
|
+
- **Log files** – Preserved in original encoding for debugging fidelity. Log files are system/debugging artifacts, not user-facing output. Converting would lose exact file paths and error details needed for troubleshooting, create inconsistency between logged paths and actual filesystem paths, and provides no user value since logs are developer artifacts.
|
|
90
|
+
- **Gem post-install message** – Intentionally left unchanged per requirements
|
|
91
|
+
|
|
92
|
+
### Testing
|
|
93
|
+
|
|
94
|
+
Comprehensive test coverage exists:
|
|
95
|
+
- Mode resolution and normalization tests
|
|
96
|
+
- Formatter tests for ASCII mode (JSON, YAML, AmazingPrint, tables, source)
|
|
97
|
+
- CLI option parsing tests for `--output-chars` flag
|
|
98
|
+
- MCP tool output mode tests
|
|
99
|
+
- Staleness error message tests with Unicode file paths
|
|
100
|
+
|
|
58
101
|
## Configuration Surface
|
|
59
102
|
|
|
60
103
|
- **Environment defaults** – `COV_LOUPE_OPTS` applies baseline CLI flags before parsing the actual command line.
|
|
61
|
-
- **Resultset overrides** – The location of the `.resultset.json` file can be specified via CLI options or in the MCP configuration. See [Configuring the Resultset](../
|
|
62
|
-
- **Tracked globs** – Glob patterns (e.g., `lib/**/*.rb`) that specify which files should have coverage. When provided,
|
|
63
|
-
- **
|
|
104
|
+
- **Resultset overrides** – The location of the `.resultset.json` file can be specified via CLI options or in the MCP configuration. See [Configuring the Resultset](../index.md#configuring-the-resultset) for details.
|
|
105
|
+
- **Tracked globs** – Glob patterns (e.g., `lib/**/*.rb`) that specify which files should have coverage. When provided, cov-loupe alerts you if any matching files are missing from the coverage data, helping catch untested files that were added to the project but never executed during test runs.
|
|
106
|
+
- **Output character mode** – Global control of ASCII vs Unicode output via `-O/--output-chars` (CLI) or `output_chars` parameter (MCP). Default mode auto-detects terminal UTF-8 capability.
|
|
107
|
+
- **Colorized source** – CLI-only flags (`--source`, `--context-lines`, `--color`) enhance human-readable reports when working locally.
|
|
64
108
|
|
|
65
109
|
## Repository Layout Highlights
|
|
66
110
|
|
|
67
111
|
- `lib/cov_loupe/` – Core runtime (model, utilities, error handling, CLI, MCP server, tools).
|
|
68
112
|
- `lib/cov_loupe.rb` – Primary public entry point required by gem consumers.
|
|
113
|
+
- `lib/cov_loupe/path_utils.rb` – Centralized path normalization and expansion logic.
|
|
69
114
|
- `docs/` – Audience-specific guides (`docs/user` for usage, `docs/dev` for contributors).
|
|
70
115
|
- `spec/` – RSpec suite with fixtures under `spec/fixtures/` for deterministic coverage data.
|
|
71
116
|
|
data/docs/dev/DEVELOPMENT.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Development Guide
|
|
2
2
|
|
|
3
|
-
[Back to main README](../
|
|
3
|
+
[Back to main README](../index.md)
|
|
4
4
|
|
|
5
5
|
> **Note:** Commands like `cov-loupe` assume the gem is installed globally. If not, substitute `bundle exec exe/cov-loupe`.
|
|
6
6
|
|
|
@@ -39,15 +39,21 @@ rescue JSON::ParserError => e
|
|
|
39
39
|
```ruby
|
|
40
40
|
module CovLoupe::Tools
|
|
41
41
|
class MyTool < BaseTool
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
def self.call(path:, root:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
description 'What this tool does'
|
|
43
|
+
input_schema(**input_schema_def)
|
|
44
|
+
|
|
45
|
+
def self.call(path:, root: nil, resultset: nil, raise_on_stale: nil,
|
|
46
|
+
error_mode: 'log', server_context:)
|
|
47
|
+
with_error_handling('MyTool', error_mode: error_mode) do
|
|
48
|
+
model = create_model(
|
|
49
|
+
server_context: server_context,
|
|
50
|
+
root: root,
|
|
51
|
+
resultset: resultset,
|
|
52
|
+
raise_on_stale: raise_on_stale
|
|
53
|
+
)
|
|
54
|
+
data = model.my_method_for(path)
|
|
55
|
+
respond_json(model.relativize(data), name: 'my_tool_output.json')
|
|
56
|
+
end
|
|
51
57
|
end
|
|
52
58
|
end
|
|
53
59
|
end
|
|
@@ -73,11 +79,109 @@ before { setup_mcp_response_stub }
|
|
|
73
79
|
|
|
74
80
|
**Coverage features:** Add to `CoverageModel` in `model.rb` or `CovUtil` in `util.rb`
|
|
75
81
|
|
|
82
|
+
## Documentation Development
|
|
83
|
+
|
|
84
|
+
This project uses [MkDocs](https://www.mkdocs.org/) with the [Material theme](https://squidfunk.github.io/mkdocs-material/) for documentation.
|
|
85
|
+
|
|
86
|
+
### Installing MkDocs
|
|
87
|
+
|
|
88
|
+
**Recommended: Using a Virtual Environment (all platforms)**
|
|
89
|
+
|
|
90
|
+
Virtual environments isolate Python dependencies and don't require system-level permissions.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Create virtual environment
|
|
94
|
+
python3 -m venv .venv-docs
|
|
95
|
+
|
|
96
|
+
# Activate it
|
|
97
|
+
source .venv-docs/bin/activate # macOS/Linux
|
|
98
|
+
# Or on Windows: .venv-docs\Scripts\activate
|
|
99
|
+
|
|
100
|
+
# Install dependencies
|
|
101
|
+
pip install -r requirements.txt
|
|
102
|
+
|
|
103
|
+
# Deactivate when done (optional)
|
|
104
|
+
deactivate
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Note: Virtual environment directories (`.venv/`, `.venv-*/`, `venv/`) are already in `.gitignore`.
|
|
108
|
+
|
|
109
|
+
**Alternative: System/User Installation**
|
|
110
|
+
|
|
111
|
+
**macOS:**
|
|
112
|
+
```bash
|
|
113
|
+
# Using Homebrew
|
|
114
|
+
brew install mkdocs
|
|
115
|
+
pip3 install mkdocs-material mkdocs-awesome-pages-plugin pymdown-extensions
|
|
116
|
+
|
|
117
|
+
# Or using pip only
|
|
118
|
+
pip3 install -r requirements.txt
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Linux (Ubuntu/Debian):**
|
|
122
|
+
```bash
|
|
123
|
+
# Install pip if needed
|
|
124
|
+
sudo apt update
|
|
125
|
+
sudo apt install python3-pip
|
|
126
|
+
|
|
127
|
+
# Install MkDocs and dependencies
|
|
128
|
+
pip3 install -r requirements.txt
|
|
129
|
+
|
|
130
|
+
# Add pip bin directory to PATH if mkdocs command not found
|
|
131
|
+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
|
|
132
|
+
source ~/.bashrc
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Windows:**
|
|
136
|
+
```powershell
|
|
137
|
+
# Using pip (requires Python 3)
|
|
138
|
+
pip install -r requirements.txt
|
|
139
|
+
|
|
140
|
+
# Or install individually
|
|
141
|
+
pip install mkdocs mkdocs-material mkdocs-awesome-pages-plugin pymdown-extensions
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Building Documentation
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# If using virtual environment, activate it first
|
|
148
|
+
source .venv-docs/bin/activate # macOS/Linux
|
|
149
|
+
# Or on Windows: .venv-docs\Scripts\activate
|
|
150
|
+
|
|
151
|
+
# Build static site
|
|
152
|
+
mkdocs build
|
|
153
|
+
|
|
154
|
+
# Serve locally with live reload (opens at http://127.0.0.1:8000)
|
|
155
|
+
mkdocs serve
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Documentation Structure
|
|
159
|
+
|
|
160
|
+
- `docs/index.md` - Main landing page (derived from README.md)
|
|
161
|
+
- `docs/user/` - User-facing documentation (installation, usage, examples)
|
|
162
|
+
- `docs/dev/` - Developer documentation (architecture, contributing)
|
|
163
|
+
- `mkdocs.yml` - MkDocs configuration and navigation structure
|
|
164
|
+
|
|
165
|
+
### Adding Documentation
|
|
166
|
+
|
|
167
|
+
1. Create or edit markdown files in the `docs/` directory
|
|
168
|
+
2. Add new pages to the `nav` section in `mkdocs.yml`
|
|
169
|
+
3. Test locally with `mkdocs serve`
|
|
170
|
+
4. Commit changes along with your code changes
|
|
171
|
+
|
|
172
|
+
### Troubleshooting MkDocs
|
|
173
|
+
|
|
174
|
+
**Command not found after pip install:**
|
|
175
|
+
- Ensure pip's bin directory is in your PATH
|
|
176
|
+
- macOS: `export PATH="$HOME/Library/Python/3.x/bin:$PATH"`
|
|
177
|
+
- Linux: `export PATH="$HOME/.local/bin:$PATH"`
|
|
178
|
+
- Or run via Python: `python3 -m mkdocs serve`
|
|
179
|
+
|
|
76
180
|
## Troubleshooting
|
|
77
181
|
|
|
78
|
-
**RVM + Codex macOS:** Currently not possible for Codex to run rspec when running on macOS with rvm-managed rubies - see [
|
|
182
|
+
**RVM + Codex macOS:** Currently not possible for Codex to run rspec when running on macOS with rvm-managed rubies - see [Troubleshooting](../user/TROUBLESHOOTING.md)
|
|
79
183
|
|
|
80
184
|
**MCP server testing:**
|
|
81
185
|
```sh
|
|
82
|
-
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"version_tool","arguments":{}}}' | cov-loupe
|
|
186
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"version_tool","arguments":{}}}' | cov-loupe -m mcp
|
|
83
187
|
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Future Enhancements
|
|
2
|
+
|
|
3
|
+
[Back to main README](../index.md)
|
|
4
|
+
|
|
5
|
+
## Coverage path lookup indexing
|
|
6
|
+
|
|
7
|
+
### Problem
|
|
8
|
+
Single-file tools (`summary`, `raw`, `detailed`, `uncovered`) call `CoverageLineResolver#resolve_key`, which normalizes every key in the coverage map on each lookup. That makes per-file queries O(n) in the number of files and can become O(n^2) across repeated MCP/CLI requests.
|
|
9
|
+
|
|
10
|
+
### Proposed approach
|
|
11
|
+
Precompute a normalized-key index once per resolver (or per cached model data). Use that index for O(1) lookups while preserving ambiguity detection when multiple original keys normalize to the same value.
|
|
12
|
+
|
|
13
|
+
### Why this matters
|
|
14
|
+
Large resultsets or frequent interactive queries can feel sluggish due to repeated normalization and full-map scans. Indexing would improve responsiveness without changing output semantics.
|
data/docs/dev/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# Developer Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[Back to main README](../index.md)
|
|
4
|
+
|
|
5
|
+
Resources for contributors working on cov-loupe internals and release
|
|
4
6
|
engineering.
|
|
5
7
|
|
|
6
8
|
- [Architecture Overview](ARCHITECTURE.md) – subsystem layout and data flow
|
|
7
9
|
- [Development Guide](DEVELOPMENT.md) – setup, testing, release workflow
|
|
8
|
-
- [Branch Coverage Support](BRANCH_ONLY_COVERAGE.md) – implementation notes and limitations
|
|
9
10
|
- [Architecture Decision Records](arch-decisions/README.md) – design history
|
|
10
11
|
- [Presentations](presentations/cov-loupe-presentation.md) – slide deck for talks/demos
|
data/docs/dev/RELEASING.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Architecture Decision Records
|
|
2
2
|
|
|
3
|
-
[Back to main README](../../
|
|
3
|
+
[Back to main README](../../index.md) | [Architecture Overview](../ARCHITECTURE.md)
|
|
4
4
|
|
|
5
5
|
## What is an ADR?
|
|
6
6
|
|
|
@@ -37,11 +37,14 @@ Links to related code, issues, documentation, or other ADRs.
|
|
|
37
37
|
|
|
38
38
|
## Index of ADRs
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
40
|
+
ADRs are organized by topic area rather than chronologically:
|
|
41
|
+
|
|
42
|
+
- [Application Architecture](application-architecture.md) - Dual-mode operation (CLI/MCP) and context-aware error handling
|
|
43
|
+
- [Coverage Data Quality](coverage-data-quality.md) - Staleness detection system
|
|
44
|
+
- [Output Character Mode](output-character-mode.md) - Global ASCII vs Unicode output control
|
|
45
|
+
- [Path Resolution](path-resolution.md) - Path matching strategy and cross-OS coverage support
|
|
46
|
+
- [Policy Validation](policy-validation.md) - Success predicates using Ruby `instance_eval`
|
|
47
|
+
- [SimpleCov Integration](simplecov-integration.md) - Dependency strategy and data loading (replaced)
|
|
45
48
|
|
|
46
49
|
## When to Create an ADR
|
|
47
50
|
|
|
@@ -54,7 +57,7 @@ Create an ADR when:
|
|
|
54
57
|
## Contributing
|
|
55
58
|
|
|
56
59
|
When adding a new ADR:
|
|
57
|
-
1.
|
|
60
|
+
1. Add it to the appropriate topic-based file, or create a new file if it covers a new area
|
|
58
61
|
2. Follow the format outlined above
|
|
59
62
|
3. Update this README's index
|
|
60
63
|
4. Link to relevant code and documentation
|