# 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", "no-serde-warnings"] } # Zod `.url()` is `new URL()`: the WHATWG parser of the url crate reproduces it (R2 plan P2). url = "2.5.8" # SVG reading (R3): a read-only XML tree, DTD refused by default, node limit; positions give # the qualified names the allowlist matches. Its tree building recurses: the core prescan caps # the nesting depth before any parse (crates/core/src/anatomy/svg/prescan.rs). roxmltree = { version = "=0.21.1", default-features = false, features = ["std", "positions"] } # The CLI in docker/rust-builder.Dockerfile must be this exact version. wasm-bindgen = "=0.2.129" # FlateDecode inflation of the PDF attachment (R4): the version `png` already locks through # flate2; no std, so the same code runs on wasm32. miniz_oxide = { version = "0.9.1", default-features = false, features = ["with-alloc"] } 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" # Shortest round-trip float digits with ECMAScript's tie rule (round half to even), the # formatter serde_json already uses (R5.1b, F1): the version serde_json locks. zmij = "1.0.23" # NFD for the pipeline's slugs and region roots (R5.2): the normaliser `url` already locks # through idna, its compiled data only. icu_normalizer = { version = "2.3.0", default-features = false, features = ["compiled_data"] } # 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"