Security, licensing, unsafe-code, and dependency review¶
Date: 2026-07-21
Scope: workspace crates + python extension (package version 0.2.0)
ADR: 0017
Unsafe code policy¶
| Crate | Policy | Notes |
|---|---|---|
Most semantic crates (antecedent-* except below / kernels) |
#![forbid(unsafe_code)] |
Verified locally by scripts/gate_release.sh |
antecedent-data |
#![deny(unsafe_code)] + scoped allow |
Foreign buffers (buffer.rs) and Arrow CDI (arrow_ffi.rs) |
antecedent-io |
#![deny(unsafe_code)] + scoped allow |
Thin mmap (mmap_file.rs) only |
antecedent-kernels |
#![allow(unsafe_code)] |
Only reviewed SIMD / aliasing kernels |
python / antecedent-py |
#![allow(unsafe_code)] |
Required by PyO3 |
Gate fails if a forbid-crate loses forbid(unsafe_code), or if data/io lose deny / their scoped escape modules.
Licensing¶
- Project:
MIT OR Apache-2.0(seeLICENSE-MIT,LICENSE-APACHE, ADR 0008). - Dependencies audited with cargo-deny (
deny.tomllicense allow-list); run locally (cargo deny check) — not part of CI. - Default features must remain wheel-distributable without system BLAS (ADR 0001 / ).
Dependency notes¶
| Component | Role | Review |
|---|---|---|
faer |
Default linear algebra | Pure Rust; no system BLAS in default wheels |
paste (transitive via gemm) |
faer build-time macro | Unmaintained (RUSTSEC-2024-0436); ignored in deny.toml with reason — no runtime use; revisit when faer drops it |
arrow-array / arrow-schema / arrow-buffer |
Tabular / IPC sections | Feature-gated where needed; no algorithm duplication in Python |
pyo3 0.29 / numpy 0.29 |
Python boundary | Upgraded in to clear RUSTSEC-2025-0020 and RUSTSEC-2026-0177 |
blake3 / ciborium / serde |
Artifact container | CBOR + checksums per |
thiserror |
Error types | No runtime concerns |
Unmaintained / yanked crates: cargo deny check locally (yanked = "warn" in deny.toml).
Wheel purity¶
Default maturin wheels use the faer path and must not link system BLAS.
Optional blas features (if added later) are non-default.
CodeQL¶
- Local gate only (requires
codeqlonPATH):bash scripts/gate_codeql.sh— fails unless rust / python / actions SARIF reports have 0 findings. Config:.github/codeql/codeql-config.yml(security-and-qualitysuites). - Not run in GitHub Actions; run before release or when touching security-sensitive surfaces.
- Third-party Actions in workflows are pinned to commit SHAs; workflows set explicit
permissions.
Published surface¶
| Surface | Destination | Notes |
|---|---|---|
Rust facade antecedent + antecedent-* library crates |
crates.io | Tag workflow publish-crates.yml; see scripts/publish_crates.sh |
Python package antecedent (PyO3 crate antecedent-py) |
PyPI / GitHub Release assets | Not on crates.io (publish = false) |
Evidence commands¶
# Local slow path: unsafe forbid scan + inventory + benches (+ optional deny)
bash scripts/gate_release.sh
# License / advisory / source policy (optional local)
cargo deny check
# CodeQL (0 findings)
bash scripts/gate_codeql.sh