build(deny): a supply-chain gate: advisories, licences, sources (cargo-deny)

Nothing checked what the program is built from. `just deny` now does, in
the lint part of `just check` and weekly in scheduled.yml (an advisory
is published when it is, not when we push), from one file, deny.toml:

- advisories: no crate in the lock file with a known vulnerability
  (RustSec), none yanked; an unmaintained crate is refused when it is
  one of our own direct dependencies. Two advisories are lived with,
  each with its reason and date: the quick-xml 0.38 that typst's
  citation reader brings, which no XML from outside reaches.
- licences: the permissive ones, plus MPL-2.0 for one unchanged crate
  (option-ext) and CDLA-Permissive-2.0 for Mozilla's root certificates.
  No font licence is allowed, so a crate that carries fonts is refused
  and every font we ship is a file here beside its licence. A crate
  offering only a copyleft licence is refused.
- sources: crates.io and the bookspec repository, nothing else.
- bans: no dependency by wildcard version.

The crates are marked `publish = false` (one line in the workspace,
inherited by all eleven): they are parts of one program, not libraries
for crates.io, and with that cargo-deny accepts their path dependencies
on each other.

cargo-deny 0.20.2 is a build tool pinned in mise.toml, not a dependency
of the program.

Shown: `just deny` prints advisories ok, bans ok, licenses ok, sources
ok on this tree.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude committed 2026-11-09 20:03:51 -07:00
1 parent 9ad6f89816
commit 1726c8b6dd
17 files changed
+124

No files matched your search

