Commit Graph

3 Commits

Author SHA1 Message Date
7a126a9b0a test(schema): enforce streaming-vs-tree agreement as a standing gate
The streaming XSD validator is a separate implementation of the same semantics
as the tree validator (the conformance oracle), and three false positives in
it were found and fixed this cycle (#186, #200, #202) only by adversarial
hunting, because the XSTS gate exercises the tree path, not validate(streaming:).
A snapshot is not an invariant.

Add test_streamingMatchesTreeDifferential to the generative fuzz suite: 2000
deterministic schema/instance pairs (15 on WASI), asserting that streaming and
the tree validator agree on whether each document is valid (so streaming never
rejects a valid document and never accepts an invalid one the tree rejects),
and that the tree's errors are a subset of streaming's (streaming may add
errors on an already-invalid document, #206, but may never miss a real error
or invent a rejection). A failure prints the seed, schema, instance, and both
error sets, so it reproduces exactly.

This runs in the standard suite on all five platforms, so a future streaming
false positive fails CI rather than reaching users.
2026-06-20 19:54:05 +02:00
83e6e27d12 style(format): adopt --importgrouping testable-bottom from canonical rules-swift
Group @testable imports at the bottom, per public/rules-swift's swiftformat. A
behavior-preserving import-ordering reformat across 252 files (mostly tests).
--trailingclosures was deliberately not adopted (cosmetic, and swiftformat flags
it as caution-worthy).
2026-06-18 20:33:07 +02:00
2abc18bbfc test(schema): generative robustness fuzz harness for the schema engine and parser
A reproducible, seeded structure-aware fuzzer (production-readiness stopper 4,
#167). It builds varied XSD schemas and XML instances reaching the crash/hang
-prone shapes (deep nesting, large/unbounded/inverted occurrences, pointless
maxOccurs=0 particles, wildcards, element/group reference cycles, substitution
chains, simpleType restriction cycles, complexContent restrictions, pathological
regex), and asserts the validator never crashes and always terminates. A trap
fails the run; the .timeLimit trait catches a true hang on native (omitted on
WASI, which does not support it; the engine's own caps still bound termination).

This characterizes termination and crash-freedom, not verdict correctness. No
crashes or hangs found over the current corpus (250 schemas + 600 byte streams
natively each run). Counts are a constant, raised for a deeper campaign.
2026-06-15 00:10:14 +02:00