Skip to content

feat(coverage): rivet coverage --matrix — V&V matrix from repo-status artifacts#243

Open
avrabe wants to merge 1 commit intomainfrom
feat/issue-188-coverage-matrix-cli
Open

feat(coverage): rivet coverage --matrix — V&V matrix from repo-status artifacts#243
avrabe wants to merge 1 commit intomainfrom
feat/issue-188-coverage-matrix-cli

Conversation

@avrabe
Copy link
Copy Markdown
Contributor

@avrabe avrabe commented Apr 29, 2026

Sub-issue 2 of #188 — the consumer surface for the repo-status schema that landed via #232. Reads repo-status artifacts from the local project and renders a per-repo × per-technique V&V coverage matrix in text, json, markdown, or html.

The cross-repo aggregator (sub-issue 3 of the prior triage decomposition) is still out of scope here because this triage agent's GitHub access is restricted to pulseengine/rivet only.

Acceptance — sub-issue 2 of #188

Per the triage comment on #188 (2026-04-26):

#2. rivet coverage --matrix (single-repo, local) — emits markdown/HTML/JSON for the local rivet.yaml. Acceptance = golden-file tests for each format; CLI flag parsing tested.

Mapped to bullets:

  • rivet coverage --matrix flag accepted. New --matrix flag on the existing Coverage clap variant; mutually exclusive with --tests.
  • Emits markdown. Pipe table with header + separator. Test: coverage_matrix_markdown.
  • Emits HTML. <section><table> fragment with cell-{absent,applied,gated} classes; &/</> escaped. Test: coverage_matrix_html.
  • Emits JSON. {command: "coverage-matrix", columns, repos[]} with per-cell {technique, status} records. Test: coverage_matrix_json.
  • Single-repo, local rivet.yaml. Reads repo-status artifacts via ProjectContext::load; cross-repo aggregation deferred to sub-issue 3.
  • Golden-style tests for each format. 7 integration tests in rivet-cli/tests/cli_commands.rs covering markdown / html / json / text-default rendering, invalid-format diagnostic, --matrix × --tests clap conflict, and empty-project graceful render across all four formats.
  • CLI flag parsing tested. coverage_matrix_invalid_format_fails (lists the four valid options) and coverage_matrix_conflicts_with_tests_flag (clap-level mutual exclusion).

Cell semantics

State Glyph JSON Meaning
absent · "absent" Technique not in techniques-applied.
applied "applied" Applied but not gated in CI.
gated "gated" In techniques-gated-in-ci.

Columns are the sorted union of techniques-appliedtechniques-gated-in-ci across all rows, so the matrix only shows techniques at least one repo cares about.

Docs

  • New coverage-matrix topic in rivet docs documenting the surface, cell semantics, authoring repo-status, and the four output formats.
  • New schema/vv-coverage topic exposing the schema YAML.

Test plan

  • cargo test -p rivet-cli — full suite green
  • cargo test -p rivet-core --lib — 896 pass
  • cargo clippy -p rivet-cli --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • rivet validate diagnostics unchanged from origin/main (the 6 pre-existing errors are in the spar-external cross-repo fixture, untouched by this PR)
  • Smoke: rivet coverage --matrix --format markdown against a tmpdir with three repo-status artifacts produces the expected table

Closes part of #188. Does not close the issue — sub-issues 3 (cross-repo aggregator), 4 (publishing pipeline), and 5 (per-standard mapping) remain.

Refs: #188
Refs: #184

🤖 Generated with Claude Code — issue-triage agent run 2026-04-29.


Generated by Claude Code

… artifacts

Adds the V&V coverage matrix view to `rivet coverage`: reads
`repo-status` artifacts (schema `vv-coverage` from PR #232) and renders
a per-repo × per-technique matrix in text, json, markdown, or html.

Sub-issue 2 of #188. Sub-issue 1 (the schema) shipped in #232; the
cross-repo aggregator (sub-issue 3) is still out of scope here per
the prior triage decomposition because the agent's GitHub access is
restricted to `pulseengine/rivet` only.

## Surface

- New flag `--matrix` on the existing `Coverage` subcommand. Mutually
  exclusive with `--tests` at the clap layer.
- `--format` accepts `text` (default), `json`, `markdown`, `html` when
  `--matrix` is set; the original `text|json` contract for non-matrix
  coverage is preserved.

## Cell semantics

| State    | Glyph | JSON        | Meaning                                |
|----------|-------|-------------|----------------------------------------|
| absent   | ·     | "absent"    | Technique not in `techniques-applied`. |
| applied  | ○     | "applied"   | Applied but not gated in CI.           |
| gated    | ●     | "gated"     | In `techniques-gated-in-ci`.           |

Columns are the sorted union of `techniques-applied` ∪
`techniques-gated-in-ci` across all rows, so the matrix only shows
techniques at least one repo cares about.

## Output

- text: fixed-width table with the legend on top.
- markdown: pipe table; pastes verbatim into a PR body or wiki.
- html: `<section><table>` fragment with `cell-{absent,applied,gated}`
  classes for downstream styling, with `&` and friends escaped.
- json: structured `{command: "coverage-matrix", columns, repos[]}`
  envelope. Each repo carries its raw lists plus a precomputed
  `cells[]` so consumers don't have to recompute set membership.

## Verification

- 7 new integration tests in `rivet-cli/tests/cli_commands.rs`:
  markdown / html / json / text-default rendering, invalid-format
  diagnostic, `--matrix` × `--tests` clap conflict, empty-project
  graceful render across all four formats.
- `cargo test -p rivet-cli` — full suite green (432 tests).
- `cargo test -p rivet-core --lib` — 896 pass.
- `cargo clippy -p rivet-cli --all-targets -- -D warnings` — clean.
- `cargo fmt --all -- --check` — clean.
- `rivet validate` diagnostics unchanged from origin/main (pre-existing
  6 errors in the spar-external fixture, untouched here).

## Docs

- New `coverage-matrix` topic in `rivet docs` documenting the surface,
  cell semantics, authoring `repo-status`, and the four output formats.
- New `schema/vv-coverage` topic exposing the schema YAML directly.

Refs: #188
Refs: #184

Implements: REQ-007

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

📐 Rivet artifact delta

No artifact changes in this PR. Code-only changes (renderer, CLI wiring, tests) don't touch the artifact graph.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants