lutaml-xsd 1.1.14 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/CLAUDE.md +4 -1
  4. data/Gemfile.lock +327 -0
  5. data/Rakefile +78 -1
  6. data/TODO.VISION.md +123 -0
  7. data/TODO.cleanup.md +43 -0
  8. data/TODO.conformance.md +99 -0
  9. data/TODO.docs-spa.md +46 -0
  10. data/TODO.interop.md +52 -0
  11. data/TODO.performance.md +80 -0
  12. data/TODO.som.md +47 -0
  13. data/benchmark/engines.rb +77 -0
  14. data/docs/CONFORMANCE.adoc +43 -0
  15. data/docs/JSON_SCHEMA.adoc +42 -0
  16. data/docs/superpowers/specs/2026-10-21-rule-engine-wiring-design.md +84 -0
  17. data/lib/lutaml/xsd/conformance/runner.rb +169 -0
  18. data/lib/lutaml/xsd/json_schema_exporter.rb +240 -0
  19. data/lib/lutaml/xsd/spa/schema_serializer.rb +3 -1
  20. data/lib/lutaml/xsd/validation/rule_engine.rb +36 -18
  21. data/lib/lutaml/xsd/validation/rule_registry.rb +34 -0
  22. data/lib/lutaml/xsd/validation/rules/attribute_validation_rule.rb +126 -17
  23. data/lib/lutaml/xsd/validation/rules/content_model_validation_rule.rb +301 -220
  24. data/lib/lutaml/xsd/validation/rules/element_structure_rule.rb +25 -15
  25. data/lib/lutaml/xsd/validation/rules/identity_constraints_rule.rb +134 -0
  26. data/lib/lutaml/xsd/validation/rules/occurrence_validation_rule.rb +76 -25
  27. data/lib/lutaml/xsd/validation/rules/type_validation_rule.rb +91 -12
  28. data/lib/lutaml/xsd/validation/schema_definition_resolver.rb +254 -0
  29. data/lib/lutaml/xsd/validation/validation_job.rb +44 -0
  30. data/lib/lutaml/xsd/validation/validation_rule.rb +44 -5
  31. data/lib/lutaml/xsd/validation/validator.rb +1 -1
  32. data/lib/lutaml/xsd/validation/xml_element.rb +2 -2
  33. data/lib/lutaml/xsd/version.rb +1 -1
  34. data/lib/lutaml/xsd.rb +14 -0
  35. data/lutaml-xsd.gemspec +1 -1
  36. metadata +20 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21bd244759a8ce45c8db399f8d7120a9f409697dd7f64df80147e798985a1121
4
- data.tar.gz: 7756f8cb8a0d0b859f6c379e01cb68bbb9df388c195cb65811b99c2ccfa19d85
3
+ metadata.gz: 735a8e1b0b021976b9a2030dc9835c262bb5db7aa8774e20849a237b7f413d7a
4
+ data.tar.gz: e0500a64f394396c1d5d02f2725eaaccfe4d14de51a1d18a0cb39078dc3f58c4
5
5
  SHA512:
6
- metadata.gz: 92056e17ec61f055a6c91a982f15edb0711f8531110179dbf506b07ab2be6602319b6155deb953fbc0adb05cb8c69f9f7405ecd5ede02dd42e85c122d2d0b002
7
- data.tar.gz: 8aa8be2f750b0e566318a8ff68be30a781bd13f6b8748892d52f5e6274be88bc715a69677b9d20090ff08ee4bb73a36aa6c5f486dc48e681c03d4058a6c28857
6
+ metadata.gz: 3559756dd36b8f19dfd056b2b352105a52958619748908da606611409d08da2db06ff55a7622c702c928a241c7c984271e8ed93f827902c6abea005d98fe33eb
7
+ data.tar.gz: 69187d54a64c4e15115461ae932c13136bf28fbe2871ef277f9eaf1afcc2602381c923c82b104fac3c74d5cb94172368ec414d4b33e7a3a244e1cc98a6f45fd7
data/.gitignore CHANGED
@@ -9,7 +9,6 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
- Gemfile*.lock
13
12
 
14
13
  # Jekyll build artifacts
15
14
  docs/_site/
data/CLAUDE.md CHANGED
@@ -20,7 +20,10 @@ bundle exec rspec spec/lutaml/liquid_spec.rb # Run liquid methods tests
20
20
  ## Architecture
21
21
 
22
22
  ### Entry Point
