From 8d16be577cb55be37ae380e59ccf8b3136bd08a8 Mon Sep 17 00:00:00 2001 From: bchanot Date: Mon, 19 Oct 2026 00:38:43 +0200 Subject: [PATCH] chore(memory): TODO R4.6 plan (session, facade, app driver, suites, browsers, docs, recette) --- .claude/tasks/TODO.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index cb2bf348..189812ba 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -241,7 +241,15 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] R4.5d external checks: `qpdf --check` clean, `pdfdetach -list` osteo-report.json, `pdftoppm -r 150` R3 vs R4 0 px (12 + real raster), O11 frozen scanner + N-1 Zod copy read every R4 PDF, stripped R4 PDF → attachment_stripped; TS reader (packages/pdf) reads R4 PDFs; R4 PDF → Rust import → same report (no data loss) - [x] R4.5e wasm: proofs export `export_pdf_for_test` (input JSON + rasters) → wasm digests == native digests; module size with the writer linked (W1 ≤ 600 KB gzip); Node timings/allocations on demo, L, CAP vs TS baseline (same files) - [x] R4.5f (done 2026-10-18; STOP before R4.6) record RUST.md §10.7, ledger targets, suites green; STOP before R4.6 - - [ ] R4.6 app export (session in main instance, owner phone check of L) + - [ ] R4.6 app export (owner go 2026-10-19; session in main instance per OD-2; stop before R4.7) + - [ ] R4.6a core `pdf/write/session.rs` `ExportSession` (B.1.4 state machine: `new` → branding batch → observation k batches → done; `add_raster` decodes + writes the image object on arrival, PNG and planes dropped; `raster_failed` → warning; closed kinds `unknown_key` `duplicate_key` `out_of_order`); `views.rs` (`raster_size_of` on O4, `compose_highlight` per (observation, view), branding SVG requests); `objects.rs` streams into one buffer (catalog/pages written at the end, B2: R4 digests re-frozen once, declared); layout split (branding / observation / finish) over an `ImageSink`; `export_pdf(input, &Rasters)` = a driver over the session (one code path); decode failure of a view → `view_raster_failed` (TS `embedPng` throw), not `self_check_failed` + - [ ] R4.6b cargo: O1/O4/O6 and O2 suites green on the session; view SVG = TS `renderHighlightedView` text (compose oracle), raster sizes = O4; state-machine refusals; warnings order (rejection order then view order); memory: linear high-water on demo/L/CAP via the proofs build vs PDF size + - [ ] R4.6c facade: `ExportSession` wasm-bindgen struct (`new(input)`, `next()` → `ExportStep` JSON, `add_raster(key, bytes)`, `raster_failed(key)`, `finish()` → bytes, `warnings()`), ts-rs `ExportInput` `RasterRequest` `ExportStep` `ExportWarning` `ExportErrorKind`; `CoreRuntime` session wrapper (generation-bound, `invoke`, `free` in finally); proofs export kept for the digests + - [ ] R4.6d app: `apps/app/src/pdf/labels.ts` (verbatim from `packages/pdf/src/i18n`), `export.ts` on the session (snapshot, branding, `new Date()`, `next` loop, `browserRasterizer` under `Promise.all`, `raster_failed` in rejection order then `add_raster` in request order, `finish`, free); EditorRoute alerts unchanged; `exportReportToPdf` keeps its signature; `@faunosteo/pdf` leaves `apps/app/src` (tests keep it until R4.8) + - [ ] R4.6e app suites: pdf.goldens (Step 6 text/images/links via the app path, Rust output), pdf.roundtrip, pdf.export.app (re-export via core), EditorRoute.export, coreStopped/coreFailures mocks; app-path bytes = R4 digests (stub rasters, FIXED_EXPORTED_AT); 612 leaves exported + re-imported on Rust; export Rust → import Rust, → TS reader, → N-1 (O11 + Zod): no loss + - [ ] R4.6f browsers (scripts/browser): Rust vs TS composed-view rasters pixel-identical (Chromium, Firefox, WebKit); E3/E4 harness demo/L/CAP, same data, TS vs Rust: total, raster, serialise, linear memory, JS heap, RSS; release proof on success / raster error / cancel (unmount) / recovery (trap mid-session); W1 shipped module with the writer linked (gzip -9; report > 550 KB) + - [ ] R4.6g docs: RUST.md §10.8 (buffers ownership and lifetimes, allocations, release proofs, E3/E4 tables, W1, deviations: catalog at the end, decode at arrival, logo batch order), DEPLOY.md if the module size line moves, fixtures README, ledger rows (pdf.goldens, pdf.roundtrip targets filled), memory (BDR, LRN, journal) + - [ ] R4.6h owner recette procedure (visual + functional on the owner's devices: FR/EN, logos, annotations, real rasters, links, L on the phone), report, STOP before R4.7 - [ ] R4.7 report-compare in Rust - [ ] R4.8 deletions + docs + ledger census - [ ] R4.9 verifier + security + owner final acceptance → merge on owner signal