docs/development/R4_J1.md: the two LAN surfaces (dev server, production build behind the DEPLOY CSP through serve.mjs --host on the DEV origin), the kit folder generated by scripts/r4-j1-kit.mjs (reference PDFs, the O8 hostile corpus with expected messages, rescue copies), twelve checks per device, what to report.
75 lines
5.0 KiB
Markdown
75 lines
5.0 KiB
Markdown
# R4 J1: device acceptance of the Rust import
|
||
|
||
Plan `.claude/tasks/plans/2026-10-17-rust-r4-pdf-core.md` §A.4 (J1), owner
|
||
conditions BDR-058. The import of the application runs in a disposable
|
||
worker on the Rust core since R4.3 (`docs/development/RUST.md` §10.5); the
|
||
export is still the TypeScript engine (R4.6). Headless runs in Chromium,
|
||
Firefox and WebKit are recorded in RUST.md §10.4 and §10.5; nothing below is
|
||
validated until it has run on the owner's devices.
|
||
|
||
## 1. Serve the build on the LAN (owner's machine)
|
||
|
||
Two surfaces, both on the DEV origin (`scripts/dev-env.sh`,
|
||
`FAUNOSTEO_DEV_HOST`), never on every interface:
|
||
|
||
1. The development server, as for the R3 acceptance: `pnpm dev` (local
|
||
stack) or `pnpm dev:offline` (local tool), `http://<FAUNOSTEO_DEV_HOST>:5173`.
|
||
No CSP header, HMR on.
|
||
2. The production build behind the DEPLOY CSP (what the proofs ran):
|
||
`pnpm build:preview` then
|
||
`node scripts/browser/serve.mjs --host "$FAUNOSTEO_DEV_HOST" --port 4173`,
|
||
`http://<FAUNOSTEO_DEV_HOST>:4173`. Static files, the nginx SPA fallback,
|
||
the DEPLOY `Content-Security-Policy` with `'wasm-unsafe-eval'` on every
|
||
response. `--csp without` serves the same build without the keyword (the
|
||
import must then show the engine message). Stop it with Ctrl-C; it binds
|
||
the one address given. Run both surfaces for the memory items (2 is the
|
||
one that matters for the CSP and the worker chunk's caching).
|
||
|
||
## 2. The kit
|
||
|
||
`node scripts/r4-j1-kit.mjs [dir]` writes a folder (about 13 MB, synthetic
|
||
data only) with `ATTENDU.md` listing the expected message of every file:
|
||
|
||
- `1-reference/`: Step 5 v2 and v3 PDFs, the R3 exports (FR / EN, with and
|
||
without logos, the real-raster export, the store-path export), the Step 6
|
||
envelopes. Every one opens the editor.
|
||
- `2-hostile/`: the 51 PDFs of the O8 corpus with their message (the four
|
||
declared R4 differences applied: `values-1m`, `surrogate-content-overwritten`,
|
||
`surrogate-version-overwritten`, `two-files-decoy-first`).
|
||
- `3-copies/`: rescue copies (valid, BOM, no extension, invalid UTF-8,
|
||
invalid JSON, version 1, oversized 18 MB).
|
||
|
||
Copy the folder to the devices (AirDrop, a share, a USB key); on iPhone pick
|
||
from Files.
|
||
|
||
## 3. Checks per device (computer, iPhone, low-end Android: the OD-6 list)
|
||
|
||
Record the device, the browser and its version, and the surface (1 or 2).
|
||
|
||
| # | Check | Expected |
|
||
|---|---|---|
|
||
| J1.1 | `1-reference/`: pick each file from Home | the editor opens; the R3 and Step 6 envelopes alert « Restauration complète. Archive Faunosteo importée… »; v2 files alert the migration count; no engine message |
|
||
| J1.2 | `2-hostile/`: pick each file | the message of `ATTENDU.md`, the file untouched, Home stays usable (button enabled again) |
|
||
| J1.3 | `3-copies/`: pick each file | per `ATTENDU.md`; a refused copy leaves the tab's draft in place |
|
||
| J1.4 | Engine unavailable: surface 2 with `--csp without`, pick `r3-demo.fr.logos.pdf` | « Le moteur de lecture n'a pas pu être chargé. Réessayez l'import. »; a second pick shows it again; nothing else changes |
|
||
| J1.5 | Engine recovered: back to surface 2 with the keyword, same pick | the editor opens |
|
||
| J1.6 | Interrupted import: pick `2-hostile/values-1m.pdf` and tap « Nouveau bilan » at once, or leave Home within the first second | no alert, no editor from the import, the new page intact |
|
||
| J1.7 | Offline import: open the editor once (engine loaded), enable airplane mode, back to Home, pick a reference PDF | the editor opens (the worker chunk and the module come from the page and the cache) |
|
||
| J1.8 | Large legitimate export: from a computer, open `1-reference/r3-demo.fr.logos.pdf`, then on the phone import the L export (owner: the 60-observation report, export it from the editor on the computer first, about 42 MB) | the editor opens within the task timer (20 s); note the time to the editor; the tab survives |
|
||
| J1.9 | Memory on the phone: 6 imports of the L export in a row (Home → pick → editor → Home) | no reload of the tab by the system, no Safari memory warning; note any slowdown |
|
||
| J1.10 | Repetition: 20 picks of `2-hostile/values-1m.pdf` on the phone | 20 times the message, the tab alive |
|
||
| J1.11 | Rescue copy under the cap on the phone: `3-copies/copie-valide.json`, then `copie-trop-grande.json` | the editor; the refusal |
|
||
| J1.12 | Timing: note the time from the pick to the editor for `r3-demo.fr.logos.pdf` and for the L export per device | reported in RUST.md §10.5; the 20 s timer is confirmed or moved by the §B.3 rule (≥ 10 × the slowest legitimate import) |
|
||
|
||
Browsers: Safari on iPhone (the WebKit path that headless WPE does not
|
||
stand for), Chrome and Firefox on the computer, the Android browser. A
|
||
device or browser not run is reported as not run.
|
||
|
||
## 4. What to report
|
||
|
||
The table above with the result per device, the timings of J1.8 and J1.12,
|
||
any message that differs from `ATTENDU.md`, any system reload or memory
|
||
warning, and the device list actually run. The results go to RUST.md §10.5
|
||
and `docs/development/PDF_IMPORT_HARDENING.md` §5 (the gate stays open:
|
||
imports are not offered to external users).
|