fix(domain): security audit follow-ups — deserialise JSON by reference, literal delete paths in the wasm build
The security gate (PASS, 0 blocking) reported LOW items: an imported attachment's Value was copied for the wrapper and the snapshot gate (a hostile 16 MiB attachment multiplied linear memory), and wasm-build.sh deleted its outputs through a variable. Every JSON input is now read with T::deserialize(&Value) (same errors, no copy); one deserialiser instead of two also shrinks the shipped module from 1,180,281 to 1,046,498 bytes raw (372,132 → 340,929 gzip). The two outputs are removed on their literal paths. RUST.md records the numbers, the quarantine retention and the base-image tag residual.
This commit is contained in:
1 parent
8e8c58efca
commit
e49009e363
10 files changed
+39
-29
No files matched your search
+2
-2
@@ -8,10 +8,10 @@ Versions follow [Semantic Versioning](https://semver.org/).
|
||||
|
||||
### Changed (Rust R2, domain core, 2026-10-14)
|
||||
|
||||
- **The application's domain rules run in Rust** (`crates/core`, through the wasm facade and `@faunosteo/core-wasm`): sheet, report and archive contracts with the Zod semantics reproduced, the 21 sheet integrity rules and the publish check, the sheet index, the v2 → v3 migration, the rebase on the loaded sheet, the sheet snapshot, the layered archive reading, the editor's click chain and reducers, the findings and vertebra rules, report creation and the observation list operations. Consumers switched: the editor, the pickers, the store, the draft restore, the PDF import (after the engine's byte scan) and export (snapshot), the Supabase publish gate (fails closed). The module (372 KB gzip) loads only on the sheet pages; sign-in, the `/app` space and Home never request it. Without `'wasm-unsafe-eval'` in the CSP the editor shows a degraded notice with a retry and leaves the session's draft untouched (DEPLOY.md: set the keyword before deploying an R2 image; R2 images are never built on the VPS).
|
||||
- **The application's domain rules run in Rust** (`crates/core`, through the wasm facade and `@faunosteo/core-wasm`): sheet, report and archive contracts with the Zod semantics reproduced, the 21 sheet integrity rules and the publish check, the sheet index, the v2 → v3 migration, the rebase on the loaded sheet, the sheet snapshot, the layered archive reading, the editor's click chain and reducers, the findings and vertebra rules, report creation and the observation list operations. Consumers switched: the editor, the pickers, the store, the draft restore, the PDF import (after the engine's byte scan) and export (snapshot), the Supabase publish gate (fails closed). The module (341 KB gzip) loads only on the sheet pages; sign-in, the `/app` space and Home never request it. Without `'wasm-unsafe-eval'` in the CSP the editor shows a degraded notice with a retry and leaves the session's draft untouched (DEPLOY.md: set the keyword before deploying an R2 image; R2 images are never built on the VPS).
|
||||
- **Session data never dropped silently**: an unreadable draft or archive is set aside under `osteo:quarantine:*` with a notice; a draft rebased with unresolved items keeps its raw text.
|
||||
- Behaviour differences, declared in `docs/development/RUST.md` §8.7: drafts and attachments written in contract order (values unchanged, the previous build reads them, D-R11); a lone UTF-16 surrogate escape reads as U+FFFD (L1, to confirm); typed errors on inputs the interface never produced.
|
||||
- Proofs: contracts byte-equal to the Zod output on the reference documents, the three archive envelopes frozen before the switch and deep-equal after, 1,000+ cases frozen from the TypeScript, permanent N-1 reader test, generated pgTAP conformance file (real stack 446/446), CSP proof on the real image. No interface, archive format, database or graphic change; release 0.2.0 untouched.
|
||||
- Proofs: contracts byte-equal to the Zod output on the reference documents, the three archive envelopes frozen before the switch and deep-equal after, 924 cases and verdicts frozen from the TypeScript, permanent N-1 reader test, generated pgTAP conformance file (real stack 446/446), CSP proof on the real image. No interface, archive format, database or graphic change; release 0.2.0 untouched.
|
||||
|
||||
### Changed (development environment, 2026-10-13)
|
||||
|
||||
|
||||
Reference in new issue
Block a user