fix(anatomy): R5.4 aligned report tables bounded before they are built, declared case fully held, docs

This commit is contained in:
bchanot committed 2026-10-23 14:39:51 +02:00
1 parent aeb5050502
commit 777c8000b8
8 files changed
+215 -21

No files matched your search

+8 -3
View File
@@ -3156,7 +3156,8 @@ three security probes, each round finding a Prettier rewrite the previous rules
also rewrites Markdown in authored text (escapes, emphasis, whitespace, links); the port
reproduces only the table alignment. After a denylist that leaked round after round, the guard of
the draft's two reports (`curation/report_guard.rs`, `format_report`; the R5.2 import report keeps
`format_markdown`, verified at R5.2) is an allowlist: outside code spans, letters and digits,
`format_markdown`, verified at R5.2, which gained at R5.4 the cell-count refusal and the table
bound below, both shared with the import report) is an allowlist: outside code spans, letters and digits,
single spaces (none at a line end), the punctuation `.,;:!?'"«»()[]{}/-–—…%°≠=+#<>’‘“”±→×≤≥|`, an
`&` before a space or as a URL's query separator (`&name=` in a bare URL, the name not starting
with one of HTML's 106 legacy references, which Prettier decodes without a `;`), an underscore
@@ -3200,8 +3201,9 @@ pass the guard unchanged.
| Input | TypeScript | Rust |
|---|---|---|
| authored text outside the allowlist: Markdown Prettier rewrites (`*x*`, `_x`, `x_**a**`, `**a****b**`, `Voir_https://…`, `a b`, a non-ASCII space, a tab, a line break in a list item, `` `` ``, `a\|b`, `[a](<b>)`, `[[ a ]]`, `&#42;`…), the constructs refused whole (links, HTML tags, autolinks, character references) and any character outside the admitted set (combining marks, pictographs, symbols) | written, then rewritten by Prettier (escapes, `_emphasis_`, collapsed spaces, indented continuation lines, normalised links; a row with an extra cell), or kept | refused (`UnsupportedMarkdown`), even where Prettier would have kept the text |
| authored text outside the allowlist: Markdown Prettier rewrites (`*x*`, `_x`, `x_**a**`, `**a****b**`, `Voir_https://…`, `a b`, a non-ASCII space, a tab, a line break in a list item, `` `` ``, `a\|b`, `[a](<b>)`, `[[ a ]]`, `&#42;`…), the constructs refused whole (links, HTML tags, autolinks, character references) and any character outside the admitted set (pictographs, symbols, combining marks without the Alphabetic property; an alphabetic mark such as U+0345 is a letter and Prettier aligns it alike) | written, then rewritten by Prettier (escapes, `_emphasis_`, collapsed spaces, indented continuation lines, normalised links; a row with an extra cell), or kept | refused (`UnsupportedMarkdown`), even where Prettier would have kept the text |
| a pictograph in a table cell (an emoji, and ©, ®, ™, ✓, ★, ⚠ and the other characters `text::is_emoji_candidate` lists) | measured with Prettier's tables | refused (`UnsupportedWidth`, R5.2): the set is wider than the emoji, the refusal stays loud |
| an aligned report table past 32 Mi display columns in all (rows × padded row width; the equine CHANGELOG's widest table is about 0.5 MB): one long authored cell pads every row of its level, so an 80 KB rationale over 14,000 records asked for 1 GB (security gate R5.4 round 6) | Prettier aligned it (the same amplification) | refused before any row is built (`Guard`, test `an_aligned_table_past_the_bound_is_refused_before_it_is_built`), import report included |
| an id an `add` writes (the item's, and those nested in its `children` or `categories`) or a `rename` id that is not a stable id (a region code for a region), or a field segment outside `[A-Za-z0-9_-]` (a control character, NUL included, a backtick, a `]`, a space, a non-ASCII letter) | accepted when a later op removed or renamed the item: the raw id stayed in the records and reached the reports' code spans (a line break there forged a section, security gate R5.4 round 2) | refused at the op, the check the final document applies anyway (test `ids_and_field_segments_that_could_forge_report_structure_are_refused`) |
| a label, id or path holding a code point XML 1.0 refuses, or a carriage return, in a review drawing | written (a non-well-formed file; a raw CR read back as a line feed) | refused: the drawing is not written |
@@ -3238,7 +3240,10 @@ ruled and frozen in the sweep, so a combination of admitted characters no probe
differ; the comparison of the application's drawings accepts
exactly the trigger-name rule, byte for byte; the frozen
`horse.svg` is read, never regenerated, so a future change of the drawing needs its own
decision; the residual risks of §11.13 stand.
decision; the review drawings are bounded only through the document's 200,000 values (two drawings
of about 137 KB per view, about 2 GB at the bound, an estimate of the security gate R5.4 round 6,
not measured), and the allowlist admits the invisible Hangul fillers (U+3164, U+115F, U+1160,
U+FFA0, letters Prettier keeps, no structure); the residual risks of §11.13 stand.
Conditions for R5.5: the owner's validation of this checkpoint; the upload tool (`ureq`, the
service key from the environment, bucket `anatomical-sheet-assets`, key `<sha256>.svg`,