23
- `lib/lutaml/xsd.rb` - Main module with `Lutaml::Xsd.parse(xsd, location:)` method for parsing XSD content.
23
+ `lib/lutaml/xsd.rb` loads the stack. The public parse entry (provided by
24
+ lutaml-model's `Lutaml::Xml::Schema::Xsd`) is
25
+ `Lutaml::Xml::Schema::Xsd.parse(xsd, location:)`, returning a `Schema`.
26
+ Model extensions live in `lib/lutaml/xsd/xsd_model_extensions.rb`.
24
27
 
25
28
  ### Base Class
26
29
  `lib/lutaml/xsd/base.rb` - `Lutaml::Xsd::Base` extends `Lutaml::Model::Serializable`. All XSD element classes inherit from it. Provides:
data/Gemfile.lock ADDED
@@ -0,0 +1,327 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ lutaml-xsd (1.1.14)
5
+ liquid (>= 4.0, < 6.0)
6
+ lutaml-model (~> 0.8.114)
7
+ lutaml-store (~> 0.3)
8
+ moxml (~> 0.5.147)
9
+ paint (~> 2.3)
10
+ rng (~> 0.3.9)
11
+ rubyzip (~> 3.4)
12
+ table_tennis (~> 0.0.7)
13
+ thor (~> 1.0)
14
+ tty-prompt (~> 0.23)
15
+ xsdvi
16
+
17
+ GEM
18
+ remote: https://rubygems.org/
19
+ specs:
20
+ ast (2.4.3)
21
+ base64 (0.3.0)
22
+ bigdecimal (4.1.3)
23
+ canon (0.3.107)
24
+ diff-lcs
25
+ json
26
+ leptris (~> 1.9.376)
27
+ moxml (~> 0.5.149)
28
+ paint
29
+ rainbow
30
+ table_tennis
31
+ thor (~> 1.4)
32
+ unicode-name
33
+ yeptris (~> 0.6.32)
34
+ concurrent-ruby (1.3.8)
35
+ csv (3.3.6)
36
+ diff-lcs (1.6.2)
37
+ ffi (1.17.4-aarch64-linux-gnu)
38
+ ffi (1.17.4-aarch64-linux-musl)
39
+ ffi (1.17.4-arm-linux-gnu)
40
+ ffi (1.17.4-arm-linux-musl)
41
+ ffi (1.17.4-arm64-darwin)
42
+ ffi (1.17.4-x64-mingw-ucrt)
43
+ ffi (1.17.4-x86_64-darwin)
44
+ ffi (1.17.4-x86_64-linux-gnu)
45
+ ffi (1.17.4-x86_64-linux-musl)
46
+ fiddle (1.1.8)
47
+ json (3.1.0)
48
+ language_server-protocol (3.17.0.6)
49
+ leptris (1.9.379.0-aarch64-linux)
50
+ ffi (~> 1.15)
51
+ leptris (1.9.379.0-aarch64-linux-musl)
52
+ ffi (~> 1.15)
53
+ leptris (1.9.379.0-arm-linux)
54
+ ffi (~> 1.15)
55
+ leptris (1.9.379.0-arm-linux-musl)
56
+ ffi (~> 1.15)
57
+ leptris (1.9.379.0-arm64-darwin)
58
+ ffi (~> 1.15)
59
+ leptris (1.9.379.0-x64-mingw-ucrt)
60
+ ffi (~> 1.15)
61
+ leptris (1.9.379.0-x86_64-darwin)
62
+ ffi (~> 1.15)
63
+ leptris (1.9.379.0-x86_64-linux)
64
+ ffi (~> 1.15)
65
+ leptris (1.9.379.0-x86_64-linux-musl)
66
+ ffi (~> 1.15)
67
+ lint_roller (1.1.0)
68
+ liquid (5.14.0)
69
+ bigdecimal
70
+ strscan (>= 3.1.1)
71
+ lutaml-model (0.8.119)
72
+ base64 (>= 0.1.1)
73
+ bigdecimal
74
+ canon
75
+ concurrent-ruby
76
+ liquid (>= 4.0, < 6.0)
77
+ moxml (~> 0.5.139)
78
+ ostruct
79
+ rubyzip (~> 3.7)
80
+ thor (~> 1.4)
81
+ lutaml-store (0.3.2)
82
+ lutaml-model (~> 0.8.15)
83
+ rubyzip (>= 2.3, < 4)
84
+ memo_wise (1.13.0)
85
+ moxml (0.5.150)
86
+ nokogiri (1.19.4-aarch64-linux-gnu)
87
+ racc (~> 1.4)
88
+ nokogiri (1.19.4-aarch64-linux-musl)
89
+ racc (~> 1.4)
90
+ nokogiri (1.19.4-arm-linux-gnu)
91
+ racc (~> 1.4)
92
+ nokogiri (1.19.4-arm-linux-musl)
93
+ racc (~> 1.4)
94
+ nokogiri (1.19.4-arm64-darwin)
95
+ racc (~> 1.4)
96
+ nokogiri (1.19.4-x64-mingw-ucrt)
97
+ racc (~> 1.4)
98
+ nokogiri (1.19.4-x86_64-darwin)
99
+ racc (~> 1.4)
100
+ nokogiri (1.19.4-x86_64-linux-gnu)
101
+ racc (~> 1.4)
102
+ nokogiri (1.19.4-x86_64-linux-musl)
103
+ racc (~> 1.4)
104
+ ostruct (0.6.3)
105
+ paint (2.3.0)
106
+ parallel (2.3.0)
107
+ parser (3.3.12.0)
108
+ ast (~> 2.4.1)
109
+ racc
110
+ parslet (2.0.0)
111
+ pastel (0.8.0)
112
+ tty-color (~> 0.5)
113
+ prism (1.9.0)
114
+ racc (1.8.1)
115
+ rainbow (3.1.1)
116
+ rake (13.4.2)
117
+ regexp_parser (2.13.1)
118
+ rexml (3.4.4)
119
+ rng (0.3.9)
120
+ lutaml-model (~> 0.8.114)
121
+ moxml
122
+ parslet
123
+ thor
124
+ rspec (3.13.2)
125
+ rspec-core (~> 3.13.0)
126
+ rspec-expectations (~> 3.13.0)
127
+ rspec-mocks (~> 3.13.0)
128
+ rspec-core (3.13.6)
129
+ rspec-support (~> 3.13.0)
130
+ rspec-expectations (3.13.5)
131
+ diff-lcs (>= 1.2.0, < 2.0)
132
+ rspec-support (~> 3.13.0)
133
+ rspec-mocks (3.13.8)
134
+ diff-lcs (>= 1.2.0, < 2.0)
135
+ rspec-support (~> 3.13.0)
136
+ rspec-support (3.13.7)
137
+ rubocop (1.92.0)
138
+ json (>= 2.3)
139
+ language_server-protocol (~> 3.17.0.2)
140
+ lint_roller (~> 1.1.0)
141
+ parallel (>= 1.10)
142
+ parser (>= 3.3.0.2)
143
+ rainbow (>= 2.2.2, < 4.0)
144
+ regexp_parser (>= 2.11.3, < 3.0)
145
+ rubocop-ast (>= 1.49.0, < 2.0)
146
+ ruby-progressbar (~> 1.7)
147
+ unicode-display_width (>= 2.4.0, < 4.0)
148
+ rubocop-ast (1.50.0)
149
+ parser (>= 3.3.7.2)
150
+ prism (~> 1.7)
151
+ rubocop-performance (1.27.0)
152
+ lint_roller (~> 1.1)
153
+ rubocop (>= 1.89.0, < 2.0)
154
+ rubocop-ast (>= 1.47.1, < 2.0)
155
+ ruby-progressbar (1.13.0)
156
+ rubyzip (3.7.0)
157
+ strscan (3.1.8)
158
+ table_tennis (0.0.7)
159
+ csv (~> 3.3)
160
+ ffi (~> 1.17)
161
+ memo_wise (~> 1.11)
162
+ paint (~> 2.3)
163
+ unicode-display_width (~> 3.1)
164
+ thor (1.5.0)
165
+ tty-color (0.6.0)
166
+ tty-cursor (0.7.1)
167
+ tty-prompt (0.23.1)
168
+ pastel (~> 0.8)
169
+ tty-reader (~> 0.8)
170
+ tty-reader (0.9.0)
171
+ tty-cursor (~> 0.7)
172
+ tty-screen (~> 0.8)
173
+ wisper (~> 2.0)
174
+ tty-screen (0.8.2)
175
+ unicode-display_width (3.3.0)
176
+ unicode-emoji (~> 4.3)
177
+ unicode-emoji (4.3.0)
178
+ unicode-name (1.15.1)
179
+ unicode-types (~> 1.12)
180
+ unicode-types (1.12.0)
181
+ wisper (2.0.1)
182
+ xsdvi (1.0.2)
183
+ nokogiri (~> 1.16)
184
+ thor (~> 1.3)
185
+ yeptris (0.6.34.3-aarch64-linux)
186
+ ffi (~> 1.15)
187
+ yeptris (0.6.34.3-aarch64-linux-musl)
188
+ ffi (~> 1.15)
189
+ yeptris (0.6.34.3-arm-linux-eabihf)
190
+ ffi (~> 1.15)
191
+ yeptris (0.6.34.3-arm-linux-musleabihf)
192
+ ffi (~> 1.15)
193
+ yeptris (0.6.34.3-arm64-darwin)
194
+ ffi (~> 1.15)
195
+ yeptris (0.6.34.3-x64-mingw-ucrt)
196
+ ffi (~> 1.15)
197
+ yeptris (0.6.34.3-x86_64-darwin)
198
+ ffi (~> 1.15)
199
+ yeptris (0.6.34.3-x86_64-linux)
200
+ ffi (~> 1.15)
201
+ yeptris (0.6.34.3-x86_64-linux-musl)
202
+ ffi (~> 1.15)
203
+
204
+ PLATFORMS
205
+ aarch64-linux
206
+ aarch64-linux-gnu
207
+ aarch64-linux-musl
208
+ arm-linux
209
+ arm-linux-eabihf
210
+ arm-linux-gnu
211
+ arm-linux-musl
212
+ arm-linux-musleabihf
213
+ arm64-darwin
214
+ x64-mingw-ucrt
215
+ x86_64-darwin
216
+ x86_64-linux
217
+ x86_64-linux-gnu
218
+ x86_64-linux-musl
219
+
220
+ DEPENDENCIES
221
+ base64
222
+ canon
223
+ fiddle
224
+ leptris
225
+ liquid
226
+ lutaml-xsd!
227
+ rake
228
+ rexml
229
+ rspec
230
+ rubocop
231
+ rubocop-performance
232
+
233
+ CHECKSUMS
234
+ ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
235
+ base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
236
+ bigdecimal (4.1.3) sha256=61ebe1e5e559bdc3cc6f2c0ee7f427321fc838f59611c294356eb04d6e21cf66
237
+ bundler (4.0.23) sha256=407ba8a1d928f412847f819aa5f8b6aef7c59fb51feb517112af8a165487287b
238
+ canon (0.3.107) sha256=0dfac533189cf2a551423139529a17a7472f2cbc357954df3f59f7c0dddd3bfd
239
+ concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1
240
+ csv (3.3.6) sha256=aba61e7e507a66f03d45cb1f3c4b6359861c3504038b422962875dce099e4456
241
+ diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
242
+ ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df
243
+ ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39
244
+ ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564
245
+ ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95
246
+ ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b
247
+ ffi (1.17.4-x64-mingw-ucrt) sha256=f6ff9618cfccc494138bddade27aa06c74c6c7bc367a1ea1103d80c2fcb9ed35
248
+ ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496
249
+ ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d
250
+ ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e
251
+ fiddle (1.1.8) sha256=7fa8ee3627271497f3add5503acdbc3f40b32f610fc1cf49634f083ef3f32eee
252
+ json (3.1.0) sha256=3ce7ccf8fde58960177a3a756c31f292a4c1e1dedee884547096a5b0604e3bd8
253
+ language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
254
+ leptris (1.9.379.0-aarch64-linux) sha256=5905ebe2cf37de03f0f3849f9464426a68c589f67ef9fd1a1b6ec593802c4e04
255
+ leptris (1.9.379.0-aarch64-linux-musl) sha256=414936329f97b5f0b779de33f87eb37bbede53368c0531bcdf6dd66459215d52
256
+ leptris (1.9.379.0-arm-linux) sha256=c528b0ff5232952768ed313339422ea05ee131650b70121865a97204c99e8f8e
257
+ leptris (1.9.379.0-arm-linux-musl) sha256=b2e1ead4323574d76bb061669cd993b10c6115f1e2c2dbc0f68ce1c13fd02ce2
258
+ leptris (1.9.379.0-arm64-darwin) sha256=b5f492c8a72b1403a4438f491d7de005afc6c89a53044695db756f5e5b4e6eea
259
+ leptris (1.9.379.0-x64-mingw-ucrt) sha256=d529b2f57df8f64ef43ae1430a429d850109427dc3a21725165bbe0f1f3c7c13
260
+ leptris (1.9.379.0-x86_64-darwin) sha256=0056b0a40ac049cbe3cc4b3612724a0cef9ae562b9bd8ea533d59c1d4ad42b23
261
+ leptris (1.9.379.0-x86_64-linux) sha256=76a20acff1b682ee32f73b2f39c2ee05b1ea312eb372c2b89b0c5f80afd35b6a
262
+ leptris (1.9.379.0-x86_64-linux-musl) sha256=96f44ba6601fd8f921b4728027a461291e5b869f13784917451c9045ef9d2b80
263
+ lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
264
+ liquid (5.14.0) sha256=e1020c2b2ee58c7a4d3bfdc7a331537bd27a783353748bff0bf27c6ac0c17065
265
+ lutaml-model (0.8.119) sha256=e638b18536cd5a042df8e98e9d16893ee801461115e9398039887f7e0c616443
266
+ lutaml-store (0.3.2) sha256=9c455dbab32b4c635c48a27213f6f56fda191731c4574eb6187184ba0588a672
267
+ lutaml-xsd (1.1.14)
268
+ memo_wise (1.13.0) sha256=30220c38c4cef410849bc73553c58664dc2c91c6379e4a1df22aea02358b716b
269
+ moxml (0.5.150) sha256=78b9f0950a1e64c3b223ebcf31f311f756181036260798e9877509a6b78f6088
270
+ nokogiri (1.19.4-aarch64-linux-gnu) sha256=1269fb644a6de405057a53dd5c762b1209b43ca7424f839454d3dbc677c31a8f
271
+ nokogiri (1.19.4-aarch64-linux-musl) sha256=35c65b9ce72b3bb03207bdbe7067915019dc18c1b9b59139684bd6690fdd01af
272
+ nokogiri (1.19.4-arm-linux-gnu) sha256=a301313e38bb065d68239e79734bcd6f56fb6efaacebde29e9abf2a4735340ca
273
+ nokogiri (1.19.4-arm-linux-musl) sha256=588923c101bcfa78869734d247d25b598674323e7f22474fc468f6e5647311eb
274
+ nokogiri (1.19.4-arm64-darwin) sha256=a46db9853286e6597b36ebc6953817d15acf3a299583eb3f89fdc6f91dd63527
275
+ nokogiri (1.19.4-x64-mingw-ucrt) sha256=051da97b8eccfdb5444fed40246a35e10d7298b9efe759b4cd25455ea04c587e
276
+ nokogiri (1.19.4-x86_64-darwin) sha256=7fd17057d3e1f00e9954a74b3cd76595d3d4a5ef233b7ed9599047c204f70551
277
+ nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a
278
+ nokogiri (1.19.4-x86_64-linux-musl) sha256=17dfb7c1fa194ae02fbf7c51a7afc8d278045ab3fdacfd86f91d02d7b274470b
279
+ ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912
280
+ paint (2.3.0) sha256=327d623e4038619d5bd99ae5db07973859cd78400c7f0329eea283cef8e83be5
281
+ parallel (2.3.0) sha256=f75a3e904101ce6a1ccb6b8dc800cbafd42166d83330192438dcf29395167a6f
282
+ parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828
283
+ parslet (2.0.0) sha256=d45130695d39b43d7e6a91f4d2ec66b388a8d822bae38de9b4de9a5fbde1f606
284
+ pastel (0.8.0) sha256=481da9fb7d2f6e6b1a08faf11fa10363172dc40fd47848f096ae21209f805a75
285
+ prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85
286
+ racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
287
+ rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a
288
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
289
+ regexp_parser (2.13.1) sha256=5aedb6b7c35688f51e86eef17a15374dfd287c83f4ca644b2c5f3ec50a33b44b
290
+ rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
291
+ rng (0.3.9) sha256=177bf292ca95916eef16fd27d1a89c7c9beb53e7149983eee7afb3b79e902d79
292
+ rspec (3.13.2) sha256=206284a08ad798e61f86d7ca3e376718d52c0bc944626b2349266f239f820587
293
+ rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d
294
+ rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836
295
+ rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
296
+ rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
297
+ rubocop (1.92.0) sha256=2af68041fb2e70bd9321d0479b49fad07f8008a3d0758c83347b4917128c56e0
298
+ rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
299
+ rubocop-performance (1.27.0) sha256=eeeb1374d062a368ee1c787b70eb0b0cc4b184cb1f8565f424760946146d61ce
300
+ ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
301
+ rubyzip (3.7.0) sha256=65c19294da75297a939006f3516deacc33185fbd721ff1954f7a231db6d3e121
302
+ strscan (3.1.8) sha256=aae2db611a225559f21ffbb71765c9a4e60fd262534a9ea84f4f11c7f32f679e
303
+ table_tennis (0.0.7) sha256=b45b50dc7714e3bea5b31d2ad2b7d6bdc2995fc7a686976017c17424e1094a28
304
+ thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
305
+ tty-color (0.6.0) sha256=6f9c37ca3a4e2367fb2e6d09722762647d6f455c111f05b59f35730eeb24332a
306
+ tty-cursor (0.7.1) sha256=79534185e6a777888d88628b14b6a1fdf5154a603f285f80b1753e1908e0bf48
307
+ tty-prompt (0.23.1) sha256=fcdbce905238993f27eecfdf67597a636bc839d92192f6a0eef22b8166449ec8
308
+ tty-reader (0.9.0) sha256=c62972c985c0b1566f0e56743b6a7882f979d3dc32ff491ed490a076f899c2b1
309
+ tty-screen (0.8.2) sha256=c090652115beae764336c28802d633f204fb84da93c6a968aa5d8e319e819b50
310
+ unicode-display_width (3.3.0) sha256=4b7aa66a4b11db50f6f7e98411215cd0dd10eaecb665d36eec5bcacb3fa0b613
311
+ unicode-emoji (4.3.0) sha256=11c02fa73290378c066bb0562cd4c87d8e1b706fbbe0059ca12746a4244de8ce
312
+ unicode-name (1.15.1) sha256=b8f2e3ca14bc24799f84a4f74d43a3612d02a051700d88bc6ca8e3bd53cda3f6
313
+ unicode-types (1.12.0) sha256=7e26a4352cecc2a50325a3793df834b732581ca9f25c5e29f46f3378934363f6
314
+ wisper (2.0.1) sha256=ce17bc5c3a166f241a2e6613848b025c8146fce2defba505920c1d1f3f88fae6
315
+ xsdvi (1.0.2) sha256=edf56a78f0fa25e4a5791d235ea8740cfb620eafa4abb79442b30160cf7292fc
316
+ yeptris (0.6.34.3-aarch64-linux) sha256=f21cf9e113578bf916ce7146cb62bc98e27909bf9a004315399670453fa69d3a
317
+ yeptris (0.6.34.3-aarch64-linux-musl) sha256=9af54b9b80e4fda224d6b4715db3bd6c8ecc6ab55bb3f487156f4fe9a3c98551
318
+ yeptris (0.6.34.3-arm-linux-eabihf) sha256=5c4403cbdcec942b506a57b33288bbd2c163da8378e2fb515f9cb602ac2b2d10
319
+ yeptris (0.6.34.3-arm-linux-musleabihf) sha256=ab01d25165d62af20ef675ca342a52151fedaf214acf9fb4c15493cd3b425f7a
320
+ yeptris (0.6.34.3-arm64-darwin) sha256=679888f46c24fc5992b42e447d593524d4aad2f3ebb5d6bfde17ee03e0aca5c0
321
+ yeptris (0.6.34.3-x64-mingw-ucrt) sha256=67ee2e21e479e8ac11515bb61cb6ad0c6568c15e8bab727a31457b0ab94975ab
322
+ yeptris (0.6.34.3-x86_64-darwin) sha256=1e888708d24c1565d78f4151a6fd2be97c132cd74f61b00fc373ef00587b0d23
323
+ yeptris (0.6.34.3-x86_64-linux) sha256=e0846723912bc714d2ea6042f0575e6bf58ba420269c51115eebb3a7146945f5
324
+ yeptris (0.6.34.3-x86_64-linux-musl) sha256=fc14c66e5779fa82506e89146bbfd809605eede1f2a16a4eb7a23c5b073d8101
325
+
326
+ BUNDLED WITH
327
+ 4.0.23
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "bundler/gem_tasks"
4
+ require "open3"
4
5
  require "rspec/core/rake_task"
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
@@ -9,7 +10,83 @@ require "rubocop/rake_task"
9
10
 
10
11
  RuboCop::RakeTask.new
11
12
 
12
- task default: %i[spec rubocop]
13
+ namespace :deps do
14
+ desc "Fail when Gemfile.lock resolution drifts from Gemfile/gemspec"
15
+ task :lockfile_check do
16
+ fresh, status = Bundler.with_unbundled_env do
17
+ Open3.capture2("bundle", "lock", "--print")
18
+ end
19
+ unless status.success? && !fresh.empty?
20
+ abort("deps:lockfile_check failed: could not resolve the Gemfile")
21
+ end
22
+ committed = File.exist?("Gemfile.lock") ? File.read("Gemfile.lock") : ""
23
+
24
+ signature = lambda do |text|
25
+ parsed = Bundler::LockfileParser.new(text)
26
+ {
27
+ dependencies: parsed.dependencies.keys.sort,
28
+ # name→version only: platform variant/listing noise differs
29
+ # across environments (and bundler generations) and is not the
30
+ # behavior contract we guard.
31
+ versions: parsed.specs.map do |s|
32
+ "#{s.name} #{s.version}"
33
+ end.uniq.sort,
34
+ }
35
+ end
36
+
37
+ fresh_sig = signature.call(fresh)
38
+ committed_sig = signature.call(committed)
39
+
40
+ if fresh_sig != committed_sig
41
+ deltas = fresh_sig.keys.flat_map do |key|
42
+ (fresh_sig[key] - committed_sig[key]).map { |v| "fresh-only #{key}: #{v}" } +
43
+ (committed_sig[key] - fresh_sig[key]).map { |v| "lock-only #{key}: #{v}" }
44
+ end
45
+ warn <<~MSG
46
+ Gemfile.lock is out of sync with the current Gemfile/gemspec.
47
+ A fresh resolution differs from the committed lockfile — run
48
+ `bundle install` locally and commit the updated Gemfile.lock.
49
+ (Unlocked CI resolutions have shipped silent dependency behavior
50
+ changes before, e.g. rng 0.3.8; the lockfile is the contract.)
51
+ MSG
52
+ deltas.first(20).each { |line| warn " #{line}" }
53
+ abort("deps:lockfile_check failed")
54
+ end
55
+ end
56
+ end
57
+
58
+ task default: %i[deps:lockfile_check spec rubocop]
59
+
60
+ namespace :conformance do
61
+ desc "Run the conformance corpus and write tmp/conformance_report.md"
62
+ task :run do
63
+ require "lutaml/xsd"
64
+ require_relative "lib/lutaml/xsd/conformance/runner"
65
+
66
+ runner = Lutaml::Xsd::Conformance::Runner.new(
67
+ File.join(__dir__, "spec", "conformance", "cases"),
68
+ )
69
+ results = runner.run
70
+ report = runner.report(results)
71
+ puts report
72
+ FileUtils.mkdir_p(File.join(__dir__, "tmp"))
73
+ File.write(File.join(__dir__, "tmp", "conformance_report.md"),
74
+ "# Conformance report\n\n```\n#{report}\n```\n")
75
+ end
76
+ end
77
+
78
+ desc "Run the conformance suite"
79
+ task conformance: "conformance:run"
80
+
81
+ namespace :benchmark do
82
+ desc "Benchmark leptris vs nokogiri through Moxml on a real corpus"
83
+ task :engines do
84
+ %w[leptris nokogiri].each do |adapter|
85
+ puts
86
+ sh({ "ADAPTER" => adapter }, "bundle exec ruby benchmark/engines.rb")
87
+ end
88
+ end
89
+ end
13
90
 
14
91
  # Build the frontend SPA (frontend/dist/)
15
92
  desc "Build frontend SPA assets"
data/TODO.VISION.md ADDED
@@ -0,0 +1,123 @@
1
+ # TODO.VISION — lutaml-xsd: purpose audit and the SOTA thesis
2
+
3
+ Last audited: 2026-10-20.
4
+
5
+ ## The purpose (audit answer)
6
+
7
+ lutaml-xsd exists to make XML Schema corpora **legible, governable, and
8
+ documentable**. Everything in this repository serves one thesis in three
9
+ movements:
10
+
11
+ 1. **Ingest** — any real-world schema corpus becomes a first-class Ruby
12
+ object graph: XSD 1.0/1.1 and RNG/RNC, with imports/includes/redefines,
13
+ chameleon schemas, network-resolved schemaLocation, broken documents —
14
+ normalized into a namespace-managed, packageable (`​.lxr`) repository.
15
+ 2. **Understand** — a complete Schema Object Model plus the tools of
16
+ comprehension: type search, dependency graphs, cross-references,
17
+ coverage analysis, SPA documentation, SVG diagrams. A corpus you can
18
+ *read*, not merely parse.
19
+ 3. **Govern** — instance validation (Ruby rule engine + native engine via
20
+ Moxml::XSD), package conflict detection/resolution, and bridges to other
21
+ model worlds (Liquid/LutaML, JSON Schema). A schema becomes a living
22
+ contract, and its documentation becomes executable.
23
+
24
+ The differentiating claim (no SOTA tool does all three): **schema
25
+ comprehension at corpus scale, wired into a model-driven documentation
26
+ pipeline** (LutaML/Metanorma), on the fastest XML engine available to Ruby
27
+ (moxml → leptris).
28
+
29
+ ## What SOTA means here (the benchmarks we accept)
30
+
31
+ - **Validator conformance**: the W3C XML Schema Test Suite (and the legacy
32
+ Sun/MSV collections) are the canonical benchmark; Xerces-J (1.0) and
33
+ Xerces2/Scala.xml (1.1) are reference implementations. Conformance is a
34
+ NUMBER — pass-rate against that suite. See TODO.conformance.md.
35
+ - **Schema comprehension**: commercial SOTA is Oxygen XML / Altova doc-gen
36
+ (static). Academic SOTA is schema summarization/visualization research.
37
+ We leapfrog both with an *interactive* SPA: live validation playground,
38
+ usage navigation, schema evolution diffs. See TODO.docs-spa.md.
39
+ - **Performance**: leptris (C99 FFI) + moxml Plan/StructPlan materialization
40
+ is already the fastest Ruby XML stack; we must keep it measured
41
+ (benchmarks in-repo) and adopt new engine surfaces as they land.
42
+ See TODO.performance.md.
43
+ - **Object model**: XSOM (Sun) remains the semantic gold standard for a
44
+ schema object model — closure, substitution groups, type unification.
45
+ See TODO.som.md.
46
+ - **Interoperation**: bridges to JSON Schema, LutaML cross-paradigm models
47
+ (EXPRESS/UML), and the RelaxNG bridge (rng gem) round us out.
48
+ See TODO.interop.md.
49
+
50
+ ## Pillar index
51
+
52
+ | Pillar | File | One-line goal |
53
+ |---|---|---|
54
+ | Conformance | TODO.conformance.md | Measured, growing pass-rate on W3C XSD TS |
55
+ | Performance | TODO.performance.md | Fastest, measured, engine-complete |
56
+ | Object model | TODO.som.md | XSOM-parity SOM incl. XSD 1.1 constructs |
57
+ | Comprehension | TODO.docs-spa.md | Interactive, live-validated documentation |
58
+ | Interop | TODO.interop.md | RNG bridge, JSON Schema, LutaML cross-model |
59
+ | Cleanup | TODO.cleanup.md | rng 0.3.8 baseline, rng→moxml, hygiene |
60
+
61
+ Guidance for agents: work pillar by pillar, checkbox by checkbox; every
62
+ item lands through a PR with real-object specs; keep this file's audit
63
+ current as pillars complete.
64
+ ## Status 2026-10-20 — first full execution run
65
+
66
+ Delivered, merged to main:
67
+
68
+ - **Dependencies**: moxml `~> 0.5.147` pin; leptris in the dev bundle;
69
+ full Moxml migration with zero direct Nokogiri in `lib/` (PR #104, #107)
70
+ - **Engine validation**: `EngineContext` + additive `engine_validation`
71
+ phase + lexical/content delegation (PR #107); moxml#410 fixed upstream
72
+ (moxml#411), release-gated for the un-gating step; moxml defect filed
73
+ as moxml#410
74
+ - **Reproducibility**: committed Gemfile.lock with all CI platforms +
75
+ `deps:lockfile_check` guard (PR #109)
76
+ - **Performance**: `benchmark/engines.rb` + `rake benchmark:engines` with
77
+ leptris/nokogiri baselines recorded (PR #110)
78
+ - **Conformance**: corpus (12 classes / 25 checks), Runner, `rake
79
+ conformance`, baseline 80.0% both modes, gap register (PR #111)
80
+ - **Ecosystem**: rng gem include-merge fixes (rng#34) and the rng gem's
81
+ Moxml migration (rng#35); `Lutaml::Xsd.parse` restored as the documented
82
+ public entry; XML_SCHEMA exporter (this PR)
83
+
84
+ Release-gated / owner decisions outstanding:
85
+
86
+ - moxml release containing #411 (version owner-stated) → un-gate the
87
+ content-seam specs
88
+ - rng release containing include fixes + Moxml migration (version
89
+ owner-stated) → recalibrate `RngToXsdConverter` expectations against the
90
+ full-include corpus and bump the lutaml-xsd pin
91
+ - A new lutaml-xsd release is the owner's call
92
+
93
+ Deferred with reasons: see TODO.som.md (XSOM-parity work needs a spec
94
+ design cycle), TODO.docs-spa.md (frontend dev loop), TODO.interop.md
95
+ (LutaML cross-model contract), TODO.conformance.md rule-depth items
96
+ (subsumed by rule-registry wiring, which is the headline rule-engine gap).
97
+
98
+ ## Status 2026-10-21 — rule engine wired, conformance up
99
+
100
+ - Rule engine wired into production (`RuleRegistry.default`, element-scoped
101
+ dispatch, declaration resolver): pipeline conformance moved from an
102
+ inert copy of engine mode to **34/39 (87.2%)**, ahead of engine mode's
103
+ 33/39 (84.6%) — the root-declaration check catches wrong-namespace
104
+ roots the engine skips, and substitution groups, nested sequences,
105
+ union/list, derivation and attribute typing now validate through rules
106
+ with zero false positives.
107
+ - moxml 0.5.149 locked: `Schema#content_valid?` live on leptris; the
108
+ engine content-seam specs run un-gated.
109
+ - Conformance corpus grew 12 → 19 cases (39 checks).
110
+ - moxml Builder DSL profile delivered to the moxml perf workstream
111
+ (leptris face ~8x the nokogiri adapter through the same DSL; direct
112
+ binding builder 65x faster than the current face path).
113
+ - CLI JSON validation (`lutaml-xsd xml validate ... --format json`) now
114
+ reports undeclared roots instead of silently passing them — the SPA
115
+ playground's backend seam is functionally complete.
116
+
117
+ ## Status 2026-10-21 (later) — rng 0.3.9 recalibration landed
118
+
119
+ - rng 0.3.9 released (include fixes + Moxml migration); lutaml-xsd pins
120
+ `rng ~> 0.3.9` and the converter corpus is re-baselined on the full
121
+ include tree (170/13/203/237/44; sections 7/1/1 — `sections` restored
122
+ via bsi's override). The last release gate is closed; remaining items
123
+ in the pillar files are design/owner decisions.
data/TODO.cleanup.md ADDED
@@ -0,0 +1,43 @@
1
+ # TODO.cleanup — hygiene, debts, and flagged items
2
+
3
+ Goal: zero known debt; every flagged item resolved or explicitly archived.
4
+
5
+ Status 2026-10-20: in-repo hygiene is clean; remaining items are
6
+ release-gated or need owner confirmation.
7
+
8
+ ## In-repo (lutaml-xsd)
9
+
10
+ - [x] Lockfile divergence guard: committed Gemfile.lock with all CI
11
+ platforms + `deps:lockfile_check` in the default rake task (PR #109)
12
+ - [x] `Lutaml::Xsd.parse` restored as the documented public entry point
13
+ (delegates to `Lutaml::Xml::Schema::Xsd.parse`); docs/*.adoc
14
+ references are true again (this PR)
15
+ - [x] `XmlElement#namespace_uri` uses the Moxml namespace API (PR #108)
16
+ - [x] rng 0.3.9 baseline recalibration (2026-10-21): converter expectations
17
+ updated for the full-include corpus (complex types 170, simple types
18
+ 13, elements 203, groups 237, attribute_groups 44; sections
19
+ sequence: 7 choices / 1 group / 1 element — `sections` present via
20
+ bsi's override); gemspec pins `rng ~> 0.3.9` (released with the
21
+ include fixes + Moxml migration)
22
+ - [ ] `lib/lutaml/xsd/schema_query_service.rb.bak` (untracked) — DEFERRED,
23
+ owner confirmation required: archive under `docs/archive/` or delete
24
+ - [ ] Prunable stale worktrees (`/private/tmp/fix/xsd`, `/private/tmp/xsd-main`)
25
+ — DEFERRED, owner to run `git worktree prune` after confirming the
26
+ branches hold nothing needed
27
+ - [ ] Dead-code sweep — DEFERRED, owner confirmation per file (nothing is
28
+ auto-deleted); the first candidate found in this run is
29
+ `RncToRngConverter#add_annotations` in rng (uncalled since 0.3.x)
30
+ - [ ] `Gemfile.lock` divergence guard for other lutaml gems — not needed
31
+ yet; adopt the same pattern when those repos start hitting the
32
+ fresh-resolve class of failure
33
+
34
+ ## Cross-repo (each in its own repo, own PR, house rules)
35
+
36
+ - [x] rng gem → Moxml migration (rng PR #35): converter, validator,
37
+ test-suite parser ported; nokogiri out of the runtime deps
38
+ - [x] moxml#410 follow-through: fixed in moxml PR #411, released as
39
+ moxml 0.5.149; lutaml-xsd locks 0.5.149 and the engine content-seam
40
+ specs now run live (verified 2026-10-21)
41
+ - [ ] lutaml-model `Schema.reset_processed_schemas` global mutable state —
42
+ DEFERRED: file on lutaml-model only if the owner agrees it is worth
43
+ a public API change (per-parse context option)