Gunnar

nordisk/knut

.nornir/quality-matrix.md

<!-- nornir:class: history -->
# knut's own quality matrix (L4b)

knut consumes the published reusable test-matrix engine
[`nornir-testmatrix`](https://crates.io/crates/nornir-testmatrix) as a
**dev-dependency** of the `knut-bifrost` member (the crate that already hosts
the file→graph lifecycle integration tests). This proves the matrix framework
is reusable from this repo — knut can render its OWN quality matrix
standalone, with no nornir checkout.

## Run knut's matrix

```sh
cargo run -p knut-bifrost --example quality_matrix
```

This runs `run_full_matrix(".", Aspect::DEFAULT)` — build, unit, doctest,
clippy, fmt, audit — writes the rows to `target/quality-matrix.jsonl` via
`JsonFileSink`, and prints `render_matrix(&rows)`.

It shells one `cargo` invocation per aspect, so it is **deliberately NOT** in
the normal `cargo test` path (no cargo-inside-cargo on every test run).

## Wiring proof (fast + offline)

`crates/knut-bifrost/tests/testmatrix_wiring.rs` is an inject-and-assert test
(`testmatrix_roundtrip_and_render_inject_assert`): it feeds canned
`TestResultRow`s (varied status / aspect / metric) through the real
`JsonFileSink` round-trip and `summarize_runs` + `render_matrix`, then asserts
exact tallies, that aspect+metric survive serde, and that the rendered grid
shows the red `✗` marker. No cargo subprocess, no network.