Skip to content

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

Merged
avrabe merged 1 commit into
mainfrom
feat/issue-188-coverage-matrix-cli
May 11, 2026
Merged

feat(coverage): rivet coverage --matrix — V&V matrix from repo-status artifacts#243
avrabe merged 1 commit into
mainfrom
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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 29, 2026

📐 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!

… 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.

- 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.

| 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.

- 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.

- 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).

- 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>
@avrabe avrabe force-pushed the feat/issue-188-coverage-matrix-cli branch from 7fd4352 to 2bc3362 Compare May 10, 2026 19:04
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rivet Criterion Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 2bc3362 Previous: 6dfdca6 Ratio
store_insert/10000 15624406 ns/iter (± 1425508) 10777546 ns/iter (± 201358) 1.45
link_graph_build/10000 32753446 ns/iter (± 2570991) 22905310 ns/iter (± 293676) 1.43
validate/10000 18032530 ns/iter (± 1920986) 12167984 ns/iter (± 144437) 1.48

This comment was automatically generated by workflow using github-action-benchmark.

@avrabe avrabe merged commit dd24535 into main May 11, 2026
12 of 23 checks passed
@avrabe avrabe deleted the feat/issue-188-coverage-matrix-cli branch May 11, 2026 03:24
avrabe added a commit that referenced this pull request May 11, 2026
Three queued feature requests now land: rivet bundle (#266), rivet
coverage --matrix (#243), s-expr linked-via operator (#265). Plus
externals load their own schemas (#267) and STPA TCL numbering is
corrected to ISO 26262-8 (#257).

Infrastructure: CI concurrency control across all workflows (#258),
migration to self-hosted smithy runners (#262), release-npm trigger
fix that retroactively unblocked v0.7.0/v0.8.0 npm publication (#261),
weekly dependabot (#216), and the wasmtime 42→43 upgrade that retires
the RUSTSEC-2026-0114 suppression introduced in v0.8.0 (#260).

#125 (provenance-lifecycle) intentionally deferred — 5-week-old branch
with conflicts in heavily-churned files (CLAUDE.md, ci.yml, settings).
Needs its own attention session, not safe to autonomously rebase.

Refs: FEAT-001

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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