docs(docs): Rust review Annex C — owner validation and amendments (D-R4, D-R5, D-R9, D-R13), R0 go; chore(memory): BDR-045

This commit is contained in:
bchanot committed 2026-10-12 23:28:07 +02:00
1 parent 51667788e5
commit 40d416b497
2 files changed
+41

No files matched your search

+5
View File
@@ -365,3 +365,8 @@ Status: active, awaiting owner validation of the study + 13 decisions D-R1..D-R1
Owner validated the study's orientation + 10 principles: Rust worker at Step 8; Cargo workspace; native + WASM libs; progressive anatomy migration; PDF migration under complete compatibility proofs; React + PostgreSQL/Supabase kept; testable increments with rollback; no premature deletion of TS still used; fully dockerised, production builds outside the small VPS; WASM vs production CSP proven before activation. Requests: expanded decision table (Annex A), R0 scope with build tools reproducible in Docker and no Rust on the VPS (Annex B), serde/WASM/panic/musl hypotheses verified experimentally when they condition a choice (R0 proofs as permanent tests). Release 0.2.0 still waiting. R0 and Step 8 implementation NOT started until the 13 decisions are validated.
Status: active; awaiting D-R1..D-R14 validation.
## BDR-045 | 2026-10-12 | Rust review rev 2 validated with amendments; R0 go
Owner validated D-R1/2/3/7/8/10/11/12/14 as recommended. Amended: D-R4 libwebp C only in the isolated child, parent validates result + limits before use, linked libwebp version known/controlled, no new unmanaged risk; D-R5 fingerprint → canonical JSON (RFC 8785 JCS or strictly defined alternative) independent of formatter, explicit compat with old fingerprints/archives, existing fingerprints untouched, decision prepared for R5; D-R9 Edge Functions → Rust services, shared code but distinct processes (worker vs HTTP endpoints), same image + subcommands, least privilege per service, Supabase Auth keeps OAuth; D-R13 CSP `'wasm-unsafe-eval'` proven experimentally without widening JS permissions, reproducible Docker builds in CI, digest images + rollback prepared, no auto-deploy, no image publication without workflow + validation, VPS never compiles Rust. R0 go per Annex B (7 proofs for real, unverified hypotheses tested, blockers reported not assumed); R1 NOT started without a go; release 0.2.0 pending; live deployment untouched.
Status: closed (owner, 2026-10-12); R0 in progress on feature/rust-r0-foundation.
@@ -949,3 +949,39 @@ digest, CSP line, gzip, VPS headroom, rollback = previous digest) without
touching the live deployment; `pnpm check` unchanged; no production
artifact changed. Owner validation closes R0; R1 (the Step 8 worker) starts
on a separate go.
---
## Annex C. Owner validation and amendments (2026-10-12)
Revision 2 validated with the amendments below. The rule stays definitive:
Rust by default whenever it gives an equivalent or better result with no
functional, practical, graphical, security or reliability loss. R0 may start;
R1 waits for a separate go; release 0.2.0 waits for its own validation.
Validated as recommended: D-R1 (three crates), D-R2 (reader and writer at
R4 after the oracles exist), D-R3 (browser canvas, no resvg in wasm), D-R7
(form validation in TypeScript), D-R8 (Astro exception, re-evaluated at Step
22), D-R10 (order R0–R5), D-R11 (deterministic serialisation with old-reader
compatibility), D-R12 (gated PDF functions ported with identical behaviour),
D-R14 (import in a Web Worker, security controls kept before public opening).
Amended:
| Id | Amendment |
|---|---|
| D-R4 WebP | libwebp in C is allowed only inside the isolated processing child. The parent checks the validity and the limits of the produced result before any use (container structure, dimensions, size, absence of metadata). The native libwebp version actually linked into the build is known and controlled (logged at start, checked in CI). The migration must not introduce new unmanaged risks. |
| D-R5 sheet fingerprint | Preference for a deterministic fingerprint over a canonical JSON representation independent of the formatter (Prettier or Rust): study RFC 8785 (JCS) or a strictly defined alternative, so that a purely technical serialisation change never causes needless rebases. Explicit compatibility with the fingerprints and archives already produced. Existing fingerprints are not changed now: the decision is prepared for R5 and its implications verified before the switch. |
| D-R9 Rust HTTP services | Business Edge Functions replaced by Rust services where appropriate. Shared code but distinct processes for the job worker and the future exposed HTTP endpoints; they may come from the same Docker image run with different subcommands. Each service holds only the secrets, permissions, resources and protections it strictly needs. Supabase Auth keeps the OAuth mechanisms it already handles. |
| D-R13 WASM, CI, deployment | CSP compatibility with `'wasm-unsafe-eval'` validated experimentally, without widening JavaScript permissions. Rust/WASM builds reproducible in Docker and run in CI. Images identified by digest and a rollback strategy prepared. No automatic deployment to the VPS; no publication or promotion of a production image without an appropriate workflow and a validation; the VPS never needs to compile the Rust project. |
R0 scope confirmed as Annex B, with these instructions: the seven proofs
run in the real environment as far as possible, the unconfirmed hypotheses
(serialisation, wasm panics, musl, seccomp) verified experimentally, a proof
that cannot be obtained reported as a blocker rather than assumed; during R0
the React application, Report v3, PDF v2/v3, Supabase, the interfaces and
the existing tests stay unchanged; the WASM integration does not force the
frontend to load the module; no anatomy, PDF or business validation
migration (R2–R5); no avatar processing (R1); everything dockerised, the
production image produced in CI and pulled by the VPS; the live deployment
untouched; no tag or merge into main.