canon 0.3.127 → 0.3.129

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6b85f7ce86318586f09a582f550e6045638f89fa45f39b13b779cfc460dcbed4
4
- data.tar.gz: 7447ff0c266c542501be52e56dfa7afc868c23e7143893a78b9b322f3751e978
3
+ metadata.gz: 410342286c300a3dbf28366832990f15f3c03dced5e4dec9fa9b93134a5fc9d7
4
+ data.tar.gz: e1e2a27d7cbd7bac0a926900ab2853ac325cc8719cb052a8d301273b655817ba
5
5
  SHA512:
6
- metadata.gz: 5408428461d0606e7c2bd2081e88e05653fe39dbc541e5c9572a51125525f645262428b9f00edb353d3fc4942deec732e015345e40cba8e37224f0953c83845d
7
- data.tar.gz: 89a42a0501c99ec47455f7bd76eb1214514c4710af64a4e470ae5708392c86c97b9a47f7b6dde30ae8106b5202d2c544fe140261018177da923a76f8c0e018af
6
+ metadata.gz: cccdf2b559e2b897121ad50089b0c356440a668bb0541abc90f35e1e4ce7dc87339046956e119f6d029416979af79d4a93669f2cf7650adf54a5b4de0407e3eb
7
+ data.tar.gz: f9d9e79a483429f3bc363600262a36220c632429d2ae536673a042287794d987356499f3fd0e925570b5d821cad8f1c17aa3219ef1cbaa9f9c9e23dd2ebf7d93
data/docs/HANDOFF.adoc CHANGED
@@ -5,27 +5,30 @@ published: false
5
5
 
6
6
  A snapshot of the open arcs across the org repos — what is known, where
7
7
  to dig, and what has already been proven — so any team can pick an issue
8
- up cold. Statuses as of 2026-11-11.
8
+ up cold. Statuses as of 2026-11-25.
9
9
 
10
10
  == State of the world
11
11
 
