diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index cd36aaa4..8a41faa2 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -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: diff --git a/Cargo.toml b/Cargo.toml index 236566d4..1d43d5aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/crates/ledger-cli/Cargo.toml b/crates/ledger-cli/Cargo.toml index 429e526b..d62ee4c8 100644 --- a/crates/ledger-cli/Cargo.toml +++ b/crates/ledger-cli/Cargo.toml @@ -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]] diff --git a/crates/ledger-config/Cargo.toml b/crates/ledger-config/Cargo.toml index 08b9e0b9..af51e8b3 100644 --- a/crates/ledger-config/Cargo.toml +++ b/crates/ledger-config/Cargo.toml @@ -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] diff --git a/crates/ledger-core/Cargo.toml b/crates/ledger-core/Cargo.toml index c1e86930..8c7fb57d 100644 --- a/crates/ledger-core/Cargo.toml +++ b/crates/ledger-core/Cargo.toml @@ -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] diff --git a/crates/ledger-gui/Cargo.toml b/crates/ledger-gui/Cargo.toml index 5456bdec..22102bbd 100644 --- a/crates/ledger-gui/Cargo.toml +++ b/crates/ledger-gui/Cargo.toml @@ -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]] diff --git a/crates/ledger-host/Cargo.toml b/crates/ledger-host/Cargo.toml index b435f3a0..5ca81669 100644 --- a/crates/ledger-host/Cargo.toml +++ b/crates/ledger-host/Cargo.toml @@ -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] diff --git a/crates/ledger-import/Cargo.toml b/crates/ledger-import/Cargo.toml index b8e65482..ab38c93a 100644 --- a/crates/ledger-import/Cargo.toml +++ b/crates/ledger-import/Cargo.toml @@ -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" } diff --git a/crates/ledger-mcp/Cargo.toml b/crates/ledger-mcp/Cargo.toml index a648a700..a6e6d973 100644 --- a/crates/ledger-mcp/Cargo.toml +++ b/crates/ledger-mcp/Cargo.toml @@ -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] diff --git a/crates/ledger-package/Cargo.toml b/crates/ledger-package/Cargo.toml index c2656b77..05b5c7da 100644 --- a/crates/ledger-package/Cargo.toml +++ b/crates/ledger-package/Cargo.toml @@ -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] diff --git a/crates/ledger-reader/Cargo.toml b/crates/ledger-reader/Cargo.toml index ebce0f03..66553a5d 100644 --- a/crates/ledger-reader/Cargo.toml +++ b/crates/ledger-reader/Cargo.toml @@ -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] diff --git a/crates/ledger-store/Cargo.toml b/crates/ledger-store/Cargo.toml index 3cc30160..73df09d6 100644 --- a/crates/ledger-store/Cargo.toml +++ b/crates/ledger-store/Cargo.toml @@ -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] diff --git a/crates/ledger-vault/Cargo.toml b/crates/ledger-vault/Cargo.toml index 27016bb0..925baf1d 100644 --- a/crates/ledger-vault/Cargo.toml +++ b/crates/ledger-vault/Cargo.toml @@ -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] diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..96e457c0 --- /dev/null +++ b/deny.toml @@ -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"] diff --git a/docs/testing.md b/docs/testing.md index f8d27169..4aa7526a 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -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 ` | 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 | diff --git a/justfile b/justfile index e74bbca7..3c9de3a2 100644 --- a/justfile +++ b/justfile @@ -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: diff --git a/mise.toml b/mise.toml index 706edc3c..97f5fca9 100644 --- a/mise.toml +++ b/mise.toml @@ -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"