chadtmiller.com/monolith
An atproto PDS
The code gates: rustfmt, clippy, cargo-deny and no unsafe code, among the gates
MergedThis pull makes the code gates (fmt, clippy, cargo-deny, forbid-unsafe) part of just gates and the gates workflow. It also fixes what they found: it upgrades k256/p256 to 0.14 for RUSTSEC-2026-0387, moves the libc calls to rustix, and adds #![forbid(unsafe_code)] to the crate roots.
What I checked:
- Gate wiring.
harness/gates.mjsruns thecodesuite correctly: cargo entries run from the repo root, andcode.mjsruns under node inharness/. The workflow'stoolsstep installs rustfmt, clippy and cargo-deny, and it caches/opt/cargo-deny. The README, Justfile and workflow comments now agree thatcodeis among the gates. - Spec and README. No behaviour changes, so no spec change is needed. The README says what is built, with no history in it.
- Harness. Nothing is loosened.
deny.tomlonly adds 0BSD to the licence allow-list, which fits a permissive licence, and there are no ignored advisories. libctorustix. The free-space floor inlimits.rsis the samef_bavail * f_frsizecomputation as before. The EMFILE/ENFILE retry inlog.rsis the same check throughErrno. Both removed#[allow]s andunsafeblocks are gone. The new crate isrustix, not an atproto or MCP crate, and server code takes nothing from the reference PDS's source.
Not done:
- Unread source. The pull reformats about 57k lines across 80 files. I did not read the fmt and clippy rewrites of the crate sources line by line, because
cargo fmt --check, clippy and the test suite enforce them. I read only thelibcreplacement sites. The rename ofTids::nexttonext_tidand the test-lock change were not inspected. - Checks. No run was listed for this commit yet, so I could not confirm the gates are green. The merge queue's full run will confirm the crypto upgrade, and the harness's signature checks cover it.
The queue ejected this on clippy: CI's clippy is 1.98's, one release newer than the one the branch was checked with, and has two lints the older one lacks. Fixed in 4f18988: lthash::state uses as_chunks_mut::<2>() (chunks_exact_to_as_chunks), and scopes::look returns its refusal boxed (result_large_err), unboxed at its two callers. No #[allow]. Checked in CI's own image (rust:1.98): cargo fmt --check and cargo clippy --workspace --all-targets -D warnings clean; the pds-space tests and pds-server's scopes and OAuth tests pass.
My approval at a8946ea stands. Since then the pull has only fixed more lints. scopes::look now returns Result<_, Box<Response>> (clippy's result_large_err), and its callers in lib.rs and blobs.rs unbox the error with *r. In lthash.rs, state() now fills the output with as_chunks_mut::<2>() instead of chunks_exact_mut(2). The bytes written are the same, little-endian per lane, and the 2048-byte array splits exactly into 1024 chunks of 2. None of this changes behaviour, so no spec change is needed, and it adds no #[allow], no loosened harness check and no new crates. The gates run for this head was still running when I looked, so I couldn't confirm it is green. The merge queue will.
The code gates: the source formatted, free of clippy's warnings, its dependencies checked, and no unsafe code. These checks are now among the gates. No behaviour changes: the harness agrees exactly as before.
Commits, each one step
cargo fmt --all, alone, so it is easy to replay elsewhere.-D warnings, all targets): every lint fixed in the code, with no#[allow]added. The notable changes:Tids::nextis renamednext_tid, so it isn't mistaken forIterator::next;.await.cargo deny check: RUSTSEC-2026-0387 incrypto-bigint0.5 is fixed by upgradingk256/p256to 0.14 (crypto-bigint0.7.11), not ignored. The crypto is byte-identical: the atproto test vectors, the signature tests and the harness's signature checks all pass. 0BSD, a permissive licence (quoted_printable, throughlettre), joins the allow-list.#![forbid(unsafe_code)]in all 8 crate roots. Thelibccalls (statvfsfor the free-space floor, file modes, fsync variants) go throughrustixinstead.harness/gates.mjsgains acodesuite, and the workflow gainstoolsandcodesteps. The README's Checks section says they are among the gates.Checked:
just code(fmt, clippy, deny, and the unsafe check: "all 8 crate roots forbid unsafe code"),cargo test --workspace, plain seed 1, crash seed 21 with--firehose,--limits,--lifecycle, and--store. The merge queue runs the full gates,codeamong them.🤖 Generated with Claude Code