diff --git a/.claude/audits/2026-10-30-v1-2-2-mutations-reserved-ids.py b/.claude/audits/2026-10-30-v1-2-2-mutations-reserved-ids.py index b1442af9..69af2257 100644 --- a/.claude/audits/2026-10-30-v1-2-2-mutations-reserved-ids.py +++ b/.claude/audits/2026-10-30-v1-2-2-mutations-reserved-ids.py @@ -1,5 +1,5 @@ -# V1-2.2 reserved ids (owner brief 2026-10-30), mutation run (evidence -# .claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md §4): each mutant is applied to its source +# V1-2.2 reserved ids and root visibility (owner briefs 2026-10-30), mutation run (evidence +# .claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md §4 and §7; K = reserved ids, V = root visibility): each mutant is applied to its source # file, its cargo suite runs (`features` set when the suite needs them), the file is restored. Run # from the repo root. import subprocess @@ -17,6 +17,15 @@ muts=[ (' if !append_to_first_defs(root) {',' if holds_reserved_id(root) {\n return;\n }\n if !append_to_first_defs(root) {')), ('K10 halo not written','crates/core/src/anatomy/compose.rs',' add_halo_filter(&mut asset);','','pdf_session',PDF), ('K11 reason renamed','crates/core/src/anatomy/svg/tree.rs','Self::ReservedId => "reserved_id"','Self::ReservedId => "dangling_reference"','svg_reserved_ids',''), + ('V1 reader skips the root visibility check','crates/core/src/anatomy/svg/mod.rs',' sanitize::check_root_visibility(&sanitized.root)?;\n','','svg_root_visibility',''), + ('V2 cleaning skips the root visibility check','crates/core/src/anatomy/svg/clean.rs','\n .and_then(|()| check_root_visibility(&read.root))','','svg_root_visibility',''), + ('V3 exact case only','crates/core/src/anatomy/svg/sanitize.rs',' .eq_ignore_ascii_case("visible")',' .eq("visible")','svg_root_visibility',''), + ('V4 whitespace not trimmed','crates/core/src/anatomy/svg/sanitize.rs',' .trim_matches(is_css_space)\n','','svg_root_visibility',''), + ('V5 denylist of hidden only','crates/core/src/anatomy/svg/sanitize.rs',' .eq_ignore_ascii_case("visible")',' .ne("hidden")','svg_root_visibility',''), + ('V6 canvas composes a hidden root','crates/core/src/anatomy/compose.rs',' if check_root_visibility(asset).is_err() {\n return Err(ComposeError::RootVisibility);\n }\n','','svg_root_visibility',''), + ('V7 highlight composes a hidden root','crates/core/src/anatomy/compose.rs',' if check_root_visibility(&asset).is_err() {\n return Err(ComposeError::RootVisibility);\n }\n','','svg_root_visibility',''), + ('V8 PDF gate accepts a hidden root','crates/core/src/anatomy/svg/mod.rs',' sanitize::check_root_visibility(&sanitized.root)?;\n','','pdf_session',PDF), + ('V9 reason renamed','crates/core/src/anatomy/svg/tree.rs','Self::RootVisibility => "root_visibility"','Self::RootVisibility => "reserved_id"','svg_root_visibility',''), ] for name,path,old,new,suite,features,*more in muts: src=open(path).read() diff --git a/.claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md b/.claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md index c22675cc..f362564a 100644 --- a/.claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md +++ b/.claude/audits/2026-10-30-v1-2-2-reserved-ids-evidence.md @@ -62,3 +62,30 @@ id ») survived: no tested drawing has a root id, a mutant with no meaning for t inherits `hidden`: 0 highlight pixels in the PDF, markers gone in the canvas too); LOW root `stroke*` inheritance onto the point hitbox; LOW the drawing chooses which `` receives the halo (sRGB vs linearRGB, cosmetic); LOW intended behaviour change (re-export of an archive or a logo holding the id refused). + +## 7. Root visibility (brief « V1-2.2 : arbitrage définitif A6 et correction visibility », on `81f7639`) + +- Red first: error names added, no check wired: `svg_root_visibility` 2 of 6 failed (reader accepted `hidden`, + composers composed it), `pdf_session` 1 failed (export accepted it); a third failure was a fixture of mine (a literal + tab is not the stored form) and the test now checks the cleaned stored form. Green once the check is wired. +- Browser proof: RUST.md §12.10 table. Composed SVG by the core at `81f7639` (stash) and with the fix, throwaway + integration test never committed; measured with Playwright Chromium 156, Firefox 157, WebKit 27.2 from the local cache + (no install, every request outside about:/blob:/data: aborted). The accepted variants' SVG are byte-identical before + and after; the three hiding roots are refused after. +- Mutations: same script, V1 to V9 added; 20 of 20 killed (K rerun, so the reserved-id protections stay effective). +- Gates on the working tree: `pnpm check:all` green (cargo 2065 passed / 0 failed summed over the feature passes, ts-rs + types unchanged, wasm, core-wasm 65, supabase 128, app 566, lint, build, e2e:ui PASSED, app image, worker sandbox + tests and runtime image; e2e:shell not run). First run stopped on an unused import in the new suite (clippy + `-D warnings`), fixed. Fixtures: cairo, Figma, Inkscape, ImageMagick and owner-folder tests green. +- Module: 560 015 → 560 377 B gzip -9 (+362 B); Node's gzip 569 817 B (budget 600 000). +- Independent reviews of the working tree (fresh, Opus). Verifier ECARTS(3), all LOW: R3 the stroke properties no + marker sets were argued harmless without proof (docs corrected, now an open finding); R7 TODO J / J6 still waited on + Illustrator (closed by BDR-090); floor guard: assertions moved into `common/sheet_readers.rs` (clarification added to + the contract). R1, R2, R4-R6, R8, R9 met. Security PASS (semgrep 352 rules, 0 findings), no regression, `osteo-halo` + protections intact; three pre-existing MEDIUM marker-hiding vectors reported for the owner: root `viewBox` framing a + view without `view_box` (all 19 equine main-view markers out of frame, horse pixel-identical, accepted Clean); + inherited `stroke-opacity` / `stroke-dasharray` (canvas outlines gone, detail trigger 0 px in the three engines); + inherited `stroke-width` on the point hitbox (13 of 19 equine markers send their click to the last hitbox in + Chromium and WebKit). LOW: halo placement in a drawing-chosen `` (Firefox, WebKit lose the halo), root + `systemLanguage` / `display` canvas-PDF divergence (whole view), colour camouflage (inherent). Not built: the class fix + changes the R3 highlight oracle and the R4 digests (owner brief: stop before such a change). diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index bc8af967..c3311faa 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -659,3 +659,20 @@ Also kept by owner: per-document-instance prefix required on top of per-view pre **Rationale**: Figma writes `` for frame clipping. Removal re-reads mask x/y/width/height in bounding-box units: Chromium 156 cut half stroke at (10,100), 208 px diff at ×8; mask off origin could hide content (deduced, untested). With keywords allowed: stored forms pixel-identical to raw files. Enumerated keywords carry no function, no reference. **Alternatives**: keep removal, document 1 px loss (rejected: silent fidelity loss, worse off-origin); allow `maskUnits` only (rejected: same risk class for the two siblings); allow any value (rejected: free text where keyword suffices). +- **Status (2026-10-30)**: accepted, A6 scope part superseded by BDR-090 (Illustrator optional, 2026-10-30); mask/clip units part still in force + +## BDR-089 — V1-2.2 reserved PDF halo id, refused by shared reader and composers (2026-10-30) (2026-10-30) +- **Status**: accepted +**Decision** (owner, 2026-10-30, RUST.md §12.9): PDF halo id `osteo-halo` reserved. Shared reader refuses any kept element holding it, root included, ASCII case folded (`SvgRejection::ReservedId`, `reserved_id`); cleaning, verdict, preview, loaded sheet, upload tool, PDF snapshot gate answer through same reader. Both composers refuse tree holding it (`ComposeError::ReservedId`), halo always engine's (`has_halo_filter` skip removed). Exact set `refs::RESERVED_IDS`, never `osteo-*` prefix. + +**Rationale**: PDF view keeps drawing ids, engine writes `filter#osteo-halo` next to them. Defect: drawing own `filter#osteo-halo` → engine skipped its filter, transparent filter erased marker (0 highlight px Chromium 156 vs 1602); `g#osteo-halo` before first `` won resolution → halo lost (825 px). 11 historical drawings incl. DEV equine object (sha256 `0ea5202f…`) carry `osteo-overlays` → prefix reservation would refuse them. Fix: 08efd9a. + +**Alternatives**: reserve `osteo-*` (rejected: refuses historical drawings); rename engine id to unguessable (rejected: changes R3 oracle + R4 digests, still collidable); strip drawing element silently (rejected: silent change, refusal explicit); composer guard only (rejected: refusal must happen before verification/publication). + +## BDR-090 — V1-2.2 A6 final perimeter: Figma, Inkscape, cairo, ImageMagick; Illustrator + Affinity optional (2026-10-30) (2026-10-30) +- **Status**: accepted +**Decision** (owner, 2026-10-30, final; contract core E1, V1-2 contract §17.6): A6 tested perimeter = Figma (owner's two raw exports `owner/figma-web-20261030-{default,ids}.svg`), Inkscape 1.4.3, cairo 1.18.4, ImageMagick 7.1.2-18, all real exports read by suite. Adobe Illustrator + Affinity optional: never declared compatible/validated without real export; absence no longer blocks V1-2.2. `owner/` folder, procedure (Illustrator `presentation`/`internal-css`, Affinity `web`/`hq`), suite reading any file there kept for later. Replaces A6 part of BDR-088 (mask/clip units part still valid). + +**Rationale**: owner had already lifted Illustrator requirement; earlier brief wording ("Illustrator obligatoire pour revendiquer la compatibilité Illustrator") read as A6 blocker. Compatibility claim stays evidence-bound: no export, no claim. + +**Alternatives**: keep Illustrator required (rejected by owner: blocks step on tool not owned); fabricate or emulate exports (forbidden: VectorCraft not equivalent, never fake fixtures). diff --git a/.claude/memory/journal.md b/.claude/memory/journal.md index b4838bfd..488d1d06 100644 --- a/.claude/memory/journal.md +++ b/.claude/memory/journal.md @@ -490,3 +490,4 @@ R5.4: `draft/{labels,changelog,review_report,drawing,overlay,app_review,svg_comp - V1-2.2 owner decisions on 05de816: BDR-087 canonical stored SVG, LRN-099→LRN-100 strict reference grammar. Final review (Opus, Fable out of credits): verifier ECARTS(3) = A6 open, B9 LOW f1ef6a4 glued url( reader/composer mismatch fail-closed, FLOOR prose FP; security PASS (MEDIUM per-document prefix, 5 LOW). 05de816 = f1ef6a4 code. A6 not met. No fix, STOP at checkpoint. - V1-2.2 finalisation 2026-10-30: Figma default Clean, ids Cleanable (g@id), pixel-identical after maskUnits/maskContentUnits/clipPathUnits allowed (BDR-088). Glued url( removed in every attribute (urls_unglued), LRN-101. check:all green 7d9ab8c. Verifier ECARTS(2): A6 Illustrator, doc drift fixed. Security PASS, pre-existing MEDIUM PDF halo id osteo-halo for owner. Not VERIFIED. STOP. - V1-2.2 K reserved ids 2026-10-30: drawing filter#osteo-halo erased PDF marker (0 px Chromium), g#osteo-halo before defs lost halo. Reader refuses reserved_id (exact set, ASCII case), both composers fail-closed, halo always engine's. 08efd9a. check:all green, mutations 11/11, verifier ECARTS(1) LOW leaked id expansion fixed, security PASS + pre-existing MEDIUM root visibility hides markers (owner). A6 open: Illustrator. +- V1-2.2 L 2026-10-30: A6 final = Figma, Inkscape, cairo, ImageMagick; Illustrator/Affinity optional (BDR-090, BDR-088 amended). Root visibility≠visible refused (root_visibility) reader+cleaning+composers, red-first, 3 browsers, mutations 20/20, check:all green. BDR-089, LRN-102. Security PASS but 3 pre-existing MEDIUM marker-hiding vectors open (root viewBox frame, inherited stroke-opacity/dasharray, hitbox stroke-width click hijack): class fix changes R3/R4 oracles, owner decision. diff --git a/.claude/memory/learnings.md b/.claude/memory/learnings.md index 5db940af..a789a3b6 100644 --- a/.claude/memory/learnings.md +++ b/.claude/memory/learnings.md @@ -702,3 +702,10 @@ Supersedes [[LRN-099]]. **Future application**: new SVG/CSS consumer reuses `url_openings`/`local_url_target`, never own parser. Hostile tests written apart from reader, assert browser behaviour. Supersedes [[LRN-100]]. + +## LRN-102 — Unquoted heredocs expand backticks: quote the delimiter, scan before commit (2026-10-30) (2026-10-30) +**Pattern**: unquoted heredoc (`<` wins resolution; historical drawings carry `osteo-overlays` (DEV equine object included) → exact reserved set, never an `osteo-*` namespace; canvas scoped `fv..`, layer writes no id, filter `result` names local to the filter - [x] K2 reader: `SvgRejection::ReservedId` (`reserved_id`), `refs::check_reserved_ids` (ASCII case folded, the id grammar is ASCII) in `read_svg` and in `clean_svg` after the active classification; reaches verdict, preview, loaded sheet, upload tool, PDF snapshot gate - [x] K3 composer fail-closed: `compose_highlight` refuses a tree holding a reserved id (`ComposeError::ReservedId`), always writes its own halo (`has_halo_filter` removed); ops mapping; TS-era "never duplicated" test becomes the refusal - [x] K4 tests: valid, filter + other elements (root included), references, adversarial spellings (case, entities, whitespace, `xml:id`, prefixed names, look-alikes), composition, PDF session (refusal + internal halo kept), equine + sha256, declared divergence for `osteo-halo-id.svg`, pixel proof in Chromium (before / after) - - [ ] K5 docs (RUST.md §12, contract §9.x hard rejections, ANNOTATION-RENDERING), Illustrator `presentation` / `internal-css` owner steps; gates (cargo, svg, mutations, wasm size, check:all DEV-isolated), fresh verifier + security on final HEAD; memory; commit + push; STOP (A6 open until Illustrator). State: check:all green, verifier ECARTS(1) LOW fixed (leaked `id` expansion in a comment), security PASS + pre-existing MEDIUM root `visibility` hides every marker (owner decision), LOW root stroke, LOW halo defs placement + - [x] K5 docs (RUST.md §12, contract §9.x hard rejections, ANNOTATION-RENDERING), Illustrator `presentation` / `internal-css` owner steps; gates (cargo, svg, mutations, wasm size, check:all DEV-isolated), fresh verifier + security on final HEAD; memory; commit + push; STOP (A6 open until Illustrator). State: check:all green, verifier ECARTS(1) LOW fixed (leaked `id` expansion in a comment), security PASS + pre-existing MEDIUM root `visibility` hides every marker (owner decision), LOW root stroke, LOW halo defs placement + - [ ] L A6 final scope and root visibility (brief « V1-2.2 : arbitrage définitif A6 et correction visibility », 2026-10-30, on 81f7639): fixtures and isolated stacks only, DEV untouched; no merge; STOP at checkpoint (VERIFIED or CHANGES REQUIRED), no V1-2.3 + - [x] L1 A6 scope: Figma, Inkscape, cairo, ImageMagick = tested perimeter; Illustrator and Affinity optional, never claimed without a real export; core contract D1/B6/C1, V1-2 contract §17, RUST.md, export READMEs, TODO, BDR superseding BDR-088's A6 part; fixtures and owner procedure kept + - [x] L2 tests first (red on 81f7639): root `visibility` hides the layer (canvas, PDF), descendant `visible`, value spellings, root `style` / `