From c7671c615b5df2ad0f607368fd36d06b8b36a6f8 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 21 Nov 2026 21:02:47 -0800 Subject: [PATCH] Scripts: style objects see a style a batch removes and adds again - A style object goes stale when the steps of one `command.batch` remove its style and add another under the same name, as it does when separate `vc.run` calls do. The session notes each batch step's style lists while a script runs, and the style objects check each of them. - `add(name)` with all 4,096 style slots of the run taken throws before it adds the style; with one slot left it adds it. - `typename` of a removed style's `characterAttributes` or `paragraphAttributes` throws `Stale style`, as its other members do. - The style load commands refuse `data` over 64 MB without copying it. - docs/mcp.md states the 64 MB limit for `data` and decoded `dataBase64`; docs/gaps.md G6 and the docs/roadmap.md M13 row list the script text and style members. --- crates/engine/src/cmd/textstyles.rs | 8 ++--- crates/engine/src/cmd/textstyles/tests.rs | 3 ++ crates/engine/src/lib.rs | 4 +++ crates/engine/src/script/dom/text/styles.rs | 37 ++++++++++++++++++--- crates/engine/src/script/mod.rs | 22 ++++++++++++ crates/engine/src/session/documents.rs | 1 + crates/engine/src/session/execute.rs | 3 ++ crates/engine/src/tests/script_styles.rs | 21 ++++++++++++ docs/gaps.md | 2 +- docs/mcp.md | 3 +- docs/roadmap.md | 2 +- 11 files changed, 94 insertions(+), 12 deletions(-) diff --git a/crates/engine/src/cmd/textstyles.rs b/crates/engine/src/cmd/textstyles.rs index 3b57c2e067..3b64929cc2 100644 --- a/crates/engine/src/cmd/textstyles.rs +++ b/crates/engine/src/cmd/textstyles.rs @@ -1270,11 +1270,11 @@ fn load(s: &mut Session, p: &Value, kinds: &[Kind]) -> Result { }; let path = str_param(p, "path"); let too_large = || bad(c, format!("the file is larger than {} MB", MAX_LOAD_BYTES >> 20)); - let bytes = match (path, str_param(p, "data"), str_param(p, "dataBase64")) { - (Some(path), ..) => super::fileio::read_file_head(path, MAX_LOAD_BYTES + 1)?, - (None, Some(text), _) => text.as_bytes().to_vec(), + let bytes: std::borrow::Cow<[u8]> = match (path, str_param(p, "data"), str_param(p, "dataBase64")) { + (Some(path), ..) => super::fileio::read_file_head(path, MAX_LOAD_BYTES + 1)?.into(), + (None, Some(text), _) => text.as_bytes().into(), (None, None, Some(b64)) if b64.len() > MAX_LOAD_BYTES / 3 * 4 + 4 => return Err(too_large()), - (None, None, Some(b64)) => vectorcraft_format::base64_decode(b64).ok_or_else(|| bad(c, "bad dataBase64"))?, + (None, None, Some(b64)) => vectorcraft_format::base64_decode(b64).ok_or_else(|| bad(c, "bad dataBase64"))?.into(), _ => return Err(bad(c, "give `path`, `data` or `dataBase64`")), }; if bytes.len() > MAX_LOAD_BYTES { diff --git a/crates/engine/src/cmd/textstyles/tests.rs b/crates/engine/src/cmd/textstyles/tests.rs index 1f8511d7ac..f2d2354000 100644 --- a/crates/engine/src/cmd/textstyles/tests.rs +++ b/crates/engine/src/cmd/textstyles/tests.rs @@ -845,6 +845,9 @@ fn loading_refuses_a_file_larger_than_64_mb() { let b64 = "A".repeat(MAX_LOAD_BYTES / 3 * 4 + 8); let r = s.execute("paraStyle.load", &json!({"dataBase64": b64})); assert!(r.as_ref().is_err_and(|e| e.to_string().contains("larger than 64 MB")), "{r:?}"); + let text = " ".repeat(MAX_LOAD_BYTES + 1); + let r = s.execute("textStyle.loadAll", &json!({"data": text})); + assert!(r.as_ref().is_err_and(|e| e.to_string().contains("larger than 64 MB")), "{r:?}"); assert_eq!(s.doc().unwrap().doc, before); } diff --git a/crates/engine/src/lib.rs b/crates/engine/src/lib.rs index e2e6430f1e..335c83eebb 100644 --- a/crates/engine/src/lib.rs +++ b/crates/engine/src/lib.rs @@ -309,6 +309,10 @@ pub struct Session { pub script_frames: bool, /// Each open document's highest next id a run has seen, by [`DocState::uid`]. pub(crate) script_high_water: std::collections::HashMap, + /// The style lists each step of a batch a script runs left in a document whose lists it + /// changed: its uid, revert count, and character and paragraph style lists + /// ([`script::note_style_lists`]). + pub(crate) script_style_trail: Vec, /// While a slice of a script runs in this session. pub(crate) script_in_run: bool, /// Write recovery copies of the unsaved documents before a run, and don't start without them. diff --git a/crates/engine/src/script/dom/text/styles.rs b/crates/engine/src/script/dom/text/styles.rs index 841d006ac6..2b40d92bcd 100644 --- a/crates/engine/src/script/dom/text/styles.rs +++ b/crates/engine/src/script/dom/text/styles.rs @@ -75,13 +75,20 @@ pub(super) struct StyleState { } /// Marks stale each style object whose style the command just run removed or renamed, so a style -/// removed and made again under its name by later commands is another style. A document whose -/// style lists did not change is not checked again. +/// removed and made again under its name by later commands, or by later steps of the same batch, +/// is another style. A document whose style lists did not change is not checked again. pub(in crate::script) fn after_command(h: &Host) { + let trail = std::mem::take(&mut h.session.borrow_mut().script_style_trail); let mut slots = h.dom.text.styles.slots.borrow_mut(); if !slots.iter().any(|s| s.live) { return; } + for (uid, reverts, c, p) in &trail { + for slot in slots.iter_mut().filter(|x| x.live && x.uid == *uid) { + let list = if slot.para { p } else { c }; + slot.live = slot.reverts == *reverts && (slot.name == normal(slot.para) || list.iter().any(|d| d.name == slot.name)); + } + } let s = h.session.borrow(); let mut seen = h.dom.text.styles.seen.borrow_mut(); seen.retain(|(uid, ..)| s.documents().iter().any(|d| d.uid == *uid)); @@ -173,6 +180,10 @@ fn stale() -> HostError { HostError::Error(STALE_STYLE.into()) } +fn held_too_many() -> HostError { + HostError::Range(format!("a script can name at most {MAX_HELD} styles in one run")) +} + /// The style object for the style `name` of the document `uid`: the same slot as every other /// object naming it in this run. fn style_ref(h: &Host, uid: u64, para: bool, name: &str) -> Answer { @@ -182,7 +193,7 @@ fn style_ref(h: &Host, uid: u64, para: bool, name: &str) -> Answer { Some(i) => i, None => { if slots.len() >= MAX_HELD { - return Err(HostError::Range(format!("a script can name at most {MAX_HELD} styles in one run"))); + return Err(held_too_many()); } slots.push(Slot { uid, reverts, para, name: name.to_string(), live: true }); slots.len() - 1 @@ -416,6 +427,18 @@ fn char_value(h: &Host, attr: Attr, m: &Map) -> Data { } } +/// The `typename` of a style's `characterAttributes`, which throws once the style is gone. +fn attrs_typename_char(h: &Host, a: &[Data]) -> Answer { + attrs_of(h, a, false)?; + Ok(text("CharacterAttributes")) +} + +/// The `typename` of a style's `paragraphAttributes`, which throws once the style is gone. +fn attrs_typename_para(h: &Host, a: &[Data]) -> Answer { + attrs_of(h, a, true)?; + Ok(text("ParagraphAttributes")) +} + fn read_char(h: &Host, a: &[Data], attr: Attr) -> Answer { let (_, m) = attrs_of(h, a, false)?; Ok(char_value(h, attr, &m)) @@ -651,6 +674,10 @@ fn list_add(h: &Host, a: &[Data]) -> Answer { if with_doc(h, doc, |_, st| has_style(st, para, &name)) { return Err(HostError::Error(format!("a style named {name} already exists"))); } + // The new style needs a slot of its own: a run that names as many styles as it may adds none. + if h.dom.text.styles.slots.borrow().len() >= MAX_HELD { + return Err(held_too_many()); + } run(h, doc, para, "new", &json!({"name": name, "attrs": {}}))?; // An object of a removed style of this name stays stale. forget(h, doc.uid, para, std::slice::from_ref(&name)); @@ -738,9 +765,9 @@ pub(super) fn classes(l: &Link) -> Vec { Some(function(l, list_at)), ) }; - let mut chars = named(vec![("typename", typename_of("CharacterAttributes"))]); + let mut chars = named(vec![("typename", get(l, attrs_typename_char))]); chars.extend(char_members(l)); - let mut paras = named(vec![("typename", typename_of("ParagraphAttributes"))]); + let mut paras = named(vec![("typename", get(l, attrs_typename_para))]); paras.extend(para_members(l)); vec![ style(false), diff --git a/crates/engine/src/script/mod.rs b/crates/engine/src/script/mod.rs index e537ab8ef7..18e24f1c36 100644 --- a/crates/engine/src/script/mod.rs +++ b/crates/engine/src/script/mod.rs @@ -1236,6 +1236,7 @@ fn note_ids(s: &mut Session) { /// it, for a result that cannot cross to the script. fn step(s: &mut Session, host: &Host, id: &str, params: &Value) -> Result<(Value, u64, u64, Option)> { raise_ids(s); + s.script_style_trail.clear(); let mutating = waits_for_tool_edit(id); // Inside an object-model call's own savepoint ([`dom`]), that savepoint puts a failure back. let save = (mutating && !host.dom.saving()).then(|| Savepoint::take(s, id)); @@ -1353,6 +1354,27 @@ fn command_value(host: &Host, id: &str, params: &Value) -> std::result::Result<( crossed.map(|data| (data, value)) } +/// A document's uid, revert count, and character and paragraph style lists. +pub(crate) type StyleLists = + (u64, u64, vectorcraft_doc::Shared>, vectorcraft_doc::Shared>); + +/// After a step of a batch a script runs: notes the style lists of each document whose lists or +/// revert count the step changed, so the style objects see a style the batch removed and made +/// again under its name as another style ([`dom::after_command`]). +pub(crate) fn note_style_lists(s: &mut Session) { + for st in &s.docs { + let last = s.script_style_trail.iter().rev().find(|(uid, ..)| *uid == st.uid); + let same = last.is_some_and(|(_, reverts, c, p)| { + *reverts == st.reverts + && vectorcraft_doc::Shared::ptr_eq(c, &st.doc.char_styles) + && vectorcraft_doc::Shared::ptr_eq(p, &st.doc.para_styles) + }); + if !same { + s.script_style_trail.push((st.uid, st.reverts, st.doc.char_styles.clone(), st.doc.para_styles.clone())); + } + } +} + /// A bounded snapshot of the active document, or `null` with none open. A snapshot past the limits /// of a crossing throws a `RangeError`. fn vc_document(host: &Host) -> std::result::Result { diff --git a/crates/engine/src/session/documents.rs b/crates/engine/src/session/documents.rs index 61dbdb4491..52852308e3 100644 --- a/crates/engine/src/session/documents.rs +++ b/crates/engine/src/session/documents.rs @@ -165,6 +165,7 @@ impl Session { script_runs: 0, script_frames: false, script_high_water: Default::default(), + script_style_trail: Vec::new(), script_in_run: false, script_copy_first: cfg!(target_arch = "wasm32"), } diff --git a/crates/engine/src/session/execute.rs b/crates/engine/src/session/execute.rs index 046c480079..f0eabe06dd 100644 --- a/crates/engine/src/session/execute.rs +++ b/crates/engine/src/session/execute.rs @@ -84,6 +84,9 @@ impl Session { self.execute_spec(spec, id, params) }; self.reading = outer; + if self.script_in_run && self.depth > 0 && r.is_ok() { + crate::script::note_style_lists(self); + } r } diff --git a/crates/engine/src/tests/script_styles.rs b/crates/engine/src/tests/script_styles.rs index 759e41eae1..860aecfa81 100644 --- a/crates/engine/src/tests/script_styles.rs +++ b/crates/engine/src/tests/script_styles.rs @@ -165,6 +165,19 @@ fn a_renamed_style_keeps_its_object_and_a_removed_style_is_stale() { ), ); assert!(e.contains("Stale style"), "{e}"); + // So is a style removed and made again by the steps of one batch. + let e = failure( + &mut s, + &format!( + "{DOC} var a = cs.getByName('B'); vc.run('command.batch', {{commands: [{{command: 'charStyle.delete', params: {{name: 'B'}}}}, \ + {{command: 'charStyle.new', params: {{name: 'B', attrs: {{}}}}}}]}}); a.name;" + ), + ); + assert!(e.contains("Stale style"), "{e}"); + // The attributes object of a removed style throws for its typename too. + let e = + failure(&mut s, &format!("{DOC} var t = cs.getByName('B').characterAttributes; vc.log(t.typename); cs.getByName('B').remove(); t.typename;")); + assert!(e.contains("Stale style"), "{e}"); // A style renamed by a command is stale too, and its text keeps its look after a removal. let e = failure(&mut s, &format!("{DOC} var a = cs.getByName('B'); vc.run('charStyle.rename', {{name: 'B', to: 'C'}}); a.name;")); assert!(e.contains("Stale style"), "{e}"); @@ -359,6 +372,14 @@ fn a_run_names_at_most_4096_styles() { assert_eq!(out, [json!(false), json!(4101)]); let e = failure(&mut s, &format!("{DOC} for (var i = 0; i < 4097; i++) cs[i].name;")); assert!(e.contains("4096 styles"), "{e}"); + // `add` with every slot taken adds no style; with one slot left it adds the style. + let out = log( + &mut s, + &format!("{DOC} for (var i = 0; i < 4096; i++) cs[i]; try {{ cs.add('New'); }} catch (e) {{ vc.log(e.message); }} vc.log(cs.length);"), + ); + assert_eq!(out, [json!("a script can name at most 4096 styles in one run"), json!(4101)]); + let out = log(&mut s, &format!("{DOC} for (var i = 0; i < 4095; i++) cs[i]; vc.log(cs.add('New').name); vc.log(cs.length);")); + assert_eq!(out, [json!("New"), json!(4102)]); } /// A script loads styles from a file only where it may read files; a file outside that is refused. diff --git a/docs/gaps.md b/docs/gaps.md index 47a1680f6e..561946b6d0 100644 --- a/docs/gaps.md +++ b/docs/gaps.md @@ -810,7 +810,7 @@ macOS cursor delivery (#2292) is narrowed to a native host adapter using the exi - **Missing:** the rest of the document object model for scripts (layers, artboards, paths, stories and threads of type, and the other classes) and the `#engine` script directive (#1183 is open). Scripts have `app`, the open documents, new documents, each document's selection and its page items, its text frames with their text ranges and - character and paragraph attributes, and the installed fonts. File › Scripts › Other Script… and `script.run` run JavaScript files over the command registry, `#targetengine` + character and paragraph attributes, its character and paragraph styles, and the installed fonts. File › Scripts › Other Script… and `script.run` run JavaScript files over the command registry, `#targetengine` runs a script in a named engine whose globals last between runs, File › Scripts lists the scripts of the Scripts folder, and Window › Script Console shows their output, errors and run reports. Actions, Batch, Variables (text, visibility, image and graph), data set CSV import and diff --git a/docs/mcp.md b/docs/mcp.md index 411ef4ba07..0495483d8e 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -13112,7 +13112,8 @@ uses, in panel order and never the Normal style, and the panel highlights them; (Load Character Styles… and Load Paragraph Styles… in the panel menus, where `ui.loadCharStyles` and `ui.loadParaStyles` pick the file) copy the styles of that kind from another document VectorCraft opens (`path`, `data` or `dataBase64`), and `textStyle.loadAll` (Load All Styles…, `ui.loadAllStyles`) copies both kinds, each in one undo -step. A file larger than 64 MB is refused without being read in full. The swatches and patterns the styles paint with, the symbols and brushes those patterns use, and the styles of +step. A file larger than 64 MB is refused without being read in full. The 64 MB limit also applies to `data` and to the +decoded bytes of `dataBase64`; a `dataBase64` string too long to decode to 64 MB or less is refused before it is decoded. The swatches and patterns the styles paint with, the symbols and brushes those patterns use, and the styles of either kind that type in those patterns and symbols is set in, come along as Paste brings those of pasted type; a global or spot color whose name the document gives another color is the document's. A loaded style that is the same as the style of its name, or of its name with a number (`Body 2`), is not added again; any other is added under a free name. The diff --git a/docs/roadmap.md b/docs/roadmap.md index 3ddf3459a4..99e740189c 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -196,7 +196,7 @@ Gujarati interface follow-up (2026-11-14): the catalog and zero/one plural rule | M10 | Brushes, symbols, patterns, Repeat | 🟡 pattern swatches (5 tile types, Pattern Options, editing mode, SVG ``/PDF export) and live Repeat (radial/grid/mirror) done; interactive selected mirror axis implemented (focused and native checks passed; full CI blocked by an unrelated text test); symbol libraries done (Window › Symbol Libraries, six generated libraries (Basic Shapes, UI Frames, Map Markers, Inventory Icons, Skill Icons, Weather Icons), User Defined, Other Library…, Save Symbols); brush libraries done (Window › Brush Libraries, fifteen generated libraries including Tech Circuit, Decorative, Engraving, Arrows, Stipple, Pressure Sensitive, Ink and Wash, Bristle Brushes and Dry Media, User Defined, Other Library…, Save Brushes); symbol editing shows draggable 9-slice guides (#5280), with guides outside the artwork still unsupported; brushes/symbols in progress | 23–37 | | M11 | Artboards & views (selected-set deletion shared by Artboards menu, trash and Properties, retaining artboard 1 when all are selected; Artboard deletion keys keep the first of an all-selected set and protect artwork; history prunes invalid indices while preserving valid multiselection (history tests and full workspace CI pass); click-to-fit objects with the Artboard tool (#1227), artboard escape routing and document setup modal handoff done; artboard panel/tool with Move Artwork for X/Y fields and Artboard Options, Trim View (hiding the guides and the grid while it is on, #8363), middle-button pan, print tiling and the status bar's artboard navigator with synchronized Artboard tool selection done; Window › Arrange › Tile and Consolidate All Windows done; multiple windows, presentation polish) (cached canvas reprojection preserves scale during resize, rotation and DPI changes; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) (cached canvas dimensions match the renderer limit before cache-key creation, view construction and worker submission; regression-tested; estimates unchanged); status-bar pointer coordinates follow the active ruler origin and General units | 🟡; Artboard Options shares existing presets and orientation controls and can fit artwork without moving it; artwork fitting includes all drawn document art across artboards and off-board; artwork bounds are cached by active document and revision, and selection uses the shared bounds cache across artboards | 15–25 | | M12 | Advanced color & art (CMYK/ICC, separations, Gradient Mesh, Live Paint, Image Trace, Graphs) | 🟡 Gradient Mesh, Live Paint, Image Trace (junction-returning pieces retain their positioned boundaries; a simpler contour walk with identical output; an edge's sub-pixel shift is the same from either side; notches read only their own piece; collapsed loops keep few segments; large images trace with a warning; Auto Color keeps rare distinct colours; quick presets trace at once and the Image Trace button opens the adjustment controls; Properties reopens them; tiny fitted contours retain islands and holes; Create Strokes: exact crop EDT, Guo–Hall thinning and maximal-disc graph simplification; 15 presets, the 14 documented ones each with an enhanced version; Ignore Color (manual picker and canvas eyedropper from original pixels, no canvas View change, missed pixels keep the pick armed, Preview/Undo retained; #8068), Shapes, Auto Grouping and Gradients options; measured in `image-trace-quality.md`; closed outlines retain their interior after straightening; the Flat Logo mode places edges to a fraction of a pixel, restores sharp corners, snaps lines and circles, and refuses gradients; live trace result bounds and selection highlights exclude the retained bitmap except in source-image views), Recolor Artwork, colour management (ICC, soft proofing, separations preview), Graphs (all 9 tools, Graph Data/Type, group-selected series colours persist through regenerate/save/open) done; Graph Design and Marker designs, Transpose and Switch x/y, `\|` label line breaks, the pie options, drop shadows, the legend across the top, overlapping widths, First Row/Column in Front, filled lines, kept label formatting and the Graph Data worksheet done; graph Column designs pending; Vector Halftone Preview keeps the selection box without drawing dot selection marks (#6369); Live Paint Bucket fills faces crossed in one drag (#6373) | 6–10 | -| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; scripts have `app`, the open documents, new documents, each document's selection and its page items; the rest of the script document model (layers, artboards, paths, type and the other classes) and batch work remain | 18–27 | +| M13 | Automation (Actions ✅ record/playback, persisted; variables, scripting, batch) | 🟡 MCP `add_text` exposes existing vertical point, area and path type; `script.run` and File › Scripts › Other Script… run JavaScript files, and Window › Script Console shows their output; scripts have `app`, the open documents, new documents, each document's selection and its page items, its text frames, text ranges and their attributes, its character and paragraph styles, and the installed fonts; the rest of the script document model (layers, artboards, paths, stories and threads of type, and the other classes) and batch work remain | 18–27 | | M14 | 1.0 polish (Asset Export tile context menus implemented for G12; preferences, shortcut editor, workspaces, accessibility, packaging for all OSes) (status messages and readouts use stable responsive allocations sized for localized labels and ordinary coordinates; sample widths cached by language/unit/DPI; regression-tested and contributor-confirmed 2026-10-19; estimates unchanged) | 🟡 Icon-strip flyouts resize on their free edges and retain sizes (#5713); interim macOS cursor delivery (#2292) uses existing artwork and host-owned AppKit cursors; headless coverage only, native menu/focus/handback and display validation pending. Dock groups collapse to their tabs by a double-click on a tab (UI.8); Preferences › General › Constrain Angle acts for the arrow keys, Shift drags and new objects (#394, 2026-10-21); numeric-field pointer selection and focus regression-tested (#1326; a release more than 1 pt from the press keeps the caret, a tap within 1 pt selects all, #6659); RPM runtime capabilities and glibc floor checked (#1275; real-distro install/start-up pending), Eyedropper cursor with precise-setting checks (#1269), Preferences, shortcut editor (chords with Shift and a punctuation key fire as typed; other apps' text shortcut sets imported), workspaces (each keeps its layout changes until Reset , UI.7), Window › Help Bar shown or hidden apart from the status bar and kept in saved workspaces, panels docked by dragging into any dock group (as tabs or a top/bottom split) or into the icon column, and closed from a dock tab's context menu (UI.6), a custom title bar on Windows/Linux with a Home button, content-sized dialogs, menus that scroll when longer than the window and macOS native menu dismissal done (M14.8), and native macOS save sheets with a Format menu (#866); titled PDF exports set `DisplayDocTitle` for viewers and accessibility checkers (#3646) and give the document language as the catalog's `/Lang` (#3644); accessibility and broader Windows/Linux packaging/QA pending; floating tab groups collapse into the side icon rail and opened rail panels fold back into it (#5925, in part), with pointer and native-window regression coverage; estimates unchanged; numeric spinner arrows keep repeating while held with the mouse (#6307); Swatches item context menus tested in all five views and rendered layouts inspected; Linux full CI passed, Windows engine baseline limitations documented (G12); Graphic Styles item context menus in thumbnail and list views with Options, Duplicate, Delete, Redefine, Break Link (#8755); Appearance panel row context menus for strokes, fills, effects, and root object row (Duplicate, Delete, Hide/Show, Edit Effect…, Clear Appearance, Reduce to Basic Appearance) with secondary click row selection (#8809); Character Styles and Paragraph Styles item context menus (panels::text_styles::tests::right_click_context_menu_*); Window > Toolbars > Compact Tools offers optional denser main Tools spacing in one or two columns, with the existing layout still the default (#7234) | 18–28 | | — | Interaction fidelity pass (every tool's modifiers, Properties panel per context, isolation, nuance; width-point creation and adjoining adjustment regression-tested; dialog layout reviewed) | ⬜ (new ruler-guide Alt orientation implemented; existing-guide Escape cancellation regression-tested; broader pass remains) | 60–90 | | — | Hardening at scale (big-file corpus, fuzzing, cross-platform + browser QA) | 🟡 PngSuite integrity and bounded fetching verified (#1729); real-world corpus/manual QA remain | 50–80 |