fix(anatomy): V1-2.2 marker layer and halo outside the drawing's group

Owner-approved lot B (brief 2026-11-01). The composition root is the
engine's (namespaces and frame); the drawing's root becomes a group and
the marker layer and halo are its siblings, so no root property reaches
a marker. Point hitboxes declare stroke none and visibleFill. Census over
the reader's whole allowlist; R3 references compared under the declared
transform; click proofs in three engines.
This commit is contained in:
bchanot committed 2026-11-01 00:39:57 +01:00
1 parent f1bb19b30b
commit 4f52f5e1c4
23 files changed
+933 -112

No files matched your search

+13 -12
View File
@@ -23,7 +23,7 @@ trigger.
| Annotation | Elements |
|---|---|
| `detail_trigger`, any geometry | one dashed shape: fill and stroke = the colour, `fill-opacity` 0.06, `stroke-width` 2, `stroke-dasharray` `8,4`, `pointer-events` all, `style` `cursor:pointer`, class `detail-zone` |
| `point` or `zone` with a circle | a transparent hitbox (the geometry's `r`, `fill` transparent, `pointer-events` all, `style` `cursor:pointer`) then a visible twin on top (radius `max(2, r − 12)`, the colour, `fill-opacity` 0.65 on the main view / 0.5 on a detail view, stroke `#000` 1.5, `pointer-events` none) |
| `point` or `zone` with a circle | a transparent hitbox (the geometry's `r`, `fill` transparent, `stroke` none, `pointer-events` visibleFill, `style` `cursor:pointer`; the R3 form kept for the seed review drawings has no `stroke` and `pointer-events` all) then a visible twin on top (radius `max(2, r − 12)`, the colour, `fill-opacity` 0.65 on the main view / 0.5 on a detail view, stroke `#000` 1.5, `pointer-events` none) |
| `point` or `zone` with a polygon or a path | one filled shape: fill and stroke = the colour, `fill-opacity` 0.3, `stroke-width` 2, `pointer-events` all, `style` `cursor:pointer` |
Annotations without geometry draw nothing. Annotations follow the document
@@ -111,22 +111,23 @@ a pointer cursor and brightens on hover.
The engine composes the observation's zones of one view: the markers of the
other annotations are dropped (not hidden), every `data-*` attribute is
removed, the kept elements get fill `#b85a3f` at 0.85 and, on the main view,
the `osteo-halo` filter (two Gaussian blurs merged with the source), added to
the first `<defs>` of the drawing or to a new `<defs>` placed first. The PDF
the `osteo-halo` filter (two Gaussian blurs merged with the source), in a
`<defs>` of the engine placed after the drawing's group, before the layer. The PDF
view keeps the drawing's ids, so `osteo-halo` is reserved (V1-2.2, owner brief
2026-10-30): the reader refuses a drawing holding it in any letter case
(`reserved_id`) and both composers refuse such a tree, so the halo the markers
name is always the engine's.
Both forms append the layer as the root's last child, so it inherits the
root's `visibility`. A root `visibility` other than `visible` is refused by
the reader (`root_visibility`) and by both composers: a drawing could
otherwise hide every marker while its own children set `visible` back. The
root's `class`, `style`, `transform`, `filter`, `mask` and `clip-path` are
removed by the reader; `opacity` and `display` on the root act on the drawing
and the markers alike. Still open (RUST.md §12.10): `stroke-opacity`,
`stroke-dasharray` and `stroke-width` on the root reach the markers, which do
not set them (the frame of a view: see Views, RUST.md §12.11).
The composition root is the engine's (V1-2.2, owner brief 2026-10-30, RUST.md
§12.12): `xmlns`, `xmlns:xlink` and the frame only. The drawing's root becomes
a `<g>` holding its other attributes and its children; the layer (and the
halo's `<defs>`) are that group's siblings, so no property the drawing sets,
inherited (`stroke-*`, `fill*`, `visibility`…) or acting on a whole group
(`opacity`, `display`), reaches a marker: a root `opacity="0"` or
`display="none"` hides the drawing alone. A root `visibility` other than
`visible` stays refused by the reader (`root_visibility`) and by both
composers. The R3 trees stay frozen; the tests apply this declared change
(`withIsolatedLayer`, `withDeclaredHitboxes`, `with_isolated_layer`).
## Checking the look
+9 -2
View File
@@ -1,7 +1,9 @@
# Browser tests (Playwright and axe)
Status: V1-1.3, 2026-10-25 (decision D14, `V1-1_OWNERS_ANIMALS.md` §12.5).
Chromium only until V1-5. The suites live in `apps/app/e2e`.
Chromium only until V1-5, except the canvas click proof (V1-2.2), which also
runs on Firefox and WebKit, desktop and the WebKit phone, when the pinned
engines are installed. The suites live in `apps/app/e2e`.
## 1. Suites
@@ -110,7 +112,12 @@ suite needs Docker in the runner for the sandbox.
## 6. Limits
- Chromium only. Firefox, WebKit and the 412 × 915 viewport join at V1-5
- Chromium only, but `e2e/ui/canvas-clicks.spec.ts` (V1-2.2: projects
`firefox-desktop`, `webkit-desktop`, `webkit-375`, added when
`playwright install firefox webkit` has put the pinned engines in the cache;
a missing one is named in the run's output and its projects do not run;
harness `e2e/harness/canvas.{html,tsx}`, dev server only). Firefox, WebKit
and the 412 × 915 viewport join every suite at V1-5
(contract §12.5). WebKit's system libraries may need `sudo` (owner action).
Desktop WebKit is not iOS Safari: the owner's manual check on a real iPhone
and on a computer over the LAN stays a validation criterion of every mobile
+69 -1
View File
@@ -4134,7 +4134,9 @@ Chromium and WebKit 13 of the 19 equine markers send their click to the last hit
(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
`stroke="none"`; it changes the R3 highlight oracle and the R4 digests (corrected in §12.12, 2026-11-01: the R4 PDF
digests do not change; the R3 highlight oracle and canvas goldens compare under a declared transform, and only the R4.1
real-raster manifest's call-1 `svgSha256` is edited). (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
@@ -4198,3 +4200,69 @@ Oracles: none changed by this rule; the R3 canvas and highlight trees, the R4 di
frozen (no committed drawing carries a `preserveAspectRatio` or a `viewBox` in another spelling).
Module: 560 377 → 572 993 B gzip -9 (+12 616 B, the curve and arc measure), 1 515 246 → 1 544 834 B raw; Node's gzip
582 919 B (budget 600 000).
### 12.12 Marker isolation and the hitbox capture (owner, 2026-10-30, defects 1 and 2)
Brief « V1-2.2 : arbitrages propriétaire sur les trois MEDIUM », points 1 and 2 (open items (1) and (2) of §12.10). A
structural fix in the composition, common to both forms, not a list of refused attributes.
| Point | Built | Where |
|---|---|---|
| Composition root | the engine's own `<svg>`: `xmlns`, `xmlns:xlink`, the frame (§12.11). The drawing's root becomes a `<g>` holding its other attributes (`viewBox`, `preserveAspectRatio`, `version`, `width`, `height`, `x`, `y` dropped) and its children; the marker layer, and in the PDF view an engine `<defs>` holding the halo filter, are that group's siblings | `anatomy/compose.rs` (`isolated`) |
| Layer | the composers draw `render_composed_layer`: the R3 tree with each point hitbox declaring `stroke="none"` and `pointer-events="visibleFill"` (its clickable area is its circle: under `all` a stroke widens the hit area even unpainted); the zones and the trigger already declare their stroke width; the R3 `render_layer` stays for the seed review drawings, unchanged | `anatomy/layer.rs` |
| Kept | the reader rules of §12.9 and §12.10 (`reserved_id`, `root_visibility`) and both composers' fail-closed checks | |
What reached a marker before, and why the structure ends it: inherited properties (`stroke`, `stroke-width`,
`stroke-opacity`, `stroke-dasharray`, `stroke-dashoffset`, `stroke-linecap`, `stroke-linejoin`, `stroke-miterlimit`,
`fill`, `fill-opacity`, `fill-rule`, `visibility`, `color`, `clip-rule`, `color-interpolation-filters`, the font
properties) pass from an ancestor to a child, which a child's own attribute overrides only for the properties it sets;
`opacity`, `display` and the conditional `systemLanguage` act on the element and its whole subtree, which no child can
undo. The reader already removes the root's `class`, `style`, `transform`, `filter`, `mask` and `clip-path`, refuses a
root `visibility` other than `visible`, keeps no `pointer-events` or `cursor` attribute and no `<style>` (a descendant's
`style` may still set them, or any CSS property without a function call: it acts on the drawing only). With the layer a
sibling of the drawing, its only ancestor is the engine's root (and, in the canvas, the page, whose stylesheet is the
application's). Consequence for drawings: a root `opacity="0"` or `display="none"` now hides the drawing alone, in every
engine and both forms (before: the whole view, or nothing, depending on the engine and the form).
Proofs: `svg_marker_isolation` (5, all red on `958228a`): 22 root properties one by one and all at once never on the
layer's ancestors, the drawing keeping them on its group, in both forms; the equine drawing; the halo outside the
drawing; every interactive surface declaring its stroke and capture. Browser pixels (Chromium 156, Firefox 157,
WebKit 27.2; PDF raster as `browserRasterizer`, canvas inline): the equine views identical before and after (0 px), the
markers under nine hostile roots identical to the plain markers (0 px) where `958228a` drew them altered (4 700 to
196 000 px) or not at all (`opacity`, `display`). Real PDF exports (demo, v2full, v2unresolved, Chromium rasters): byte-
identical to `958228a`. Clicks (`e2e/ui/canvas-clicks.spec.ts`): 67 pass on Chromium desktop and phone, Firefox, WebKit
desktop and phone; on `958228a` 45 fail. Mutations I1 to I7 killed, K1, K7, K8, K10, V1, V6, V7 rerun killed.
Census and browser probe (owner brief 2026-11-01, « Lot B : approuvé »): `svg_marker_isolation::
nothing_the_reader_keeps_changes_the_layer_or_the_halo` sets each of the reader's 77 allowed attributes (`sanitize::
ALLOWED_ATTRIBUTES`, structural ones aside) on the root and on a descendant group, and 17 descendant `style` values,
including CSS that acts outside its subtree in an HTML page (`z-index` with `position`, `position:fixed`, `mix-blend-mode`
with `isolation`, `view-transition-name`, a 4 000 px `outline`, `contain`, `translate` in depth, anchor positioning,
`pointer-events`); the layer and the halo serialise byte for byte as with a plain drawing, the root carries only
namespaces and the frame. In the browser (Chromium 156, Firefox 157, WebKit 27.2, canvas inline and PDF raster), an opaque
magenta rectangle covering the whole frame, last child of the equine drawing, carrying 21 candidate styles (15 kept by the reader; 6 with a function call,
`transform:translateZ(…)`, `scale(…)`, `filter:drop-shadow(…)`, `backdrop-filter`, `clip-path:inset(…)`, `mask-image`,
removed by it): the magenta pixel
count equals the unstyled rectangle's inside the frame (the huge stroke and the outline only cover the anti-aliased edge
rows) and the 13 points keep their click; the positive control (the same rectangle placed after the layer) covers every
pixel and takes 0 of 13 clicks. Tools: `.claude/audits/2026-11-01-v1-2-2-decisions-tools/`.
References (owner brief 2026-11-01, « Références historiques : modification contrôlée autorisée »). The frozen files are
not edited; the tests apply the declared transform to their frozen side and compare strictly:
| Reference | Transform | Where |
|---|---|---|
| R3 highlight oracle `crates/core/tests/oracles/r3/highlight.json` (36 cases) | `with_isolated_layer`: the root keeps `xmlns`, `xmlns:xlink`, `viewBox`; its other attributes and every child before the layer go into a `<g>`; `filter#osteo-halo` leaves the drawing for an engine `<defs>` placed before the layer; each point hitbox (circle, `pointer-events="all"`, no `stroke`) gets `stroke="none"` and `pointer-events="visibleFill"` | `tests/common/svg_tree.rs`, `anatomy_compose.rs`, `anatomy_canvas_op.rs` |
| R3 canvas goldens `apps/app/tests/fixtures/goldens/r3/canvas.{main,head}.json` | `withIsolatedLayer`, the same rules on the mounted canvas tree | `tests/helpers/svgTree.ts`, `canvas.trees.test.tsx` |
| R3 layer goldens `canvas.{main,head}.layers.json` | `withDeclaredHitboxes`: the hitbox rule alone | same |
| R4.1 real-raster manifest `apps/app/tests/fixtures/pdf/r3/real/manifest.json`, call 1 `svgSha256` | edited, the one byte digest no transform can map: `a9a3155c…2c11` → `45fd4aaf…fc7f`; call 2 unchanged; `pdf-export.session.test.ts` green on all calls | the manifest (original in Git history, `87b8873`) |
Unchanged and still compared as frozen: R3 `layer.json` and `sanitiser.json`, the R4 PDF digests, the step6 goldens, the
N-1 copies, the seed review drawings (R3 layer kept for them), the equine drawing (sha256 `0ea5202f…`) and its fingerprint.
The equine renders identically before and after (0 px, three engines, canvas and PDF), and the real PDF exports are
byte-identical to `958228a`. Correction to §12.10: the class fix does not change the R4 digests; only the R4.1 call-1
`svgSha256` changes.
Open, pre-existing, owner decision: the vertebral junction points sit on the edge of zones painted and hit after them;
measured in all three engines on the plain equine sheet, 28 to 49 % of `c7-t1`, `l6-s1` and `t18-l1`'s visible disc
records the zone, 8 % of the fore fetlock's records the fore sesamoids (`fixme` in the click spec).