Keyed parent on ureq 3 (rustls + ring, bundled roots), no async runtime: config from the environment (secret never printed, JWT expiry logged), JSON line logs with a field allowlist (child stderr escaped and truncated), strict key validation before any URL, Backend trait over PostgREST RPCs and Storage objects with closed error kinds, one job per claim with the STORAGE.md §3.4 mapping (content codes, processing_error on signals / timeout / overflow, Broken stops the loop with exit 20, a refused commit deletes nothing), sweeper (expire pending, purge queue, quarantine leftovers), per-stage watchdog (exit 21), WORKER_ONCE for tests, run --check extended. 11 loop tests on a fake backend and decoder; sandbox tests and seccomp derivation unchanged (the child still makes the same 7 syscalls); image 11.6 MB.
62 lines
2.5 KiB
TOML
62 lines
2.5 KiB
TOML
# Faunosteo Rust workspace (plan R0, docs/development/RUST_ARCHITECTURE_REVIEW.md Part III).
|
|
# Three crates: core (feature-gated library), wasm (browser facade), worker (service binary).
|
|
# Commands run on the native toolchain of the development machine (rustup, the channel of
|
|
# rust-toolchain.toml) or inside the builder image: docs/development/RUST.md §1.
|
|
[workspace]
|
|
resolver = "3"
|
|
members = ["crates/core", "crates/wasm", "crates/worker"]
|
|
|
|
[workspace.package]
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
license = "MIT"
|
|
rust-version = "1.99"
|
|
publish = false
|
|
|
|
# The path dependency on crates/core is declared per crate (`path = "../core"`): cargo-deny
|
|
# 0.20 reads a workspace-inherited path dependency as a wildcard and fails the bans check.
|
|
[workspace.dependencies]
|
|
serde = { version = "1.0.229", features = ["derive"] }
|
|
# preserve_order keeps the input key order of parsed documents (JSON.stringify semantics).
|
|
# float_roundtrip: the default parser is a fast path that can be one ULP off (found by the R0
|
|
# proof: 1715.4285714285713 came back as 1715.428571428571); JavaScript parses correctly.
|
|
serde_json = { version = "1.0.154", features = ["preserve_order", "float_roundtrip"] }
|
|
ts-rs = { version = "12.0", features = ["serde-compat"] }
|
|
# The CLI in docker/rust-builder.Dockerfile must be this exact version.
|
|
wasm-bindgen = "=0.2.129"
|
|
image = { version = "0.25.10", default-features = false, features = ["jpeg", "png", "webp"] }
|
|
libwebp-sys = "0.14.4"
|
|
seccompiler = "0.5.0"
|
|
rlimit = "0.11"
|
|
libc = "0.2"
|
|
# Worker job loop (R1): blocking HTTP client (rustls + ring, bundled webpki roots for a managed
|
|
# Supabase over HTTPS) and the hash of the clean output. No async runtime: the loop is sequential.
|
|
ureq = { version = "3.4.2", default-features = false, features = ["rustls", "json"] }
|
|
sha2 = "0.11"
|
|
|
|
# The library crates deny unwrap/expect so that no panic path depends on content;
|
|
# the worker binary relaxes disallowed_methods (it owns I/O) in its own [lints].
|
|
[workspace.lints.rust]
|
|
unsafe_code = "forbid"
|
|
|
|
[workspace.lints.clippy]
|
|
unwrap_used = "deny"
|
|
expect_used = "deny"
|
|
disallowed_methods = "deny"
|
|
|
|
# Dependencies optimised even in debug builds: the sandbox tests decode 4096² images under a
|
|
# 10 s CPU limit, which an unoptimised image decoder does not meet.
|
|
[profile.dev.package."*"]
|
|
opt-level = 3
|
|
|
|
[profile.release]
|
|
opt-level = 3
|
|
lto = "fat"
|
|
codegen-units = 1
|
|
# The worker child dies on a panic (the parent logs it); on wasm32 the std is abort anyway.
|
|
panic = "abort"
|
|
strip = "symbols"
|
|
|
|
[profile.release.package.faunosteo-wasm]
|
|
opt-level = "z"
|