docs(docs): RUST.md §10.11 R4.9 gates (verifier ×3 CONFORME, security re-gates PASS, check:all); TODO R4.9 ticked, owner actions; memory BDR-065, EVAL-025, LRN-065, journal

This commit is contained in:
bchanot committed 2026-10-20 22:12:24 +02:00
1 parent 49b812b9b4
commit 45093135e9
6 files changed
+54 -6

No files matched your search

+7
View File
@@ -487,3 +487,10 @@ Status: active; owner checkpoint R4.7 pending.
Context: owner validated R4.7 (three A.3 lines accepted, 25 s first compile accepted, no prebuilt binary). R4.8 brief: delete packages/pdf, pdf-lib, TS CLI, redundant tests, generators; keep frozen oracles, goldens, reference PDFs, fixtures; `packages/anatomy` render until R5; audit consumers first; non-regression proofs; checks must fail on missing Rust component; no merge, no R5.
Decision: vitest read-back of the app export without pdf-lib = `tests/helpers/pdfFile.ts`, a reader of the writer's own format (objects, inline dicts, Flate via node:zlib, Kids order, Info, annots, XObjects) + `buildPdfWithAttachment` for the rejection inputs; view goldens from the SVGs captured at the mocked rasteriser (request order = engine order; the bundled partner SVG logo comes first with real branding); `importReportFromPdf` for tests = module `SheetHandle.import_pdf` on a throwaway handle + worker's `pdfImportOf` (`tests/helpers/pdfImport.ts`; `GlueSheetHandle.free()` added to the interface); envelope + N-1 suites read attachments with the frozen O11 scanner, exported through `@faunosteo/core-wasm/n-1` (index re-export only, copies untouched); `pdf.export.app` deleted (re-export from envelope = cargo `export_from_envelope`, no sheet/branding in signature); `@faunosteo/domain` dropped from apps/app (two incidental test uses → core types / N-1 Zod); ledger script reads frozen cases from the committed TSV. Alternatives dropped: keep pdf-lib as test-only devDependency (review R4 row forbids it in apps/app lockfile); move all content-stream checks to cargo (loses app-path coverage of non-fixture reports); `importPdf` on main-thread SheetOps (breaks OD-1).
Status: active; owner checkpoint R4.8 pending.
## BDR-065 | 2026-10-20 | R4.9: Chromium export reserve classified bounded browser raster path; no rasteriser change; recettes re-issued
Context: owner R4.9 brief (R4.8 validated; final checks, memory bench before merge, import risk classes, J1/J2 re-issue, fresh audits; no merge, no R5). Bench `scripts/browser/r4-memory-bench.mjs` (5 dimensions + rest windows + Chromium pressure + raster-only control).
Decision: Chromium ≈ 20 MiB/L export = browser raster path, not session: control with no core call grows same 20 MiB/step to same plateau (436 vs 437 MiB, 16 steps, last 5 within 10 MiB); linear flat after init, JS heap flat, 847/847 canvases + Blobs collected, 854/854 URLs revoked after 30 s; critical pressure returns nothing. Class: accepted temporarily (§6 row 7), device check J2.6/J2.7. Correction only if a device fails: one reused canvas / OffscreenCanvas, bench vs control first; rasteriser untouched (pixel parity pinned). Import risks: PDF_IMPORT_HARDENING §6, 20 rows; blocking before merge = J1 + J2 device runs + timer confirmation. Port 4173 recette surface closed by UFW by default; owner opens one rule per session.
Alt rejected: reused canvas now (no measure says it helps; risk on pinned raster output); disposable export worker S2 (no device failure).
Status: active; owner checkpoint R4.9 pending; gitleaks allowlist `[gated]` marker = owner action.
+7
View File
@@ -185,3 +185,10 @@ Method: scratch round-trip test (3 golden reports); fuzz agent (37k draft.restor
Result: copy restorable in app; loop impossible with real drafts, defended anyway; work-loss paths closed; app 405 tests, check:all green (~75 s cached); verifier CONFORME 10/10 (1 floor ASSERT_DROP = guard test moved, authorized by plan); security PASS 2 LOW; docs NONE.
Anomalies: challengers caught trap re-read spending recoveries (2 lenses), BDR-055 contradiction, wrong "parity" cap (50 MiB file vs 16 MiB JSON) only on confirm pass; executor found Retry-during-recovery edge.
Action: owner LAN validation, then merge on owner go; no R4, no release, no deploy.
## EVAL-025 | 2026-10-20 | R4.9 gates — bench, verifier ×3, security ×4, check:all
Method: memory bench 3 engines × demo/L × 6 exports + Chromium L 16 + raster control; contract 16 criteria (owner §2 list), fresh verifier per pass; full security gate on 168 R4 source files, then targeted re-gates on each fix; check:all.
Result: verifier pass 1 ECARTS(1): core with no feature did not compile (`restore_copy` used gated `pdf::read` const; workspace feature unification via crates/wasm hid it in rust-check/check:all) → gated + no-feature clippy in rust-check; pass 2 ECARTS(1): §6 lacked J2 merge-gate row → added. Security pass 1 BLOCK(1): `.gitleaks.toml` allowlist (R4.1, owner-approved in journal) lacks owner `[gated]` marker → owner action; MEDIUM serve.mjs `--host ""` bound every interface.
Anomalies: my first host fix = exact-string denylist → bypassed by `0`, `0::`, `::ffff:0.0.0.0`, scoped `::` (re-gate 1); rebuilt resolve-then-BlockList; re-gate 2 found post-bind check dead for IPv6 (`family` 'IPv6' vs 6) and my fstat-first CLI read opened FIFOs before the type check (regression). Each fix of a gate finding introduced the next finding: 3 re-gates for 2 small fixes. Contract CHECKs used root vitest path (absent): oracle defect.
Action: owner checkpoint; floor 21 DELETED_TEST (R4.8 deletions, approved in brief §1) need owner `[gated]` clarification line to clear formally.
+5
View File
@@ -295,3 +295,8 @@ Owner validated R4.0 plan with conditions (BDR-057, plan §A.6, LRN-059/060). R3
- 2026-10-19 owner validated R4.5; R4.6 go (BDR-062). R4.6 done (9e688b6..): ExportSession (decode on arrival, chunked never-realloc file 1→8 MiB, catalog last, parts → Blob, self-check on attachment chunk), views.rs (compose_highlight requests, raster_size_of O4 57/57), wasm ExportSession + CoreExportSession, app export.ts on session (abort on unmount, User Timing), labels.ts; app suites read content streams (pdfRead.ts), app-path bytes = R4 digests (re-frozen: object order B2, hex upper-case B4), Step 6 goldens via app path, 14 O2 runs through module = digests, request SVG = TS compose text, export Rust → import Rust / TS reader / N-1 ok. E3 Chromium demo 0.67, L 0.74 (Firefox 0.66/0.67, WebKit 0.91/0.95); E4 CAP completes 3 engines (TS stopped by ceiling); peaks lower (L Chromium 805→470 MiB). Linear memory L real 62 MiB flat over 7 exports; Chromium per-export RSS growth ≈ 20 MiB on L same as TS control, plateau after 8. Shipped 519.7 KB gzip (W1). rust-check 0, pnpm check 1,099 tests, ledger 11 pending (R4.7). J2 kit + procedure. STOP before R4.7.
- 2026-10-19 owner accepted R4.6 provisionally (Chromium series = open reserve); R4.7 go (BDR-063). R4.7 done: `pdf::compare` (feature `cli`), `report-compare` bin, `scripts/report-compare.sh` behind root `report:compare`, cargo `pdf_compare` 15 tests: O10 230 rows (158 exact, 72 declared A.3 → 62 `report document invalid`, 7 surrogate refusals, 3 `version null`), 11 scenario cases = ledger targets (301 rows, 0 pending), binary spawned 8×. Release binary 7 ms/PDF, 6 MiB RSS; module unchanged 1,535,289 B / 519,795 gzip. RUST.md §10.9, CLAUDE.md, PDF-FORMAT. STOP before R4.8.
- 2026-10-19 owner validated R4.7; R4.8 go (BDR-064). R4.8 done: packages/pdf (70 files, 12,010 lines TS), TS CLI, TS import path, generators, ts-engine comparison deleted; deps pdf-lib / @pdf-lib / resvg / @faunosteo/pdf / tsx / @faunosteo/domain (app) gone, xmldom only under anatomy; test read-back on own `pdfFile.ts` reader, view goldens from captured session SVGs, N-1 scanner exported via core-wasm/n-1, in-process import helper on module reader; `r4.census` suite (8); ledger 301 rows from frozen TSV, 0 pending; app 427 tests, core-wasm 58; docs RUST.md §10.10, CLAUDE.md, README, PDF-FORMAT, DEPLOY rollback R4, CHANGELOG R4 entry, hardening §5 pdf-lib closed. STOP before R4.9.
## 2026-10-20 (R4.9 final checks)
Owner validated R4.8; R4.9 go. check:all green ×2. Memory bench (5 dims, 3 engines, rest windows, Chromium pressure + raster control): linear flat after init, all canvases/Blobs/URLs released, Chromium 20 MiB/L export = browser raster path (control identical, plateau after 8) → accepted temporarily, BDR-065. PDF_IMPORT_HARDENING §6 (20 rows). J1/J2 re-issued (OD-6 list, J1.13, J2.12-14, report:compare dry run identical), kits regenerated outside repo. Gates: verifier ECARTS → no-feature core build fixed + rust-check guard; §6 J2 row; security BLOCK(1) gitleaks marker = owner; serve.mjs wildcard bind fixed (3 re-gates), CLI bounded read. EVAL-025, LRN-065. packages/pdf/node_modules rm refused by permissions → owner. No merge, no R5.
+7
View File
@@ -491,3 +491,10 @@ Apply: any wasm producer of large outputs (R5 pipeline, future image work): meas
- Step 6 goldens were recorded by spying pdf-lib `drawText`/`drawImage`: footers recorded after every page's content (global call order). Read back from content streams, facts come page by page. Same set, same within-page order: compare against the golden stably sorted by page.
- `tests/helpers/pdfRead.ts`: pdf-lib loads the file, inflates each content stream, parses `Tf/Tm/Tj/ET` and `cm … Do`, resolves `/F1` through page resources, WinAnsi = windows-1252. Lets 16 roundtrip + 7 goldens cases run unchanged on the Rust output.
Apply: when an implementation is swapped under a test that spied the old one, read the artefact instead of mocking the new one; keep the old generator pinned to the old engine (r4.writer-oracles → `exportReportArchive`).
## LRN-065 | 2026-10-20 | Feature unification hides no-default builds; host refusal by resolution, not spelling; control run isolates browser memory
- `cargo test --workspace` unifies features across members: crates/wasm enabling `pdf-read` made core compile in every gate while `cargo check -p faunosteo-core` (default = []) failed. Apply: gate runs one per-crate no-feature build (`cargo clippy -p <crate> --all-targets`) whenever a crate has optional features.
- Refusing wildcard binds by string set fails: getaddrinfo accepts `0`, `0x0`, `0.0.0`, `0::`, `::ffff:0.0.0.0`, `::%lo`. Apply: `dns.lookup(host,{all:true})` → refuse if any result in `BlockList(0.0.0.0, ::)` (scope stripped, type from `net.isIPv6(address)`), listen on resolved literal, re-check `server.address()` (its `family` is 'IPv6', lookup's is 6).
- Opening before stat-checking type blocks on a FIFO (O_RDONLY): stat path first, then open, then fstat recheck.
- Browser RSS growth across exports: run the same raster steps with no core call (control) in the same page; same slope + same plateau = browser cache/allocator, not app retention. FinalizationRegistry counters + createObjectURL/revoke ledger + CDP `Performance.getMetrics` / heap census separate page-held objects from renderer memory; `Memory.simulatePressureNotification critical` tests reclaimability.
+8 -6
View File
@@ -262,13 +262,15 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo
- [x] R4.8d non-regression proofs (owner §3): grep census test (no `@faunosteo/pdf`, `pdf-lib`, `@faunosteo/domain` import under apps/app/src, packages/core-wasm/src; the import worker path, the export session path and the root `report:compare` script named by a test), wasm:build, rust-check, pnpm check, pnpm check:all (app image, worker test + image), N-1 reader suites, O2/O3/O7/O8 fixtures still read, 612 leaves, rescue copies and quarantine suites
- [x] R4.8e (done 2026-10-19; STOP before R4.9) docs: RUST.md §10.10 (deleted files and packages, dependencies removed, Rust-only features, TS still legitimate with reasons, tests, risks, R5 prerequisites), CLAUDE.md (stack table, map, PDF conventions, workflow lines), DEPLOY.md (module size, rollback), PDF-FORMAT, PDF_IMPORT_HARDENING §5, TEST_STRATEGY, WORKSPACE, packages/README, fixtures README, CHANGELOG (Unreleased), README; memory (BDR, journal); report, STOP before R4.9
- [ ] R4.9 final verification, independent audits, J1/J2 recettes (owner go 2026-10-20, R4.8 validated; no merge, no R5, stop at the checkpoint)
- [ ] R4.9a memory bench (owner §3: the Chromium 10 MiB reserve of R4.6 is NOT closed by R4.8): `scripts/browser/r4-memory-bench.mjs` on the series machinery, one editor tab, demo + L, ≥ 6 exports after the init export, reproducible; five readings told apart per step: (1) wasm linear memory (`WebAssembly.Memory` captured at instantiation), (2) content-process RSS (watchdog), (3) live canvases / images / bitmaps / blobs / object URLs (FinalizationRegistry counters + createObjectURL/revoke ledger; Chromium heap-snapshot class census), (4) transient peak during the export (RSS sampler), (5) retained after the exports: settled, after the 30 s `downloadBlob` revocation window, after leaving the editor (Home) + GC; three engines; results JSON + table in RUST.md §10.11; cause / severity / fix proposed if a durable retention is confirmed, nothing declared resolved without a measure
- [ ] R4.9b import security classification (owner §4): every open point of PDF_IMPORT_HARDENING §5 and of BDR-058 / BDR-059 / BDR-063 in one table: fixed with proof / accepted temporarily with justification / blocking before merge / before public exposure or upload activation; written in PDF_IMPORT_HARDENING.md §6, hostile refusals kept, no silent change of user data
- [ ] R4.9c J1 + J2 recettes refreshed (owner §5): `R4_J1.md` / `R4_J2.md` on the R4.8 state (export on the core, no TS engine), device list per plan OD-6 verbatim (computer: Chrome + Firefox; iPhone: Safari iOS; low-end Android: its browser), kits regenerated (`r4-j1-kit`, `r4-j2-kit`) and checked, `pnpm report:compare` step in J2, results templates NON TESTÉ untouched; announce TEST FONCTIONNEL J1 DISPONIBLE + TEST FONCTIONNEL ET GRAPHIQUE J2 DISPONIBLE; no human test declared done
- [ ] R4.9d full checks: `pnpm check:all`, PGlite suite, wasm size line (519,795 B gzip accepted; budget 600 KB / report 550 KB kept, proofs test unchanged), oracles + goldens diff vs R4.1 freeze = empty
- [ ] R4.9e independent audits (owner §6): contract `.claude/tasks/contracts/2026-10-20-rust-r4-final-1000.md` (owner §2 list as criteria), fresh verifier + fresh security audit in parallel; real anomalies fixed minimally with regression tests + targeted re-audit; oracles/goldens unchanged
- [ ] R4.9f docs + memory: RUST.md §10.11 (bench, classification, audits, checks, residuals), CHANGELOG, TODO; BDR / EVAL / journal; commits on `feature/rust-r4-pdf-core` (hooks push)
- [x] R4.9a memory bench (owner §3: the Chromium 10 MiB reserve of R4.6 is NOT closed by R4.8): `scripts/browser/r4-memory-bench.mjs` on the series machinery, one editor tab, demo + L, ≥ 6 exports after the init export, reproducible; five readings told apart per step: (1) wasm linear memory (`WebAssembly.Memory` captured at instantiation), (2) content-process RSS (watchdog), (3) live canvases / images / bitmaps / blobs / object URLs (FinalizationRegistry counters + createObjectURL/revoke ledger; Chromium heap-snapshot class census), (4) transient peak during the export (RSS sampler), (5) retained after the exports: settled, after the 30 s `downloadBlob` revocation window, after leaving the editor (Home) + GC; three engines; results JSON + table in RUST.md §10.11; cause / severity / fix proposed if a durable retention is confirmed, nothing declared resolved without a measure
- [x] R4.9b import security classification (owner §4): every open point of PDF_IMPORT_HARDENING §5 and of BDR-058 / BDR-059 / BDR-063 in one table: fixed with proof / accepted temporarily with justification / blocking before merge / before public exposure or upload activation; written in PDF_IMPORT_HARDENING.md §6, hostile refusals kept, no silent change of user data
- [x] R4.9c J1 + J2 recettes refreshed (owner §5): `R4_J1.md` / `R4_J2.md` on the R4.8 state (export on the core, no TS engine), device list per plan OD-6 verbatim (computer: Chrome + Firefox; iPhone: Safari iOS; low-end Android: its browser), kits regenerated (`r4-j1-kit`, `r4-j2-kit`) and checked, `pnpm report:compare` step in J2, results templates NON TESTÉ untouched; announce TEST FONCTIONNEL J1 DISPONIBLE + TEST FONCTIONNEL ET GRAPHIQUE J2 DISPONIBLE; no human test declared done
- [x] R4.9d full checks: `pnpm check:all`, PGlite suite, wasm size line (519,795 B gzip accepted; budget 600 KB / report 550 KB kept, proofs test unchanged), oracles + goldens diff vs R4.1 freeze = empty
- [x] R4.9e independent audits (owner §6): contract `.claude/tasks/contracts/2026-10-20-rust-r4-final-1000.md` (owner §2 list as criteria), fresh verifier + fresh security audit in parallel; real anomalies fixed minimally with regression tests + targeted re-audit; oracles/goldens unchanged
- [x] R4.9f docs + memory: RUST.md §10.11 (bench, classification, audits, checks, residuals), CHANGELOG, TODO; BDR / EVAL / journal; commits on `feature/rust-r4-pdf-core` (hooks push)
- [x] R4.9 results (2026-10-20): bench = linear flat, objects/URLs released, Chromium growth = browser raster path (control identical, plateau), BDR-065; §6 20 rows; recettes re-issued + kits; check:all green 49b812b; verifier CONFORME 16/16 (pass 3); security PASS after BLOCK(1) gitleaks marker (owner) + host bind fix ×3 re-gates; EVAL-025, LRN-065
- [ ] R4.9g checkpoint report (owner §9: verifier, security, checks, memory + reading, residual risks, real merge blockers, J1/J2 instructions, git state) → STOP; merge and R5 only on the owner's explicit signal
- [ ] owner actions: add `[gated 2026-10-18]` to `.gitleaks.toml` allowlist description (security BLOCK); `[gated]` clarification for the 21 R4.8-deleted test files if wanted (verifier floor); open UFW 4173 for the recette session; J1 + J2 on the OD-6 devices
- [ ] owner action (non-blocking): `packages/pdf/node_modules` leftover (13 pnpm symlinks, 6 bin shims, 1 vitest cache file, 0 tracked or useful files) → `rm -rf packages/pdf/node_modules && rmdir packages/pdf` (the recursive delete was refused to Claude by the permission layer)
- [ ] outside R4 (owner 2026-10-17, non-blocking): worker container ignores SIGTERM (Docker kill after 10 s; chore, e.g. `init: true`); README test counter stale (367 vs 1,015)
- [ ] R5 curation pipeline + importer + upload tool: seed golden regenerated once (new `documentSha256`, D-R5), `packages/anatomy` + `packages/domain` deleted, docs map; all before Step 13
+20
View File
@@ -2220,3 +2220,23 @@ Import security: the open points are classified in
blocking before merge, before public exposure). J1 / J2: `R4_J1.md` and
`R4_J2.md` re-issued on this build with the OD-6 device list; every result
cell stays NON TESTÉ until the owner runs it.
Gates (2026-10-20). Verifier, fresh per pass, 16 criteria: pass 1 found the
core alone no longer compiled with no feature (`facade::restore_copy` used
the feature-gated reader's cap; the workspace run unified the wasm crate's
features and hid it from `rust:check` and `check:all`): fixed, and
`rust:check` now lints the core alone; pass 2 found the §6 register without
the J2 merge-gate row: added; pass 3 CONFORME 16/16. The floor lists the 21
test files R4.8 deleted (approved in the owner's brief, every case in the
ledger with a present target): they clear formally only with the owner's
own `[gated]` line. Security, fresh: pass 1 BLOCK(1) on the R4.1
`.gitleaks.toml` path allowlist, which carries no owner `[gated]` marker
(the owner approved it on 2026-10-18; only the owner adds the marker), and
a MEDIUM, the recette server bound every interface on an empty `--host`;
three targeted re-gates closed it: the host is resolved first and any
wildcard result refused in every spelling, the server listens on the
resolved address and re-checks the bound one, and `report-compare` reads
at most the 50 MiB cap after checking the file's type. Last re-gate PASS,
LOW residuals only (a local writer swapping a FIFO in between the CLI's
stat and open can make it wait). Final `pnpm check:all` green on 49b812b
(2 min 51 s).