12
- Shipped since the last board (2026-11-05): leptris
13
- 1.9.408→**1.9.416** (the #1842 perf arcs: XPath union fusion Track C,
14
- parse-loop field hoisting, single-pass attribute scan, the attribute
15
- dup-table rehash fix; all perf slices, no capability moves), yeptris
16
- **0.6.60/0.6.61** (the stream iterator's last-frame slice, the
17
- fuzz-diff classifier pins for the r185-r225 nightly wave), moxml
18
- **0.6.4**, lutaml-model **0.8.173** (the attribute-qualified
19
- doctrine for constructed models #1124 + the multi-namespace
20
- unordered emission gate + the dotx TOC disposition #1140 + the dead
21
- cgi require drop #1152), canon **0.3.125** (floors `leptris ~>
22
- 1.9.412`, `yeptris ~> 0.6.60`, `moxml ~> 0.6.4`; the XML 1.0 §2.11
23
- line-end normalization at the comparison seam — canon#310, the
24
- raw-nokogiri A/B lane fully green). uniword aligned its wire-form
25
- assertions with the doctrine (f3757aa/4ff6d61) and floors
26
- lutaml-model 0.8.169 pending its own next dev bump; #1145's reported
27
- 0.8.170 shapes did not reproduce on uniword@main (no-repro battery
28
- on the issue).
12
+ Shipped since the last board (2026-11-11): lutaml-model
13
+ **0.8.174→0.8.181** (the map_all/element_order leptris adapter parity
14
+ that fixed #1163/#1167/#1172's silent content loss — on 0.8.175 the
15
+ leptris lane dropped map_all content outright — plus #1164's trailing
16
+ map_content run fix: built mixed-content models serialize the whole
17
+ consecutive run, verified on the shipped 0.8.181 gem), canon
18
+ **0.3.126→0.3.128** (floors `leptris ~> 1.9.422`, `yeptris ~>
19
+ 0.6.68`, `moxml ~> 0.6.13`; the XML 1.0 §2.11 line-end normalization
20
+ at the comparison seam — canon#310; the PI-diff display fix #319:
21
+ processing-instruction reasons name the target/data instead of
22
+ "whitespace: 0 chars vs 0 chars", and the detail formatter shows the
23
+ PIs' own serialized forms instead of the parent document). The
24
+ 2026-11-24 cimas sync broke release.yml fleet-wide with a duplicated
25
+ `types: [ do-release ]` key (GitHub rejects the file at parse time —
26
+ canon#320, glossarist/iev#79 fix it; every other program repo audited
27
+ clean). metanorma-ietf#318's batched-DOM-diff premise was disproven:
28
+ the #279 invariant pin holds on moxml 0.6.x — the "phantom" diffs
29
+ were six genuinely reordered <?rfc?> PIs whose order mismatch
30
+ FEATURE_HDR's old serializer fingerprint; expectations aligned in
31
+ metanorma-ietf#388 (blocked only by main's known sourcecode reds).
29
32
 
30
33
  == lutaml/canon
31
34
 
@@ -56,6 +59,23 @@ parent/self/attribute steps operate on the matched nodes themselves,
56
59
  and attribute nodes render per strict C14N law (only when the owner
57
60
  element is in the node-set). The `//`-rooted and `./`-rooted relative
58
61
  forms resolve from the document root, matching the subset context.
62
+
63
+ |canon#318 — batched-comparison state accumulation "regressed" on
64
+ moxml 0.6.x
65
+ |CLOSED (no regression; display fixed in #319)
66
+ |The #279 invariant pin holds on moxml 0.6.x (104/104). The
67
+ metanorma-ietf "phantom" diffs were six genuinely reordered
68
+ document-level <?rfc?> PIs — FEATURE_HDR carried the exact reverse of
69
+ the transformer's PI_ORDER (the old stack's reversed prolog-PI
70
+ serialization fingerprint; old engines compared PI-less trees
71
+ vacuously). Canon's display made them read identical: PI diffs
72
+ reported "whitespace: 0 chars vs 0 chars" and the ambiguous-pair
73
+ fallback rendered the parent document. #319 routes PI pairs through
74
+ their own reason/display (NodeInspector.processing_instruction_*,
75
+ XmlParsing target/data queries — moxml #text is empty for PIs, the
76
+ data rides #content). Release chain: the 2026-11-24 cimas sync left a
77
+ duplicated `types:` key in release.yml (#320) — release dispatches
78
+ parsed-fail until it merged.
59
79
  |===
60
80
 
61
81
  == lutaml/moxml
@@ -163,6 +183,22 @@ If the CBOR face reopens, copy the registry law and its pin wholesale.
163
183
  |===
164
184
  |Item |Status |Known + first moves
165
185
 
186
+ |The metanorma-document mixed-content cluster (#1163/#1164/#1167/#1172)
187
+ |CLOSED (0.8.177-0.8.181)
188
+ |**#1163/#1167/#1172** were fixed by the adapter-parity window (on
189
+ 0.8.175 the leptris lane lost map_all content outright — `<block/>`
190
+ from content-bearing input; 0.8.180 populates element_order and
191
+ map_all_content identically across adapters, byte-identical map_all
192
+ emission; #1167's element+map_all_content root refuses the plan lane,
193
+ a2592647). **#1164** was still live on 0.8.180: `apply_mixed_content`
194
+ interleaves content entries into element-shaped slots, so a trailing
195
+ run of consecutive map_content entries had no slots and dropped
196
+ silently ("First" of ["First","Second"]); fixed in #1196/0.8.181 —
197
+ entries beyond the slots append after the last child; verified on the
198
+ shipped gem. Side finding: running the shared mixed-content examples
199
+ against LeptrisAdapter (never done before) exposes 11 pre-existing
200
+ entity/encoding divergences — its own follow-up issue.
201
+
166
202
  |moxml 0.6 admission
167
203
  |Shipped (0.8.156; line now at 0.8.169)
168
204
  |`>= 0.5.139, < 0.7`; the Opal boot lane pins moxml 0.5.x locally in
@@ -59,9 +59,14 @@ module Canon
59
59
  when :attribute_values
60
60
  build_attribute_values_reason(node1, node2)
61
61
  when :text_content
62
- build_text_difference_reason(
63
- extract_text_content(node1), extract_text_content(node2)
64
- )
62
+ if NodeInspector.processing_instruction_node?(node1) &&
63
+ NodeInspector.processing_instruction_node?(node2)
64
+ build_pi_difference_reason(node1, node2)
65
+ else
66
+ build_text_difference_reason(
67
+ extract_text_content(node1), extract_text_content(node2)
68
+ )
69
+ end
65
70
  when :attribute_order
66
71
  build_attribute_order_reason(node1, node2)
67
72
  when :comments
@@ -191,6 +196,23 @@ module Canon
191
196
  "Text: \"#{visualize_whitespace(text1)}\" vs \"#{visualize_whitespace(text2)}\""
192
197
  end
193
198
 
199
+ # --- Processing instruction reason -------------------------------------
200
+
201
+ # PIs have no text content, so the text-difference reason would
202
+ # report "whitespace: 0 chars vs 0 chars" for genuinely different
203
+ # PIs (canon#318). The serialized form carries target and data.
204
+ def self.build_pi_difference_reason(node1, node2)
205
+ t1, d1 = NodeInspector.processing_instruction_parts(node1)
206
+ t2, d2 = NodeInspector.processing_instruction_parts(node2)
207
+
208
+ if t1 != t2
209
+ return "Processing instruction target differs: <?#{t1}?> vs <?#{t2}?>"
210
+ end
211
+
212
+ "Processing instruction data differs: " \
213
+ "<?#{t1} #{d1}?> vs <?#{t2} #{d2}?>"
214
+ end
215
+
194
216
  # --- Comment reason ----------------------------------------------------
195
217
 
196
218
  def self.build_comment_difference_reason(node1, node2)
@@ -56,6 +56,25 @@ module Canon
56
56
  end
57
57
  end
58
58
 
59
+ def self.processing_instruction_node?(node)
60
+ return false unless node
61
+ return node.node_type == :processing_instruction if node.is_a?(Canon::Xml::Node)
62
+
63
+ XmlParsing.processing_instruction?(node)
64
+ end
65
+
66
+ # [target, data] of a processing instruction. Canon PI nodes carry
67
+ # them natively; backend PIs expose the target as the node name
68
+ # and the data as the content (moxml #text is empty for PIs).
69
+ def self.processing_instruction_parts(node)
70
+ if node.is_a?(Canon::Xml::Nodes::ProcessingInstructionNode)
71
+ [node.target.to_s, node.data.to_s]
72
+ else
73
+ [XmlParsing.processing_instruction_target(node),
74
+ XmlParsing.processing_instruction_data(node)]
75
+ end
76
+ end
77
+
59
78
  def self.document?(node)
60
79
  return node.node_type == :root if node.is_a?(Canon::Xml::Node)
61
80
 
@@ -357,6 +357,15 @@ expand_difference: false)
357
357
  return format_text_content_one_sided(node1, node2, use_color)
358
358
  end
359
359
 
360
+ # Document-level PIs have empty text content; the ambiguous-pair
361
+ # parent fallback below would serialize the document node and
362
+ # render the whole document as the diff payload (canon#318).
363
+ # The PIs' own serialized forms are the informative view.
364
+ if Canon::Comparison::NodeInspector.processing_instruction_node?(node1) &&
365
+ Canon::Comparison::NodeInspector.processing_instruction_node?(node2)
366
+ return format_pi_content_details(node1, node2, use_color)
367
+ end
368
+
360
369
  text1 = NodeUtils.node_to_display(node1, compact: compact)
361
370
  text2 = NodeUtils.node_to_display(node2, compact: compact)
362
371
 
@@ -414,6 +423,26 @@ expand_difference: false)
414
423
  [detail1, detail2, changes]
415
424
  end
416
425
 
426
+ # Processing-instruction content: the PIs' serialized forms
427
+ # (<?target data?>), whitespace-visualised like text content.
428
+ def self.format_pi_content_details(node1, node2, use_color)
429
+ t1, d1 = Canon::Comparison::NodeInspector.processing_instruction_parts(node1)
430
+ t2, d2 = Canon::Comparison::NodeInspector.processing_instruction_parts(node2)
431
+
432
+ detail1 = ColorHelper.colorize(
433
+ TextUtils.visualize_whitespace("<?#{t1} #{d1}?>".rstrip),
434
+ :red, use_color
435
+ )
436
+ detail2 = ColorHelper.colorize(
437
+ TextUtils.visualize_whitespace("<?#{t2} #{d2}?>".rstrip),
438
+ :green, use_color
439
+ )
440
+
441
+ changes = "Content differs: #{detail1} → #{detail2}"
442
+
443
+ [detail1, detail2, changes]
444
+ end
445
+
417
446
  # Whether a node is an element (Canon or Nokogiri), used to
418
447
  # detect element-shaped diffs that have been misclassified as
419
448
  # :text_content and route them to element-structure rendering.
data/lib/canon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Canon
4
- VERSION = "0.3.127"
4
+ VERSION = "0.3.129"
5
5
  end
@@ -176,6 +176,18 @@ module Canon
176
176
  node.is_a?(Moxml::ProcessingInstruction)
177
177
  end
178
178
 
179
+ # The PI target ("rfc" in <?rfc strict="yes"?>) — the node name
180
+ # on every backend (Nokogiri PIs carry no #target accessor).
181
+ def processing_instruction_target(node)
182
+ name(node).to_s
183
+ end
184
+
185
+ # The PI data ('strict="yes"' in <?rfc strict="yes"?>) — the
186
+ # node content on every backend (moxml #text is empty for PIs).
187
+ def processing_instruction_data(node)
188
+ node.content.to_s
189
+ end
190
+
179
191
  def document_fragment?(obj)
180
192
  defined?(Nokogiri) && obj.is_a?(Nokogiri::XML::DocumentFragment)
181
193
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.127
4
+ version: 0.3.129
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-15 00:00:00.000000000 Z
11
+ date: 2026-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 1.9.422
47
+ version: 1.9.445
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 1.9.422
54
+ version: 1.9.445
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: moxml
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.6.13
61
+ version: 0.6.18
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.6.13
68
+ version: 0.6.18
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: paint
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.6.68
145
+ version: 0.6.85
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.6.68
152
+ version: 0.6.85
153
153
  description: |-
154
154
  Canon provides canonicalization and pretty-printing for various serialization
155
155
  formats (XML, HTML, JSON, YAML), producing standardized forms suitable for