+8
View File
@@ -22,6 +22,14 @@ jobs:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: just prove-slow
# A dependency's advisory is published when it is, not when we push:
# the same check as in `just check`, so a week is the longest one waits.
deny:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: jdx/mise-action@v2
- run: just deny
lean-model:
runs-on: ubuntu-24.04
steps:
+4
View File
@@ -6,6 +6,10 @@ members = ["crates/ledger-core", "crates/ledger-store", "crates/ledger-config",
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://git.swaits.com/swaits/wanderbooks"
# The crates are parts of one program, built from this tree and shipped as
# its packages. None is a library for crates.io, and saying so lets
# `cargo deny` accept their path dependencies on each other.
publish = false
[workspace.lints.rust]
missing_docs = "warn"
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "wanderbooks: the one executable (viewer, books server, host, agents' bridge, owner's commands)."
[[bin]]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "Company settings for wanderbooks: an older books dir's wanderbooks.toml, read at adoption."
[dependencies]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "Canonical double-entry bookkeeping semantics: the engine everything else is built on."
[dependencies]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "Read-only, live desktop view of wanderbooks books."
[[bin]]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "wanderbooks: the books open while something holds them (the host, its leases, the helper and the agents' bridge)."
[dependencies]
+1
View File
@@ -3,6 +3,7 @@ name = "ledger-import"
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
publish.workspace = true
[dependencies]
ledger-core = { path = "../ledger-core" }
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "The books server's MCP tools for wanderbooks: the AI-first bookkeeping interface over ledger-store."
[lib]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "wanderbooks' CPA handoff package and the reports and worksheets it shares with the server: built from the books read-only, by the server or the viewer."
[dependencies]
+1
View File
@@ -3,6 +3,7 @@ name = "ledger-reader"
version = "0.1.0"
edition = "2024"
license = "MIT OR Apache-2.0"
publish.workspace = true
description = "The one reader: a PDF's text and pages, an XLSX's cells as exact decimal strings (plan P6, D-61)."
[dependencies]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "Durable persistence for wanderbooks: a hash-chained JSONL journal as the source of truth, content-addressed blob store, and a disposable SQLite projection."
[dependencies]
+1
View File
@@ -4,6 +4,7 @@ version = "0.1.0"
edition.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "wanderbooks' encrypted TIN vault: full taxpayer identification numbers and W-9 files, outside the journal"
[dependencies]
+86
View File
@@ -0,0 +1,86 @@
# What a dependency must be for wanderbooks to build on it (`just deny`,
# part of `just check`). Four questions, each a refusal:
# advisories: no known vulnerability (RustSec), nothing yanked
# licenses: only licences that fit a program shipped MIT OR Apache-2.0
# sources: crates.io, and the one git repository named below
# bans: no dependency by wildcard version
# An exception goes here with its reason and a date, never on the command
# line.
[graph]
# The viewer, the server-only build and every platform's dependencies.
all-features = true
[advisories]
yanked = "deny"
# "Unmaintained" is not "vulnerable". A crate wanderbooks itself depends on
# must be maintained, since that one is ours to replace. One that arrives
# through typst or the egui stack (bincode, yaml-rust, paste, rustybuzz,
# ttf-parser, zvariant on 2026-11-09) is theirs to replace, and a known
# vulnerability in it is still refused above.
unmaintained = "workspace"
# RustSec ids deliberately lived with, each with why and since when.
ignore = [
# quick-xml 0.38 (a slow or memory-hungry parse of hostile XML). The
# reader's own quick-xml, which does parse files from outside, is 0.42.
# This older copy comes through typst (typst -> hayagriva ->
# citationberg) and parses citation styles only. wanderbooks renders
# its own compiled-in templates, with no bibliography and no file
# access, so no XML from outside reaches it. Remove these two lines
# when typst moves to a citationberg on quick-xml 0.41 or later.
# Since 2026-11-09.
{ id = "RUSTSEC-2026-0194", reason = "typst's citationberg only; no outside XML reaches it" },
{ id = "RUSTSEC-2026-0195", reason = "typst's citationberg only; no outside XML reaches it" },
]
[licenses]
# Permissive licences, and two that are not plain permissive, each for
# a named crate:
# MPL-2.0: option-ext (through dirs). File-level copyleft: it binds
# changes to that crate's own files, and we ship it unchanged.
# CDLA-Permissive-2.0: Mozilla's root certificates (webpki-root-certs).
# No font licence is on the list (OFL-1.1, Ubuntu-font-1.0): a crate that
# brings fonts under one is refused. The OFL itself fits (Inter is under
# it); the point is that every font the program ships is a file in this
# repository beside its licence (crates/ledger-gui/assets/fonts/README.md,
# crates/ledger-import/fonts/), not something a dependency carried in.
# That keeps out egui's default set (epaint_default_fonts), which holds
# Ubuntu Light under the Ubuntu Font Licence 1.0, non-free to Debian and
# Fedora.
# GPL and LGPL appear in the tree only as one choice of an OR (self_cell,
# r-efi); cargo-deny takes the permissive side. A crate offering only a
# copyleft licence is refused here, which is the point.
allow = [
"MIT",
"MIT-0",
"Apache-2.0",
"Apache-2.0 WITH LLVM-exception",
"BSD-2-Clause",
"BSD-3-Clause",
"ISC",
"Zlib",
"0BSD",
"BSL-1.0",
"CC0-1.0",
"Unlicense",
"Unicode-3.0",
"bzip2-1.0.6",
"MPL-2.0",
"CDLA-Permissive-2.0",
]
confidence-threshold = 0.9
[bans]
# Several versions of one crate are a cost in build time, not a risk:
# the GUI stack brings many. A wildcard version is a risk.
multiple-versions = "allow"
wildcards = "deny"
allow-wildcard-paths = true
[sources]
unknown-registry = "deny"
unknown-git = "deny"
allow-registry = ["https://github.com/rust-lang/crates.io-index"]
# bookspec, the specification and its checker (D-68), pinned by rev in
# crates/ledger-core/Cargo.toml.
allow-git = ["https://git.swaits.com/swaits/bookspec"]
+1
View File
@@ -27,6 +27,7 @@ promise.
| Fuzzing | crash, hang, broken books (4); for `fuzz_store_replay` (validly chained journals with fuzz-chosen events): books that open must verify, and the viewer must accept exactly what the writer does | `fuzz/fuzz_targets/`, corpora in `fuzz/corpus/` | `just fuzz <target> <secs>` | 10 min each | weekly |
| 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` |
| 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 |
+10
View File
@@ -38,6 +38,7 @@ check-shard shard:
RUSTDOCFLAGS="-D warnings" cargo doc --workspace --no-deps --quiet
just server-only
just check-shards-agree
just deny
;;
# The viewer's tests are half of the suite's time, in two halves
# of their own: its unit tests, and its integration tests. Between
@@ -56,6 +57,15 @@ check-shard shard:
;;
esac
# What every dependency must be (deny.toml): free of known vulnerabilities
# (the RustSec database, fetched now), not yanked, under a licence that
# fits MIT OR Apache-2.0, and from crates.io or the bookspec repository.
# The first run (2026-11-09) found 23 advisories in the lock file. A new
# advisory turns this red on an unchanged tree: that is its job, and the
# weekly run makes it within a week of the advisory, push or no push.
deny:
cargo deny check
# CI's list of parts is this file's: a part CI never runs is a check
# nobody makes, and a part only CI names fails there, not here.
check-shards-agree:
+4
View File
@@ -26,6 +26,10 @@ node = "26"
# `just coverage`: line and branch coverage of the core and the store
# (docs/coverage-floor.md).
"cargo:cargo-llvm-cov" = "0.9.1"
# `just deny` (in `just check`): no dependency with a known vulnerability,
# none yanked, none under a licence that does not fit MIT OR Apache-2.0,
# none from a source nobody named (deny.toml).
cargo-deny = "0.20.2"
# A compile cache shared by every jj workspace's target dir: point
# cargo's build.rustc-wrapper at it (~/.cargo/config.toml).
sccache = "0.18.0"