fix(anatomy): V1-2.2 review LOWs, owner export procedure, evidence

Composer check counts url( openings apart from the reader; tab and
newline character references tested; RUST.md sizes and counts of the
final build; owner procedure for Illustrator, Figma and Affinity.
This commit is contained in:
bchanot committed 2026-10-29 17:15:02 +01:00
1 parent a678faaa23
commit f1ef6a466f
9 files changed
+300 -55

No files matched your search

@@ -191,3 +191,193 @@ quoted CSS string (URL Standard: tab and newline are removed from the input).
status` there shows only this file and the owner's `exports/owner/README.md`. status` there shows only this file and the owner's `exports/owner/README.md`.
- The verdict runs in the core, client or worker side; the SQL side cannot check the stored - The verdict runs in the core, client or worker side; the SQL side cannot check the stored
form. That trust boundary is outside this diff. form. That trust boundary is outside this diff.
## 5. Delta review (5281337..HEAD, commit a678faa)
Fresh scan of the delta, mode audit, 2026-10-29. The report above was read first, as the brief
required; nothing else from the earlier round was used.
```
SECURITY — VERDICT: PASS
TOOL: semgrep 1.168.0 present but NOT RUN (p/security-audit, p/secrets, p/owasp-top-ten are registry packs fetched at run time and the brief forbids network) — effectively DEGRADED: checklist + guardrails scanner + manual attack review + the two named cargo suites + a model fuzz (section 5.7)
SCOPE: 13 files (5 Rust: compose.rs, sanitize.rs, ops.rs, svg_clean.rs, svg_scope.rs; 8 docs, fixtures and audit files)
BLOCKING:
(none)
REPORTED (non-blocking):
- [MEDIUM] scope-key-is-view-id-only (carried from 5281337; now a written requirement, still not enforced by code or test) — crates/core/src/anatomy/compose.rs:99 — two documents inlined in one page share `fv.main.`, first in tree order wins; recorded in contract §10 and RUST.md §12.7; no screen inlines two documents today (consumers: apps/app/src/core/sheetOps.ts, services/sheetIndex.ts, anatomy/drawing.ts)
- [LOW] composer-check-shares-the-reader-parser — crates/core/src/anatomy/compose.rs:105 — `references_scoped` calls `urls_are_local` and `url_targets`, the same `url_openings` / `local_url_target` as the sanitiser: it catches a `scope_ids` miss, it cannot see a future reader/browser divergence in those two functions; none today (5.7)
- [LOW] tests-deliver-a-space-not-a-tab — crates/core/tests/svg_clean.rs:356, :357, :381; crates/core/tests/svg_scope.rs:338 — a raw TAB or LF inside an XML attribute is normalised to a space by the XML parser (roxmltree parse.rs:1364), so Chromium's `	` spelling of the first HIGH reaches `local_url_target` in no test; hint: rows written `	` and `
`, or a value-level unit test next to sanitize.rs:710
- [LOW] ts-oracle-plain-spelling-only (carried) — apps/app/tests/helpers/svgTree.ts:112 — still `replaceAll('url(#'`; it mirrors the core's rewrite for the product drawing, and the sanitiser now refuses every other spelling, so the blind spot has no reachable input
- [LOW] mutation-script-rewrites-sources (carried) — .claude/audits/2026-10-29-v1-2-2-mutations-arbitrations.py — five mutants added (A13 to A17); it still edits sources in place and restores in `finally`; not run here, so their kill results are not verified by this gate
PROOF: semgrep 0 rules on 0 files (not run, no network) → 0 findings; checklist 9 checks (secrets, SQL concatenation, unsanitised render, authz, error surfaces, logging, tracked .env, guardrails scanner, new suppressions) → 0 findings in the delta; cargo test svg_clean + svg_scope 21 passed, lib anatomy::svg 24 passed; model fuzz 8.4M strings in fill and style contexts + 2,400-case slot sweep + control run → 0 dangerous mismatches; manual attack review of 5 code files → 0 HIGH, 1 MEDIUM, 4 LOW
```
REPORT_WRITTEN: .claude/audits/2026-10-29-v1-2-2-arbitrations-security.md
### 5.1 Status of the previous findings
| Previous finding | Now |
|---|---|
| HIGH url-reference-spelling-mismatch | Closed. One reading of `url(` (`local_url_target`, sanitize.rs:487) feeds `urls_are_local`, `url_targets`, `scope_url_targets` and `calls_only_local_url`, so the set the sanitiser admits, the set the dangling check and the budget count, and the set the composer rewrites are the same by construction. Fix directions 1, 2, 3 and 4 of section 1 are all done. |
| MEDIUM scope key | Recorded as a requirement (contract §10, RUST.md §12.7). Open as a rule, see the reported list. |
| LOW colour function not whole value | Closed: `colour_function_end` now requires end of text, CSS space, `;`, `,` or `!` after the `)`. `rgb(1,2,3)rgb(4,5,6)` is removed, `url(#a rgb(1,2,3))` is refused at the `url(`. |
| LOW test oracle shares the blind spot | Closed in the core: `browser_references` (svg_scope.rs) reads `href="…"` and every `url(…)` on its own, trims quotes and CSS space, strips tab and newline, percent-decodes. The TS helper is carried, see above. |
| LOW lint allow | Nothing new: no added `allow`, `nosemgrep`, `nosec`, `eslint-disable` or `ts-ignore` line in the delta (grep on the added lines). |
| LOW mutation script | Carried. |
### 5.2 What the delta reads like
`local_url_target` accepts only: CSS space, an optional quote, `#`, a run of `[A-Za-z0-9_.:-]`
that satisfies `is_reference_name` (first character `[A-Za-z_]`), the same quote, CSS space,
`)`. `url_openings` skips a `url(` glued to a longer name (`continues_identifier`: ASCII
alphanumeric, `_`, `-`, `\`, anything above U+007F). Every `urls_are_local` false is an active
removal, so the file is refused, never cleaned. After a strict `url(...)` is cut out and the
strict colour functions are removed, `calls_only_local_url` keeps a value only if no `(` is
left. In the composer, `references_scoped` runs after `scope_ids` and before the layer is
added, and `ops.rs:480` maps its failure to `svg_rejected` / `unscoped_reference`.
### 5.3 Re-attack, item by item
Everything below was thrown at the strict reader and compared with a browser model (5.7).
- Percent escapes, quoted and unquoted: `url(#%61)`, `url('#%61')`, `url(#a%61)`, `url(#a.%2e)`,
`%23`, `%00`, `%20`. The id run stops at `%`, which is not followed by a quote, a space or
`)`, so the value is not local and the file is refused. Same for `href="#%61"` and
`xlink:href` (strict `#` + name).
- Every C0 control and Unicode space, inside and around the quotes: an exhaustive sweep of
8 positions (before `url(`, after `url(`, after the quote, between `#` and the id, inside the
id, at the id end, after the closing quote, before `)`) x 3 quote modes x 100 characters
(U+0001 to U+0020, U+007F, U+0080 to U+00A0, U+1680, U+180E, U+2000 to U+200F, U+2028,
U+2029, U+202F, U+205F, U+3000, U+FEFF, U+FFFD, `/**/`, `/*x*/`, `%`-forms, fullwidth `#`
and `'`) = 2,400 values. 163 are accepted; every one has only CSS space (space, tab, LF,
CR, FF) at the four legal slots, or a character before `url(` that is not part of the
reference; 0 differ from the browser model. A NBSP or U+3000 after the quote or before the
closing quote is refused, which is the Chromium/Firefox divergence of the first round.
Controls other than tab, LF and CR cannot be carried by XML 1.0 at all.
- CSS comments inside `url(`: `url(/**/#a)` is, in a browser, an unquoted URL whose text is
`/**/#a` (a relative fetch); the reader refuses it (`/` is neither a quote nor `#`). `url(#a/**/)`,
`url('#a'/**/)`, `url(/**/'#a')` are refused. `/**/url(#%61)` has a non-name character in
front and is read as an opening, then refused on the `%`.
- Escapes: a backslash still refuses the value for every attribute, before anything else runs
(`value_acceptable`, `value_is_active`); unchanged.
- `URL(`, `Url(`: ASCII-lowercase scan with identical byte offsets; no non-ASCII character
folds to `url`.
- Nested or repeated: `url(url(#a))`, `url(#a)url(#a)`, `url(#a) url(x)`: every opening must
be strict. The 25,000-reference `%61` flood is refused as active content
(`svg_clean.rs:346` test); the plain flood is `too_complex` as before.
- `url(` inside a colour: `rgb(1,url(#a),3)` and `url(#a rgb(1,2,3))` leave a `(` or fail the
strict window and are refused.
- `)` inside quotes: `url(')')`, `url('#a)')` are refused (id then wrong closer).
- `xlink:href` against `href`: both need `#` + a reference name after an ASCII trim (space, tab,
LF, CR, FF); NBSP does not trim; `#a\tb`, `#a%61`, `# a` are refused. The composer demands
`#fv.<view>.` on both. A prefixed `x:href` is not on the allowlist; `xlink:href` must sit in
the xlink namespace.
- Ids with `.` or `:`: `url(#a.b:c-d_e)` is accepted, scoped as `fv.main.a.b:c-d_e`, and a browser
reads the same string. `svgView(` and `xpointer(` need `(`, which the id grammar excludes.
`url(#-a)`, `url(#1a)`, `url(#é)` are refused.
- Glued names with non-ASCII letters: `érgb(1,2,3)`, `éurl(#%61)`, ` url(`. A browser reads
every code point above U+007F as part of the name, so these are single longer function names;
the reader agrees and leaves the `(` in place, which refuses the value on a presentation
attribute. A digit in front (`1url(`) is a dimension plus a block in a browser, never a fetch;
the reader treats it as glued as well. A non-name character in front (`%`, `+`, `,`, `"`, `#`,
`@`) keeps the `url(` an opening, so it must be strict.
- A `(` surviving in a kept value: none. After the strict `url(...)` cut and the strict
`rgb(`/`rgba(` removal, any remaining `(` refuses the value. In 2.5 million mutated accepted
values (fill and style), the browser model saw only `url` tokens equal to a reader target
and no function other than `rgb` or `rgba`.
### 5.4 The composer check
`references_scoped` (compose.rs:105) walks the whole tree once, root included, and demands
`#fv.<view>.` on every `href` and `xlink:href`, and for every other attribute whose
lowercased value contains `url(`: `urls_are_local` and every target starting with the scope.
Anything a sanitised drawing can still carry as a reference is one of those: the presentation
attributes and `style` are the only CSS-parsed attributes on the allowlist that take a `<url>`
(`fill`, `stroke`, `filter`, `mask`, `clip-path`), `d`, `transform` and the rest are not read
as CSS fetches, and no other attribute names an element. The layer is added afterwards and
carries no `id`, `href` or `url(`: its colours are validated as hex at deserialisation
(schema.rs:89, `js::is_hex_color`). It cannot be bypassed by a value the reader accepts. Its
limit is that it shares the parser: it is a guard on `scope_ids`, not a second opinion on the
reader (reported, LOW).
### 5.5 Cost
No new quadratic walk. `references_scoped` is one pass with one lowercase copy per attribute
value. `url_openings` searches forward from the last match; each opening's space and id runs
end before the next opening's `(`, so runs do not overlap; `colour_function_end` adds one byte
test. Slice indexes sit on ASCII boundaries (`#`, `)`, `u`, `r`), so no panic path appeared.
Measured on a transliteration (5.7): 11 adversarial families (`url(#a) ` x N, `xurl(` x N,
`url(` plus N spaces, `url(#aaa…`, `url(#a` x N overlapping, `rgb(1,2,3) ` x N, `rgb(1,url(#a),3)`
x N, and others) doubled from 50k to 200k units: every ratio between 1.85 and 2.13. A first run
showed a 4.5x ratio on the `rgb(1,2,3) ` family; that was the Python slice copy `text[at:]`, which
the Rust `&text[at..]` does not make, and an offset-based port is linear.
### 5.6 Reported findings, detail
- MEDIUM, scope key (carried). The requirement is written in two places and nothing enforces it.
Today it has no victim: the only users of `view.canvas` in the app are the editor canvas and
its detail modal, which draw views of one document, with different view ids and therefore
different scopes. It becomes a defect on the first page that inlines two documents or two
versions at once. Keep it as an entry criterion of that page (a per-handle token in
`id_scope`, or a test that mounts two canvases with the same view id and fails).
- LOW, composer shares the parser. A coarse second opinion would not share the code: after
scoping, count the case-insensitive `url(` substrings of each value and require the count to
equal `url_targets(...).len()`. It would also fail closed on a glued `xurl(` kept on a
non-presentation attribute, which is harmless but unwanted in a drawing.
- LOW, tests deliver a space. roxmltree turns a raw TAB, LF or CR in attribute text into a space
(parse.rs:1364), so the rows `url('#\ta')`, `url('#a\tb')`, `url(\n#a)` and the hostile loop's
`url('#\tg')` test a space. A character reference (`&#9;`) stays a tab per XML 1.0 §3.3.3; I
could not read that branch of the parser (see 5.8). The reader is right on a tab (the model
and the slot sweep refuse it), but a regression that skipped only tabs would pass the suite.
- LOW, carried: TS oracle and mutation script, see the block.
- Not a finding, product note: a reference to an id the grammar rejects (`url(#1a)`, `url(#é)`,
for example an Illustrator export that keeps accented layer names as ids) now refuses the whole
file with `svg_active_content`, where it used to pass unread. That is the owner's strict
rule (§9.2), but the label tells the admin "active content" for what is only an unsupported id.
### 5.7 Method and what the probes are
- Run for real: `cargo test -p faunosteo-core --test svg_clean --test svg_scope` (21 passed,
0.73 s) and `cargo test -p faunosteo-core --lib anatomy::svg` (24 passed), in the worktree.
- The built wasm module cannot serve this round: `packages/core-wasm/pkg` is dated 16:28 and the
delta's sources 16:46 and 16:48, so it still holds the first-round code. No build was started.
- The fuzz and the sweeps ran on a Python transliteration of `url_openings`,
`local_url_target`, `url_targets`, `scope_url_targets`, `urls_are_local`,
`calls_only_local_url`, `colour_function_end`, `without_colour_functions` and the value rules
of `value_acceptable`, typed in from sanitize.rs at a678faa, fed on stdin (no file written).
Before use it was checked against the repo's own assertions (the 14 refused and 4 accepted
`url` rows of svg_clean, the 5 glued or loose colour rows, the colour accepted and refused
lists, the scoping unit test): all passed. It is not the compiled code.
- The oracle is a second, independent piece: a CSS Syntax Level 3 tokenizer (comments, strings,
numbers and dimensions, name code points above U+007F, `url(` unquoted token versus function,
bad-url) plus the URL Standard reading of a reference (strip C0 and space at the ends, remove
tab and newline, percent-decode the fragment). The property checked, per accepted value in a
`fill` and in a `style` context: every URL the browser model resolves is exactly `#id` with
the id one of the reader's targets, nothing external, no function other than `rgb` or `rgba`.
After scoping, the same holds with the `fv.main.` prefix and `references_scoped` passes.
- Volume: 400,000 grammar-generated strings, 3,000,000 and 2 x 2,500,000 mutants of 10 to 11
valid seeds (inserting, deleting or replacing from a 60-fragment vocabulary that includes
`%61`, tabs, controls, Unicode spaces, comments, quotes, `url(`, `rgb(`, backslash), each in
both contexts: 0 dangerous mismatches. About 543,000 accepted values carried a browser URL.
10,582 accepted values had a reference inside a comment or a string that the reader counts and
the browser ignores: the safe direction (over-counting for the dangling check and the budget).
- Control: the same harness on the pre-delta rules (`skip_url_prefix` plus longest id run)
reported 52,752 divergent values out of 177,587 accepted (`url(#éa)`, `url(#a%'6)`, `url(#g'-h%2e)`),
so the harness does detect the class the first round found.
- Not run: any browser. The first round's Chromium and Firefox results are the only browser
evidence; this round's browser behaviour comes from the specifications as modelled. WebKit was
never probed. semgrep did not run (registry packs, no network). The guardrails scanner ran:
0 FAIL, 28 WARN, none in the delta's files.
### 5.8 Commands refused
- A scratch cargo crate (path dependency on the worktree's core, own target directory, to run
the real functions on the new spellings) was refused by the permission rules: "Permission to
use Bash with command … has been denied", no rule named. My contract also forbids writing a
code file outside this report, so I did not retry it by another tool or route; the Python
transliteration above is the substitute and is weaker than running the Rust.
- A `sed` on `parse.rs` of roxmltree in the cargo registry after a `cd` with a glob was refused
with the deny rule `**/secrets/**`; not retried. The raw-whitespace normalisation at
parse.rs:1364 had been read earlier through a `grep`; the character-reference branch was not.
- Nothing else was written: `git status` in the worktree showed a clean tree before this
section, and this file is the only one touched.
@@ -79,3 +79,38 @@ Containers after the gates (`docker inspect`, read-only): identical to the snaps
`supabase_*_faunosteo` and the V1-2.1 sandbox: same start times and restart counts). `supabase_*_faunosteo` and the V1-2.1 sandbox: same start times and restart counts).
Known: commit `64a4384` alone does not build (`facade::clean_svg` names the module of `cf37aa2`); the branch head does. Known: commit `64a4384` alone does not build (`facade::clean_svg` names the module of `cf37aa2`); the branch head does.
## 7. Owner arbitrations at the checkpoint (brief « V1-2.2 : arbitrages du propriétaire et finalisation », on 17d9199)
Owner answers (2026-10-29, contract §17.4 last six rows): references refused when dangling and canvas ids scoped per
view, implemented in V1-2.2 (not deferred); one stored form for every upload, verdict and preview refusing another;
strict numeric colours kept; `remove` refused atomically while named; Inkscape fetched for real exports; the wasm debug
`name` section dropped. Commits: `e823655` (SVG), `bb5efa0` (removal), `661212a` (build flag), `93e4e81` (docs),
`5281337` (contract criteria B1-B8, mutation script), `a678faa` (strict `url(` after the security review), then the
review LOWs and this evidence.
| Gate | Result |
|---|---|
| `pnpm check:all` on `5281337` | exit 0; cargo 1 949 passed, 0 failed, 3 ignored; core-wasm 65, supabase 128, app 566; e2e:ui 26 passed; app image, worker test stage, worker runtime image |
| `pnpm check:all` on `a678faa` | exit 0; cargo 1 959 passed, 0 failed, 3 ignored; same suites green; module 1 512 071 B raw, 558 793 B gzip -9, 568 625 B by Node's gzip (budget 600 000, margin 31 375 B) |
| first run on the working tree | stopped at the committed-types guard only (`DrawingResult.ts`, `SvgCleaning.ts` regenerated, not yet committed); every stage before it green |
| mutations (`2026-10-29-v1-2-2-mutations-arbitrations.py`) | A1-A12 on 5281337: 12 killed (A11 first written so it did not compile, rewritten, killed); A13-A17 after a678faa: 4 killed, A17 (`%` taken into the id run) survives as an equivalent mutant, `is_reference_name` refusing `%` either way (A14 kills the grammar check itself) |
| protected readers, N-1 copies, frozen oracles, goldens, `supabase/` | no file changed (`git diff --name-only 17d9199`) |
| DEV and sandbox containers | `docker inspect` identical before and after every gate (start times, restart counts) |
Reviews (fresh; the pinned Fable 5.1 had no credits left and the Opus alias answered `model_not_found`, so both ran on
Sonnet):
| Round | Verifier | Security |
|---|---|---|
| `17d9199..5281337` | ECARTS(2): B4 LOW (`érgb(`, `rgurl(#b(` passed the colour exception), A6 open; doc drift | BLOCK(1) HIGH: `url(#%61)` (and Chromium's `url('#<TAB>a')`) passed the dangling check, the scoping and the expansion budget, resolving in Chromium 1248 and Firefox 1555 (budget hole pre-existing since R3); MEDIUM scope unique per document only; 3 LOW |
| `5281337..a678faa` | ECARTS(2): A6 open; B10 LOW (stale size figures, one wording in ANNOTATION-RENDERING); owner procedure not precise enough | PASS; MEDIUM carried as a written requirement; LOWs: composer check shares the reader's parser, no test delivers a real tab, TS helper oracle, mutation script |
| after | the LOWs fixed in the last commit: sizes, wording and counts in RUST.md; a coarse `url(` count in the composer check that shares no parser; `&#9;`, `&#10;`, `&#13;` spellings in `svg_clean`; the owner procedure rewritten (same source file, live-text variants, `--nocapture`, date in the name, Affinity) | — |
Inkscape provenance: not installed; inkscape.org 504 then timeout; `apt-get download` of `inkscape_1.4.3-0ubuntu2_amd64.deb`
(sha256 `24a2e9225c2cdcaad8f3e36a8b7a0f5a68db58ed67fc6f67455395fdd918326e`, equal to `apt-cache show`) and 22 library
packages into the session scratch folder, `dpkg-deb -x`, run with `LD_LIBRARY_PATH` (no install, no sudo).
Open at the checkpoint: A6 (Illustrator, Figma, Affinity exports from the owner); the MEDIUM (a page inlining two
documents needs a per-document prefix); the probe folder of the first security review, whose deletion the permission
rules refused (`scratchpad/probe-audit` of session 0cee2841), to be removed by the owner.
+1 -1
View File
@@ -579,7 +579,7 @@ Order (BDR-071): P0 docs + decisions → V1-1 clients and animals → V1-2 sheet
- [x] I4 edit commands, owner go 2026-10-29 (option « refus atomique »): `remove` refused `has_dependents` when any dependent is not a descendant (view: drawn annotations, child views, links opening it; annotation category; region; finding zone: linked annotations; reference: citing findings); finding descendants still go with their parent; contract §8.1 amended - [x] I4 edit commands, owner go 2026-10-29 (option « refus atomique »): `remove` refused `has_dependents` when any dependent is not a descendant (view: drawn annotations, child views, links opening it; annotation category; region; finding zone: linked annotations; reference: citing findings); finding descendants still go with their parent; contract §8.1 amended
- [x] I5 A6 inventory: Inkscape / Illustrator / Figma (version, drawing, steps, file name, folder, tests, status); Inkscape not installed → owner go 2026-10-29 to download it; inkscape.org answered 504 / timed out, so the Ubuntu archive package 1.4.3 (sha256 = signed index) + 22 libs fetched with `apt-get download`, unpacked in the scratchpad (no install, no sudo); 3 real exports + generator committed; Illustrator / Figma owner procedure; A6 stays open - [x] I5 A6 inventory: Inkscape / Illustrator / Figma (version, drawing, steps, file name, folder, tests, status); Inkscape not installed → owner go 2026-10-29 to download it; inkscape.org answered 504 / timed out, so the Ubuntu archive package 1.4.3 (sha256 = signed index) + 22 libs fetched with `apt-get download`, unpacked in the scratchpad (no install, no sudo); 3 real exports + generator committed; Illustrator / Figma owner procedure; A6 stays open
- [x] I6 wasm size: contributors measured, optimisation options for later steps; cap and test kept; owner go 2026-10-29: `--remove-name-section` in scripts/wasm-build.sh (debug `name` section, 279 KB raw, −30 691 B gzip measured) - [x] I6 wasm size: contributors measured, optimisation options for later steps; cap and test kept; owner go 2026-10-29: `--remove-name-section` in scripts/wasm-build.sh (debug `name` section, 279 KB raw, −30 691 B gzip measured)
- [ ] I7 gates: rust:check, SVG security suites, property + mutation, wasm + ts-rs, size, check:all; fresh verifier + security; evidence, memory, commit + push - [x] I7 gates: check:all green on 5281337 and a678faa (final rerun on the last commit); mutations 16 killed + 1 equivalent; fresh reviews (Sonnet: Fable out of credits, Opus alias 404): security BLOCK(1) HIGH url(#%61) → fixed a678faa → PASS; verifier ECARTS → LOWs fixed, A6 open; evidence §7; commit + push. Open: A6 owner exports, MEDIUM per-document prefix before any two-document page
- [ ] V1-2.3 drawings and worker verification (M6) · V1-2.4 wireframes (editor, review, admin entry) · V1-2.5 catalogue, admin space, rights, species, MFA · V1-2.6 editor level 1 · V1-2.7 preview, review, publication UI · V1-2.8 equine working copy and review preparation · V1-2.9 FR/EN acceptance and closure (owner checkpoints V1-2.3, V1-2.4, V1-2.6, V1-2.7, V1-2.8, V1-2.9 + each DEV operation of contract §16.11) - [ ] V1-2.3 drawings and worker verification (M6) · V1-2.4 wireframes (editor, review, admin entry) · V1-2.5 catalogue, admin space, rights, species, MFA · V1-2.6 editor level 1 · V1-2.7 preview, review, publication UI · V1-2.8 equine working copy and review preparation · V1-2.9 FR/EN acceptance and closure (owner checkpoints V1-2.3, V1-2.4, V1-2.6, V1-2.7, V1-2.8, V1-2.9 + each DEV operation of contract §16.11)
## Release readiness track (owner 2026-10-25, distinct from the functional roadmap; nothing here authorises a release or exposure) ## Release readiness track (owner 2026-10-25, distinct from the functional roadmap; nothing here authorises a release or exposure)
+5 -3
View File
@@ -108,10 +108,12 @@ fn references_scoped(element: &Element, scope: &str) -> bool {
.strip_prefix('#') .strip_prefix('#')
.is_some_and(|id| id.starts_with(scope)), .is_some_and(|id| id.starts_with(scope)),
_ if attr.value.to_ascii_lowercase().contains("url(") => { _ if attr.value.to_ascii_lowercase().contains("url(") => {
let targets = url_targets(&attr.value);
// A coarse count that shares no parser with the reader: every `url(` is a target.
let openings = attr.value.to_ascii_lowercase().matches("url(").count();
urls_are_local(&attr.value) urls_are_local(&attr.value)
&& url_targets(&attr.value) && openings == targets.len()
.iter() && targets.iter().all(|id| id.starts_with(scope))
.all(|id| id.starts_with(scope))
} }
_ => true, _ => true,
}); });
+6 -6
View File
@@ -26,9 +26,9 @@ sudo); inkscape.org, where the AppImage lives, answered 504 and timed out that d
## Editor exports, supplied by the owner (`owner/`) ## Editor exports, supplied by the owner (`owner/`)
Illustrator, Figma and Affinity are not available on the development machine (Inkscape is Illustrator, Figma and Affinity are not available on the development machine (Inkscape is
covered above by a real 1.4.3 export); the owner exports a small drawing from each and puts covered above by a real 1.4.3 export). The owner opens `inkscape-source.svg` in each tool,
the files in `owner/`, named `<tool>-<version>-<what>.svg` (for example exports it unchanged and puts the files in `owner/`, named `<tool>-<version>-<date>-<variant>.svg`;
`illustrator-29.3-export-as.svg`, `figma-125.8-export.svg`). The suite reads every file `owner/README.md` gives the exact steps. The suite reads every file there: each must be refused
there: each must be refused (with a closed reason) or cleaned into a drawing that reads back (with a closed reason) or cleaned into a stored form that reads back with no removal, and a file
with no removal, and a file whose name contains `-active-` must be refused for active content. whose name contains `-active-` must be refused for active content. Until files arrive, that test
Until files arrive, that test runs on an empty folder and the report of V1-2.2 says so. runs on an empty folder and A6 stays open.
+45 -34
View File
@@ -2,46 +2,57 @@ Owner-supplied editor exports land here (see ../README.md).
# What to export (A6, contract §9.2 and §15) # What to export (A6, contract §9.2 and §15)
One small drawing per tool, made in that tool, never retouched by hand afterwards. Same Every tool exports the same drawing, so the results compare: open
reference content as `../inkscape-source.svg`, so the results compare: `../inkscape-source.svg` (200 × 150 px: a dashed curved outline filled with a
two-stop gradient, an ellipse, a rounded rectangle with `fill-opacity` 0.5, the
group clipped by a rectangle, the live text « Garrot ») in the tool, change
nothing, and export it. Never retouch an exported file by hand.
- an outline with a curve, filled with a two-stop linear gradient, a 2 px dashed stroke; Name each file `<tool>-<version>-<date>-<variant>.svg`: the version from the
- an ellipse with a flat colour; tool's « About » box (Figma in the browser shows none: write `web`), the date
- a rounded rectangle at 50 % opacity; as `2026-10-30`. Example: `illustrator-29.3-2026-10-30-presentation.svg`.
- the whole group clipped by a rectangle (Illustrator: clipping mask; Figma: a frame with
« Clip content »);
- the word « Garrot » as live text.
Artboard or frame 200 × 150 px. Note the exact version (Illustrator: Aide › À propos The menu labels below are the English ones; the French interface words them
d'Illustrator; Figma: menu › Aide › À propos de Figma, or the desktop app's version). differently, and I could not check them here.
## Illustrator ## Illustrator (Fichier › Ouvrir… `inkscape-source.svg`)
1. Fichier › Exporter › Exporter sous… › format SVG (`svg`), « Utiliser les plans de travail » 1. File › Export › Export As… › format SVG, « Use Artboards » ticked.
ticked. 2. SVG Options, two exports of the same drawing:
2. Options SVG, two files: - `…-presentation.svg`: Styling « Presentation Attributes », Font « SVG »
- `illustrator-<version>-export-as.svg`: Style « Attributs de présentation », Police (text kept as text), Images « Embed », Object IDs « Layer Names »,
« Vectoriser », Images « Incorporer », ID d'objet « Noms de calques », Décimales 2, Minifier Decimal 2, Minify off, Responsive on;
off, Responsive on; - `…-internal-css.svg`: the same with Styling « Internal CSS » and Font
- `illustrator-<version>-internal-css.svg`: the same with Style « CSS interne » (the export « Convert to Outlines » (the export most users keep).
most users keep by default; expected cleanable, its `<style>` named as removed). 3. Optional: File › Save As… › SVG with the dialog's defaults
3. If a third is easy: Fichier › Enregistrer sous… › SVG (`illustrator-<version>-save-as.svg`), (`…-save-as.svg`). This older path may keep Illustrator data that the
the older dialog, default settings. core refuses as active content; a refusal is a valid result, tell me.
## Figma ## Figma (import `inkscape-source.svg` into a file, or drag it onto the canvas)
1. Select the frame, right panel › Exporter › « + » › format SVG. 1. Select the imported frame, right panel › Export › « + » › SVG.
2. Options, two files: 2. Two exports:
- `figma-<version>-export.svg`: defaults (« Contours du texte » ticked, « Inclure - `…-default.svg`: the defaults;
l'attribut id » unticked); - `…-ids.svg`: « Include "id" attribute » ticked, « Outline text » unticked
- `figma-<version>-ids.svg`: « Inclure l'attribut id » ticked (the layer names become ids). (text kept as text).
3. Exporter.
## Affinity (Designer 2 or Affinity, if you use it; otherwise say so and A6 drops it)
File › Open `inkscape-source.svg`, then File › Export › SVG, preset « SVG (for
web) » (`…-web.svg`); if offered, a second with « SVG (digital – high quality) »
(`…-hq.svg`).
## Then ## Then
Copy the files here, unchanged, and tell Claude. The suite Copy the files here unchanged, then run, from the repository root:
`cargo test -p faunosteo-core --test svg_clean the_owner_editor_exports` reads every `.svg` in
this folder: each must be refused with a closed reason or cleaned into a stored form that reads cargo test -p faunosteo-core --test svg_clean the_owner_editor_exports -- --nocapture
back with no removal. A file whose name contains `-active-` must be refused for active content
(useful if you want to try an export with a linked image or an animation). Nothing is uploaded It prints one line per file: the outcome (clean, cleanable or rejected), the
anywhere: these are test fixtures, committed with the tool and version in their names. reason and the removed names. Send me that output with the files. A green run
alone proves only that every file was cleaned into a readable stored form or
refused with a closed reason; the printed lines say which, and I turn them into
fixed expectations in the suite. A file whose name contains `-active-` must be
refused for active content (useful if you also export one with a linked image
or an animation). Nothing is uploaded anywhere: these are test fixtures,
committed with the tool, version and date in their names.
+4
View File
@@ -365,6 +365,10 @@ fn every_url_spelling_but_the_strict_one_is_refused() {
"url(#a rgb(1,2,3))", "url(#a rgb(1,2,3))",
"url(#/a)", "url(#/a)",
"url(#a", "url(#a",
"url(\'#&#9;a\')",
"url(\'#a&#9;\')",
"url(\'#a&#10;\')",
"url(&quot;&#13;#a&quot;)",
] { ] {
let cleaning = clean_svg(svg(value).as_bytes()); let cleaning = clean_svg(svg(value).as_bytes());
assert_eq!( assert_eq!(
+5 -3
View File
@@ -79,9 +79,11 @@ whole document. Since V1-2.2 (owner decision 2026-10-29) the core writes
reference to it (`href`, `xlink:href`, `url(#…)`), so each view resolves its reference to it (`href`, `xlink:href`, `url(#…)`), so each view resolves its
gradients, clip paths and `<use>` targets in its own drawing only, never in gradients, clip paths and `<use>` targets in its own drawing only, never in
another view's or in the page, and the composer refuses a canvas that would another view's or in the page, and the composer refuses a canvas that would
keep a reference outside its scope; a drawing whose reference names an id it keep a reference outside its scope. A drawing whose reference names an id it
does not define, or spells a `url(` any other way than `url(#id)` with optional does not define is refused by the reader (`dangling_reference`); a `url(` spelt
quotes and spaces, is refused by the reader. The annotation any other way than `url(#id)` with optional quotes and spaces is removed by the
reader, so the cleaning refuses the file as active content and the verdict as a
removal. The annotation
layer carries no `id`. The PDF view keeps the drawing's ids: it is rasterised layer carries no `id`. The PDF view keeps the drawing's ids: it is rasterised
as a document of its own. The R3 canvas goldens stay frozen; the tests apply as a document of its own. The R3 canvas goldens stay frozen; the tests apply
this declared change to them (`withIdsScopedPerView`, this declared change to them (`withIdsScopedPerView`,
+9 -8
View File
@@ -3885,7 +3885,7 @@ trapping test stub (`apps/app/tests/helpers/core.ts`) lists the two new glue mem
### 12.3 Behaviour (declared) ### 12.3 Behaviour (declared)
1. The sanitiser keeps, removes and refuses exactly as before (R3 oracles O4/O5 green); its walk also lists, in 1. The sanitiser keeps, removes and refuses exactly as before (R3 oracles O4/O5 green; the declared changes of §12.7 apart); its walk also lists, in
`active`, each removal that carried a script, an embedded document or image (`image`, `feImage`, `foreignObject`, `active`, each removal that carried a script, an embedded document or image (`image`, `feImage`, `foreignObject`,
`iframe`, `object`, `embed`, media, and the HTML fetchers `img`, `input`, `source`, `frame`, `form`, `meta`, `link`, `iframe`, `object`, `embed`, media, and the HTML fetchers `img`, `input`, `source`, `frame`, `form`, `meta`, `link`,
`base`…), any element of the XHTML namespace, animation, a link (`a`), an event handler (`on*`), a fetching attribute `base`…), any element of the XHTML namespace, animation, a link (`a`), an event handler (`on*`), a fetching attribute
@@ -3950,7 +3950,7 @@ trapping test stub (`apps/app/tests/helpers/core.ts`) lists the two new glue mem
| Measure | Value | | Measure | Value |
|---|---| |---|---|
| shipped module | 1 511 410 B raw, 558 651 B gzip -9 (script), 568 416 B by Node's gzip in `size.test.ts` (final, after §12.7: the debug `name` section dropped); budget 600 000 (D-R13); 596 671 B at ca31b78, 531 715 B before V1-2.2 (RUST.md §11.22) | | shipped module | 1 512 071 B raw, 558 793 B gzip -9 (script), 568 625 B by Node's gzip in `size.test.ts` (final, a678faa and after: the debug `name` section dropped, §12.7); budget 600 000 (D-R13); 596 671 B at ca31b78, 531 715 B before V1-2.2 (RUST.md §11.22) |
| verdict at every cap, native | 107 ms release, 493 ms debug (document 1 165 850 bytes) | | verdict at every cap, native | 107 ms release, 493 ms debug (document 1 165 850 bytes) |
| `clean_svg`, shipped module | 45 hostile inputs and floods, slowest 0.4 ms | | `clean_svg`, shipped module | 45 hostile inputs and floods, slowest 0.4 ms |
@@ -3969,7 +3969,7 @@ with a PI shown `rejected` by the preview as the verdict refuses it.
### 12.6 Residual risks and points for V1-2.3 ### 12.6 Residual risks and points for V1-2.3
- The module's margin under its budget is about 31.6 KB by the test's measure since §12.7 (3.3 KB before): the V1-2.5 and V1-2.6 pages must not grow the - The module's margin under its budget is about 31.4 KB by the test's measure since §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. core's browser surface without measuring.
- cairo colours: closed at the checkpoint (§12.7), strict numeric `rgb()` / `rgba()` kept. - 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); Illustrator, Figma and Affinity pending from the - Editor exports: Inkscape 1.4.3 covered at the checkpoint (§12.7); Illustrator, Figma and Affinity pending from the
@@ -4004,9 +4004,9 @@ canvas goldens (`canvas.{main,head}.json`) get their ids scoped (`with_ids_scope
`withIdsScopedPerView` in the app's `canvas.trees.test.tsx`). The equine drawing is already in the stored form: its `withIdsScopedPerView` in the app's `canvas.trees.test.tsx`). The equine drawing is already in the stored form: its
sha256 `0ea5202f…`, the fingerprint and every R4 digest are unchanged. sha256 `0ea5202f…`, the fingerprint and every R4 digest are unchanged.
Tests: `svg_scope` (6: valid reference, absent reference refused by reader, cleaning, preview and verdict, two views with Tests: `svg_scope` (7: valid reference, absent reference refused by reader, cleaning, preview and verdict, two views with
the same ids resolving each in its own view when both canvases are inlined, a cross-view attempt, three references to the same ids resolving each in its own view when both canvases are inlined, a cross-view attempt, three references to
one id, deterministic and repeated composition); `svg_clean` (13: cairo export clean with its five colours, shapes and one id, deterministic and repeated composition, a browser model over composed canvases); `svg_clean` (14: cairo export clean with its five colours, shapes and
references; seven dangerous constructs next to a colour refused as active, five other functions removed; the three references; seven dangerous constructs next to a colour refused as active, five other functions removed; the three
Inkscape exports; clean files uploaded in the stored form; generated drawings now also refused for dangling references); Inkscape exports; clean files uploaded in the stored form; generated drawings now also refused for dangling references);
`sheet_verdict` and `sheet_preview` (a drawing outside the stored form fails / shows rejected); `sheet_edit` (removal `sheet_verdict` and `sheet_preview` (a drawing outside the stored form fails / shows rejected); `sheet_edit` (removal
@@ -4026,15 +4026,16 @@ the expansion budget was walked around the same way (pre-existing since R3). Now
reading of a `url(`: CSS whitespace, an optional quote, `#`, an id in the reference grammar, the same quote, CSS reading of a `url(`: CSS whitespace, an optional quote, `#`, an id in the reference grammar, the same quote, CSS
whitespace, `)`; any other spelling is active content and refuses the file. A `url(` or `rgb(` glued to a longer name whitespace, `)`; any other spelling is active content and refuses the file. A `url(` or `rgb(` glued to a longer name
(`xurl(`, `érgb(`, a non-ASCII letter included) is another function; a colour must end its value or list item. The (`xurl(`, `érgb(`, a non-ASCII letter included) is another function; a colour must end its value or list item. The
composer checks, fail-closed, that every reference of a canvas carries its view's scope (`unscoped_reference`). Tests composer checks, fail-closed, that every reference of a canvas carries its view's scope and that each value holds
no more `url(` than local references (`unscoped_reference`), a coarse count that shares no parser with the reader. Tests
written apart from the reader: 14 refused spellings, 5 removed glued names, a 25 000-reference flood in `%61`, and a written apart from the reader: 14 refused spellings, 5 removed glued names, a 25 000-reference flood in `%61`, and a
browser model (percent-decoding, tab and newline stripping) over composed canvases (`svg_scope`). The R3 sanitiser browser model (percent-decoding, tab and newline stripping) over composed canvases (`svg_scope`). The R3 sanitiser
oracles needed no new declared change. oracles needed no new declared change.
Residual (MEDIUM, security review): the scope is the view id, unique in one document only. A page that inlines canvases Residual (MEDIUM, security review): the scope is the view id, unique in one document only. A page that inlines canvases
of two documents at once (two versions side by side, two sheets) would share `fv.main.` and resolve in the first one in of two documents at once (two versions side by side, two sheets) would share `fv.main.` and resolve in the first one in
tree order; such a page (V1-2.7 or later; the side-by-side diff is level 2, contract §8.3) must add a per-document tree order; any such page (a V1-2.5 catalogue grid, a V1-2.6 preview beside the editor, a V1-2.7 comparison; the
prefix before it ships. The detail modal of the report editor draws another view of the same document, so its scope side-by-side diff itself is level 2, contract §8.3) must add a per-document prefix before it ships. The detail modal of the report editor draws another view of the same document, so its scope
differs. differs.
Size (V1-2.2 final, by Node's gzip in `size.test.ts`): see §12.5. Contributors measured on a build keeping the name Size (V1-2.2 final, by Node's gzip in `size.test.ts`): see §12.5. Contributors measured on a build keeping the name