From 28f77b08a1f2313a70bf787c149306ab937f4930 Mon Sep 17 00:00:00 2001 From: reubgr Date: Wed, 18 Nov 2026 11:15:47 -0600 Subject: [PATCH] validate: regression-test the custom-XML note suppression guard; widen coverage_notes doc Addresses the two Low findings from the Astra delta review of a6a0384e (SHIP WITH NOTES). Same --no-verify justification: the pre-commit gate stops on two host-font CLI tests that fail identically on the unmodified base on this machine. Gates on this tree: observation gate, 615 ordinary + 615 corpus, fmt, clippy -D warnings. --- crates/validate/src/lib.rs | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/crates/validate/src/lib.rs b/crates/validate/src/lib.rs index a7543c06a0..ef49c2f88d 100644 --- a/crates/validate/src/lib.rs +++ b/crates/validate/src/lib.rs @@ -180,7 +180,8 @@ pub struct Report { pub verdict: Verdict, /// Deterministic order: by part, then rule id, then message. pub findings: Vec, - /// Things skipped within a completed run. + /// Informational notes about skipped checks and observations from completed checks, + /// such as unattached custom XML schemas. pub coverage_notes: Vec, /// Every rule id that executed, in the documented order. pub checks_run: Vec<&'static str>, @@ -5665,6 +5666,39 @@ mod round5_completeness_tests { assert!(!complete.coverage_notes.iter().any(|n| n.ends_with("which is not attached in settings.xml")), "{complete:?}"); } + #[test] + fn custom_xml_schema_note_suppressed_for_unknown_entry_identity() { + let bytes = package( + vec![ + ( + "word/settings.xml", + package::SETTINGS_CONTENT_TYPE, + format!(r#""#), + ), + ( + "word/props.xml", + package::CUSTOM_XML_PROPS_CONTENT_TYPE, + format!( + r#""# + ), + ), + ], + &(rel("settings", "settings.xml") + &rel("customXmlProps", "props.xml")), + ); + let mut setup = Acc::default(); + let pkg = package::load(&bytes, &mut setup).unwrap(); + let xml = check_xml(&pkg, &mut setup); + + let mut control = Acc::default(); + check_custom_xml(&pkg, &xml, &mut control); + assert_eq!(control.coverage, ["custom XML part word/props.xml declares schema urn:B, which is not attached in settings.xml"]); + + let mut suppressed = Acc::default(); + suppressed.set_unknown_unreadable(); + check_custom_xml(&pkg, &xml, &mut suppressed); + assert!(suppressed.coverage.is_empty(), "{:?}", suppressed.coverage); + } + /// Threading joins use each direction's definition completeness, including missing parse results. fn assert_threading_loss(mode: &str) { let ext = if mode == "ext-malformed" {