docs(docs): V1-2.2 final A6 perimeter, root visibility, open findings

This commit is contained in:
bchanot committed 2026-10-30 18:56:48 +01:00
1 parent d8562f60f5
commit a095ea0e1b
3 files changed
+92 -8

No files matched your search

+60 -2
View File
@@ -3972,8 +3972,9 @@ with a PI shown `rejected` by the preview as the verdict refuses it.
- The module's margin under its budget is about 30.8 KB by the test's measure since §12.8 (31.3 KB at §12.7) (3.3 KB before): the V1-2.5 and V1-2.6 pages must not grow the
core's browser surface without measuring.
- cairo colours: closed at the checkpoint (§12.7), strict numeric `rgb()` / `rgba()` kept.
- Editor exports: Inkscape 1.4.3 covered at the checkpoint (§12.7), Figma at the finalisation (§12.8); the real Adobe
Illustrator pending from the owner, its output untested until then (A6 open); Affinity optional. Figma's text
- Editor exports: Inkscape 1.4.3 covered at the checkpoint (§12.7), Figma at the finalisation (§12.8); A6's final
perimeter (owner, 2026-10-30, §12.10) is Figma, Inkscape, cairo and ImageMagick; Adobe Illustrator and Affinity are
optional and untested, never claimed without a real export. Figma's text
handling is untested: neither owner file carries the source's live text.
- A verdict whose document does not read strictly carries no group and no drawing: M6's structure check
(`complete_sheet_verification`) must accept a failed verdict without them, or the round would wait for its attempt limit.
@@ -4104,3 +4105,60 @@ drawing and every committed SVG); `pdf_session` (`the_pdf_refuses_a_reserved_id_
snapshots refused at the gate, the demo export's halo is the engine's filter byte for byte and every marker names it);
`packages/core-wasm/tests/preview.test.ts` (three spellings on the shipped module). Mutations
(`.claude/audits/2026-10-30-v1-2-2-mutations-reserved-ids.py`): 11 killed of 11.
### 12.10 Root visibility and the final A6 perimeter (owner, 2026-10-30)
Brief « V1-2.2 : arbitrage définitif A6 et correction visibility » on `81f7639`, after the MEDIUM of the security review
of §12.9: both composers append the marker layer as the root's last child (the PDF view keeps the drawing's root, the
canvas copies its attributes), so the layer inherits the root's `visibility`, which no marker sets. A drawing
`<svg visibility="hidden">` whose children set `visible` back read clean (no removal) and drew without a marker.
| Point | Built | Where |
|---|---|---|
| Reader | `SvgRejection::RootVisibility` (`root_visibility`): `sanitize::check_root_visibility` accepts no `visibility` on the root or `visible` (CSS whitespace and letter case aside); `hidden`, `collapse`, CSS-wide keywords and any other value are refused. In `read_svg` after the reserved ids, so the verdict (`svg_rejected`), the preview (`rejected`), the loaded sheet, the upload tool and the PDF snapshot gate (`asset root_visibility`) answer it; `clean_svg` after active content, the targets and the reserved ids | `anatomy/svg/{sanitize,mod,clean,tree}.rs` |
| Composers | `compose_canvas` and `compose_highlight` refuse such a root (`ComposeError::RootVisibility`, `svg_rejected` / `root_visibility` in `view.canvas`) | `anatomy/compose.rs`, `ops.rs` |
| A6 | final perimeter Figma, Inkscape, cairo, ImageMagick; Illustrator and Affinity optional, never claimed without a real export; `owner/` and its procedure kept | contract core E1, V1-2 contract §17.6, export READMEs |
Why the root attribute only: the root's `class`, `style`, `transform`, `filter`, `mask` and `clip-path` were already
removed by the reader (so `style="visibility:hidden"` on the root is a removal and the cleaned drawing shows its
markers), `<style>` elements are removed, and a descendant's `visibility` stays in the drawing, never on the layer's
ancestors. Root `opacity` and `display` act on the drawing and the markers alike; `fill`, `fill-opacity` and the
stroke colour are set on every marker, so the root's never reach them.
Open after the independent security review of this step (pre-existing, owner decision, not built): the same
inheritance through properties no marker sets, and the view's frame. (1) Root `stroke-opacity="0"` (or
`stroke-dasharray="0.001 100000"`) with the drawing's groups setting it back removes every marker outline in the canvas;
the detail trigger, filled at 0.06, then shows 0 pixels in Chromium, Firefox and WebKit; the PDF highlight keeps its
0.85 fill. (2) Root `stroke-width="100000"` reaches the point hitboxes (`pointer-events="all"`, no stroke set): in
Chromium and WebKit 13 of the 19 equine markers send their click to the last hitbox. (3) A view without `view_box`
(the equine main view) is framed by the drawing's root `viewBox`: shifting it and translating the drawing back leaves
the horse pixel-identical and every marker outside the frame. The class fix for (1) and (2) is the engine's: the layer
`<g>` resets the inherited properties (`visibility`, `stroke-opacity`, `stroke-dasharray`, …) and the hitbox gets
`stroke="none"`; it changes the R3 highlight oracle and the R4 digests. (3) needs a document rule (annotations inside
their view's frame, in the verdict and the preview) or the document owning the main view's frame.
Browser proof (equine main view, `hip` selected, halo on; pixels that differ from the same SVG without its layer, so 0
means no marker shows; composed by the core at `81f7639`, then by the fix):
| Root | Chromium 156 PDF / canvas | Firefox 157 PDF / canvas | WebKit 27.2 PDF / canvas | Fix |
|---|---|---|---|---|
| none (equine) | 3 920 / 43 685 | 3 918 / 43 779 | 3 930 / 43 687 | unchanged, SVG byte-identical |
| `visibility="hidden"`, children `visible` | **0 / 0**, drawing drawn | **0 / 0**, drawing drawn | 0 / 0, nothing drawn | `root_visibility` |
| `visibility="collapse"`, children `visible` | 0 / 0, drawing drawn | 0 / 0, drawing drawn | 0 / 0, nothing drawn | `root_visibility` |
| `style="visibility:hidden"` | removed by the reader: 3 920 / 43 685 | 3 918 / 43 779 | 3 930 / 43 687 | unchanged (cleanable) |
| `opacity="0"` | 0 / 0, nothing drawn | 0 / 0, nothing drawn | 0 / 0, nothing drawn | kept: whole view |
| `display="none"` | 3 920 / 0 (nothing drawn) | 0 / 0 (nothing drawn) | 3 930 / 0 (nothing drawn) | kept: whole view |
| `stroke`, `stroke-width="40"` | 5 052 / 64 175 | 5 065 / 64 332 | 5 055 / 64 351 | kept: markers drawn |
No frozen oracle, R3/R4 digest, step6 golden, N-1 copy, historical drawing or equine fingerprint changed: no committed
SVG carries a root `visibility`, `opacity`, `display` or `stroke`.
Tests: `svg_root_visibility` (6: visible and absent roots read, clean, verified, previewed and composed with the layer
showing; 16 values × 4 bodies refused by the reader, the cleaning, the preview, the canvas and the verdict; both
composers fail-closed; root `style` / `class` and `<style>` forms removed, their stored forms fixpoints, descendants
harmless; other root properties removed or whole-view; the equine drawing); `pdf_session`
(`the_pdf_refuses_a_drawing_whose_root_hides_the_markers`); core-wasm `preview.test.ts` (three values on the shipped
module). The reader suites share `tests/common/sheet_readers.rs`. Red first: with the error names added and no check
wired, the reader, composer and PDF tests failed (3 of 14), then passed with the check. Mutations: V1 to V9 killed, and
K1 to K11 of §12.9 rerun, all killed (20 of 20).
Module: 560 015 → 560 377 B gzip -9 (+362 B), 1 513 968 → 1 515 246 B raw; Node's gzip 569 817 B (budget 600 000).