diff --git a/docs/testing.md b/docs/testing.md index 8812e400..e1d9c4ce 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -28,7 +28,7 @@ promise. | Miri | undefined behavior in our use of dependencies (4) | the core's unit, bridge, invariant tests (the exhaustive calendar walk aside) | `just miri` | ~4 min | on demand | | Golden | `tests/golden/fixture_company.json` (5) | `invariants.rs` | `just check` | <1s | every change | | Dependencies | no crate in the lock file with a known vulnerability (RustSec) or yanked; none under a licence that does not fit MIT OR Apache-2.0; none from a source `deny.toml` does not name; none of our own unmaintained (4) | `deny.toml`, each exception with its reason and date | `just deny` (in `just check`, the lint part) | seconds, needs the network | every change, and weekly (`scheduled.yml`), since an advisory is published when it is, not when we push. First run, 2026-11-09: 23 advisories; closed by upgrades (quick-xml, rusqlite, rust_xlsxwriter, rmcp, rustls, tokio, zstd, pulldown-cmark) but two, lived with in `deny.toml` | -| Notices | every crate the program links and every font it embeds, with the licence text each asks to travel with (1, the licence itself) | `THIRD-PARTY-NOTICES.txt`, written by cargo-about from `ledger-cli`'s manifest and from the licence files beside the fonts | `just notices`; `just notices-check` (in `just check`, the lint part) | seconds | every change that touches a dependency or a font. `just notices` writes the file; `just notices-check` fails when a dependency changed and the file was not regenerated, and the fix is `just notices` and committing the result | +| Notices | every crate the program links and every font it embeds, with the licence text each asks to travel with (1, the licence itself) | `THIRD-PARTY-NOTICES.txt`, written by cargo-about from `ledger-cli`'s manifest and from the licence files beside the fonts | `just notices`; `just notices-check` (in `just check`, the lint part) | ~2 min (12 CPU-minutes: it reads every crate's files for licence text) | every change that touches a dependency or a font. `just notices` writes the file; `just notices-check` fails when a dependency changed and the file was not regenerated, and the fix is `just notices` and committing the result | | Benchmarks | a baseline (6) | `ledger-core/benches/books.rs`, `ledger-store/benches/store.rs` | `just bench` | ~2 min | none (no budget, by decision) | | Coverage | the code lines, regions and branches the suites execute (6) | `ledger-core` and `ledger-store` library sources (`src/proofs.rs` is Kani-only and excluded, as are test and bench files) | `just coverage` (HTML and a per-file table in `target/coverage/`), `just coverage-check` (docs/coverage-floor.md's floor, 0.5 pp tolerance) | ~1–3 h (nightly branch coverage) | weekly (`scheduled.yml`) | | Mutation | can the tests fail? | `ledger-core` (2026-10-13: 1,011 caught + 13 timeouts of 1,024 viable, 0 missed) | `just mutants` | ~3 h | weekly | diff --git a/scripts/notices.sh b/scripts/notices.sh index a58e366f..e72c47d6 100755 --- a/scripts/notices.sh +++ b/scripts/notices.sh @@ -126,12 +126,20 @@ write_notices() { echo "notices: cargo is not installed (mise install)" >&2 exit 2 } - # --offline: no network lookup, so the same crates give the same file - # on every machine. The manifest is ledger-cli's, the one executable: - # that dependency graph is what the binary links. - cargo about generate --locked --all-features --offline \ + # --offline: cargo-about reads only the crates' own packaged files. + # Without it, a crate packaged without its licence file is looked up + # in its git repository, so the file could change with no change + # here. The cost: such a crate gets the licence's standard text, + # without the copyright line its repository holds. The manifest is + # ledger-cli's, the one executable: that dependency graph is what the + # binary links. + if ! cargo about generate --locked --all-features --offline \ -m crates/ledger-cli/Cargo.toml -c about.toml \ - deploy/notices/about.hbs > "$work/about.txt" + deploy/notices/about.hbs > "$work/about.txt"; then + echo "notices: cargo-about failed. It reads every crate in Cargo.lock from the local" >&2 + echo "registry, every platform's included: if one is missing, run \`cargo fetch --locked\` first." >&2 + exit 2 + fi { cat "$work/about.txt" echo