coverage_diff
Analyze patch coverage by combining git diff with per-line coverage reports. Returns rendered report with coverage percentage and gate result in YAML, markdown, or JSON.
Instructions
Analyze diff/patch coverage from a per-line coverage report plus the git diff, and return the rendered report with the patch-coverage percentage and gate result as YAML. Read-only. Mirrors omni-dev coverage diff. report is a required filesystem path to the head coverage report (lcov / llvm-cov-json / cobertura, auto-detected). format renders the report as markdown (default), yaml, or json. Unlike the CLI this tool never fails the call on a low fail_under_patch; it reports below_gate: true instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | Rendered output format. Defaults to `markdown`. | |
| report | Yes | Head coverage report path (lcov / llvm-cov-json / cobertura). Required. | |
| run_url | No | Link to the CI run (markdown footer). | |
| base_ref | No | Base revision to diff against (default: merge-base of `origin/main` and `HEAD`). | |
| base_sha | No | Base (merge-base) commit SHA shown in the markdown `Comparing` line. | |
| head_ref | No | Head revision the report was measured at (default: `HEAD`). | |
| head_sha | No | Head commit SHA shown in the markdown `Comparing` line. | |
| all_files | No | Report per-file deltas and indirect changes for ALL files, not just the ones the diff touches. | |
| repo_path | No | Path to the git repository. Defaults to the current working directory. | |
| commit_url | No | Commit-URL prefix for linking SHAs. | |
| artifact_url | No | Link to the full coverage-summary artifact (markdown footer). | |
| strip_prefix | No | Override the path prefix stripped from report paths to make them repo-relative (default: the repository working directory). | |
| report_format | No | Format of `report` (auto-detected by default). | |
| baseline_report | No | Optional baseline coverage report path; enables project deltas and indirect-change detection. | |
| collapse_ranges | No | Collapse consecutive uncovered new lines into ranges (e.g. `9-11`). | |
| fail_under_patch | No | Report a below-gate result when patch coverage is below this percentage (the tool never fails the call; it reports `below_gate` instead). | |
| ignore_filename_regex | No | Exclude files whose repo-relative path matches any of these regexes from both the head and baseline reports before computing the diff. Matching is unanchored, applied after `strip_prefix` (same semantics as `cargo llvm-cov --ignore-filename-regex`). | |
| baseline_report_format | No | Format of `baseline_report` (auto-detected by default). |