docs(docs): V1-2.2 reserved ids in RUST.md 12.9, contract, Illustrator steps

This commit is contained in:
bchanot committed 2026-10-30 17:31:00 +01:00
1 parent 08efd9a792
commit 6ed4d21eb3
4 files changed
+87 -16

No files matched your search

+35
View File
@@ -4069,3 +4069,38 @@ five non-strict or escaped spellings refused, an absent target refused, six valu
which reaches the fail-closed branch on a tree built outside the reader). Mutations: dropping `urls_unglued`, the
keyword check or the `maskUnits` entry each fails the new tests. No frozen oracle, N-1 copy, protected reader or equine
file changed.
### 12.9 Reserved ids (owner, 2026-10-30)
Brief « V1-2.2 : correction de sécurité PDF et poursuite A6 » on `2f1f076`, after the MEDIUM of the final security
review: the PDF view keeps the drawing's ids and `compose_highlight` writes its halo filter `osteo-halo` next to them.
A drawing defining `filter#osteo-halo` replaced the engine's filter (the composer skipped its own when one existed: a
filter of transparent pixels erased the marker, 0 highlight pixels in Chromium 156 against 1602 for the plain drawing);
a non-filter element holding the id before the first `<defs>` won its resolution (the halo was lost, 825 pixels).
| Point | Built | Where |
|---|---|---|
| Reserved set | `refs::RESERVED_IDS` = [`HALO_FILTER_ID`] (`osteo-halo`), compared without ASCII case (the reader keeps ASCII ids only, `is_reference_name`); exact names, never a prefix: the historical drawings, the DEV equine object included, carry `osteo-overlays` | `anatomy/svg/refs.rs` |
| Reader | `SvgRejection::ReservedId` (`reserved_id`): `refs::check_reserved_ids` in `read_svg` after the targets, so the verdict (`svg_rejected`), the preview (`rejected`), the loaded sheet, the upload tool and the PDF snapshot gate (`snapshot_invalid`, `asset reserved_id`) answer it; `clean_svg` checks it after active content and the targets | `anatomy/svg/{refs,mod,clean,tree}.rs` |
| Composers | `compose_highlight` and `compose_canvas` refuse a tree holding a reserved id (`ComposeError::ReservedId`, `svg_rejected` / `reserved_id` in `view.canvas`); the highlight always writes its own filter (`has_halo_filter` removed) | `anatomy/compose.rs`, `ops.rs` |
Audit of the other ids the composition writes: none. The canvas scopes every drawing id (`fv.<view>.`) and no page id
starts with `fv.`; the annotation layer writes no `id` (its `data-*` cannot be forged: the reader removes `data-*`); the
filter's `result` names (`haloWide`, `haloTight`) resolve inside their own filter only. Spellings: character references
are decoded by the XML parser and refused; spaces, look-alikes outside ASCII, invisible characters, `xml:id`, prefixed
attributes or SVG elements are removed by the existing rules, so no tree reaching a composer holds the id; a CSS escape
or a percent-encoded `url(` target is active content.
Declared changes: `oracles/r3/sanitiser.json` `osteo-halo-id.svg` → `reserved_id` (the test applies it, the file stays
frozen); `svg_clean` corpus line `osteo-halo-id.svg` rejected; the R5.7 test "never duplicates the filter" now checks one
filter per composition and the refusal of a composed root given back. The R3 highlight oracle, the R4 digests, the equine
sha256 `0ea5202f…` and every committed drawing but that fixture are unchanged (`the_historical_drawings_read_as_before`
reads all of them). Module: 559 360 → 560 015 B gzip -9 (+655 B).
Tests: `svg_reserved_ids` (9: the set, a valid drawing with the engine's halo once, a filter of its own, the id on 23
element forms and the root, 11 reference spellings dangling alone and refused with the id defined, adversarial spellings,
512 letter cases + 30 character references refused and 90 look-alikes removed, both composers fail-closed, the equine
drawing and every committed SVG); `pdf_session` (`the_pdf_refuses_a_reserved_id_and_keeps_its_own_halo`: three hostile
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.