Files
bchanot 9e87016399 feat(domain): R5.6 fingerprint switch to sha256-rfc8785-validated-v1
The Rust pipeline is the official seed writer (pnpm import:equine); sheet-ref.json
and report-migration-map.json carry 12d78872...74e2 and the v1 block, the only two
seed files changed. 27c7383c...2660 stays a registered alias, honoured only through
LoadedSheet::recognises_historical_stamp (verified v1, recomputed document). M1: the
snapshot of an old report keeps its stamp; export, archive reader strict. Historical
oracles run in their pre-switch context; equivalence is crate-private.
2026-10-25 02:02:42 +01:00

46 lines
3.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# The Rust quality gate, one file for every environment: `pnpm rust:check` runs it on the
# native toolchain of the development machine (rustup selects the channel pinned by
# rust-toolchain.toml); `pnpm rust:check:docker` runs the same file inside the reference
# builder image (docker/rust-builder.Dockerfile) when a reproducible run is wanted.
# The worker's sandbox tests are feature-gated (`test-hooks`) and run only in its own
# Alpine/musl image (crates/worker/Dockerfile stage `test`, `pnpm worker:test`): the seccomp
# allowlist is derived for the musl static binary that ships. The plain `cargo test` below
# therefore covers the worker's unit tests and the whole of core and wasm.
set -euo pipefail
cd "$(dirname "$0")/.."
. scripts/rust-env.sh
cargo fmt --all --check
cargo clippy --workspace --all-targets --locked -- -D warnings
cargo test --workspace --locked
# The core alone with no feature (what the worker-side and any future consumer build): the
# workspace run above unifies the wasm crate's features, so a code path that needs
# `pdf-read` or `pdf-write` without its gate compiles there and nowhere else.
cargo clippy -p faunosteo-core --all-targets --locked -- -D warnings
# The PDF reader and writer (R4) are feature-gated in the core: their code and suites compile
# only here and in the wasm module, never in the worker; `cli` adds the archive check tool
# (`report-compare`, R4.7) and its O10 suite, never built into the module.
cargo clippy -p faunosteo-core --all-targets --features cli --locked -- -D warnings
cargo test -p faunosteo-core --features cli --locked
# The anatomical pipeline (R5) is feature-gated too (`curation`): the legacy importer, the
# formatting of the generated seed files and the `import-equine` tool, never built into the
# module or the worker; its suites hold it to the TypeScript oracles of `oracles/r5`.
cargo clippy -p faunosteo-core --all-targets --features curation --locked -- -D warnings
cargo test -p faunosteo-core --features curation --locked
# The sheet-asset upload tool (R5.5) adds `ureq` on top of `curation`: its rules, and the binary
# against a loopback stub of the local stack (`upload_tool`); never built into the module.
cargo clippy -p faunosteo-core --all-targets --features upload --locked -- -D warnings
cargo test -p faunosteo-core --features upload --locked
# The sheet fingerprint (R5.6): RFC 8785, the V8 and Node oracles, the registry, and the census
# of the fixture archives (their attachments need the PDF reader).
cargo clippy -p faunosteo-core --all-targets --features pdf-read --locked -- -D warnings
cargo test -p faunosteo-core --features pdf-read --locked --test sheet_fingerprint
# Exports the TypeScript types of the contracts (ts-rs) into packages/core-wasm/types.
# `git status --porcelain --untracked-files=all -- packages/core-wasm/types` must stay
# empty afterwards (scripts/check-all.sh, .gitea/workflows/ci.yml): the committed types
# never drift from the Rust structs, and a new type file counts as drift.
cargo test -p faunosteo-core --features ts,pdf-read,pdf-write --locked
cargo deny check licenses bans sources