fix(schematron): un-shadow Option/Future underlying rules; add underlyings to canonical sample - #23
Merged
Conversation
…yings to sample ISO Schematron fires only the first matching rule per pattern. In asset-validations the derivative-exposure warning rule (OP or FU or FX or SW) claimed every Option and Future, so the two "must have underlying" ERROR rules were dead code (SVRL: svrl:suppressed-rule). Same bug class as the earlier percentage-sum fix. Move them into their own pattern asset-underlying-validations (ruleset now has 11 patterns). The canonical sample had four options/futures without Underlyings, so un-shadowing would have turned "0 errors" into 4. Add an XSD-valid Underlyings/Underlying (Type, Name, Identifiers) to each: Allianz SE and Volkswagen AG (Security/ISIN), EURO STOXX 50 (Index/ISIN), EUR/USD (Currency/OtherID). Regenerate both negative fixtures from the new sample with the sed recipes in tests/fixtures/invalid/README.md; the Schematron fixture still fails with exactly 1 error (percentage sum). Align the Basic XSLT share-class price check with the Schematron bands (OK < 0.01, ROUNDING 0.01-0.1, ERROR >= 0.1); it previously only flagged ERROR from 1.0, contradicting the documented "matching tolerances". Verified: sample XSD-valid; Java Schematron 0 errors / 12 warnings on the sample, 1 error on the fixture, 1 error when an Underlyings block is removed; XSLT DQ report 2x OK; CSV 21 rows, TPT 42 rows, top-holdings 5, data binding 21 positions, DB import/export XSD-valid, Santuario sign/verify/tamper roundtrip unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YXZWhwE5EbHSybt55K6oUZ
This was referenced Aug 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
asset-validationsthe Derivative Exposure warning rule (OP or FU or FX or SW) matched every Option/Future first, so the Option Underlying / Future Underlying ERROR rules never fired (svrl:suppressed-rule) — same shadowing class as the earlier percentage-sum fix. They now live in their own patternasset-underlying-validations(11 patterns total; README updated, "Known ruleset fix" section extended).Mixed-Fund_Positions.xmlhad 4 options/futures withoutUnderlyings, which the bug had masked. Added an XSD-validUnderlyings/Underlyingto each (Allianz SE, Volkswagen AG, EURO STOXX 50 index, EUR/USD currency) so the canonical sample keeps its 0 ERROR / 12 warnings property honestly. Bothtests/fixtures/invalid/*regenerated with the READMEsedrecipes (Schematron fixture still fails with exactly 1 error).Verification (local)
xmllint --schema4.2.9 on sampleUnderlyingsremovedERROR: Option "Call Option on Allianz SE" must have at least one underlying asset, exit 1 ← rule now live🤖 Generated with Claude Code
https://claude.ai/code/session_01YXZWhwE5EbHSybt55K6oUZ