metanorma-ietf 3.7.11 → 3.7.12.pre.alpha.2

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 (171) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +11 -0
  3. data/.html.err.html +118 -0
  4. data/.rspec +0 -1
  5. data/Gemfile +29 -4
  6. data/Gemfile.devel +1 -0
  7. data/TODO.rfc-to-from-conversions/01-fix-reference-anchor-uuid.md +18 -0
  8. data/TODO.rfc-to-from-conversions/02-fix-extract-paragraph-text.md +13 -0
  9. data/TODO.rfc-to-from-conversions/03-fix-duplicate-anchors-roundtrip.md +26 -0
  10. data/TODO.rfc-to-from-conversions/04-fix-li-t-children-roundtrip.md +22 -0
  11. data/TODO.rfc-to-from-conversions/05-write-pipeline1-spec.md +22 -0
  12. data/TODO.rfc-to-from-conversions/06-write-pipeline2-spec.md +27 -0
  13. data/TODO.rfc-to-from-conversions/07-final-verification.md +14 -0
  14. data/TODO.rfc-to-from-conversions/bugreport-metanorma-document-circular-autoload.md +112 -0
  15. data/TODO.transform-bidirectional/01-bidirectional-architecture.md +86 -0
  16. data/TODO.transform-bidirectional/02-encapsulate-lutaml-model-private-api.md +109 -0
  17. data/TODO.transform-bidirectional/03-eliminate-xml-string-manipulation.md +101 -0
  18. data/TODO.transform-bidirectional/04-replace-null-objects.md +86 -0
  19. data/TODO.transform-bidirectional/05-remove-nokogiri-from-validation.md +58 -0
  20. data/TODO.transform-bidirectional/06-reverse-transformer-metadata.md +50 -0
  21. data/TODO.transform-bidirectional/07-reverse-transformer-front.md +59 -0
  22. data/TODO.transform-bidirectional/08-reverse-transformer-sections.md +89 -0
  23. data/TODO.transform-bidirectional/09-reverse-transformer-references.md +37 -0
  24. data/TODO.transform-bidirectional/10-reverse-transformer-terms.md +24 -0
  25. data/TODO.transform-bidirectional/11-reverse-transformer-cleanup.md +22 -0
  26. data/TODO.transform-bidirectional/12-spec-coverage.md +48 -0
  27. data/TODO.transform-bidirectional/13-refactor-forward-transformer.md +50 -0
  28. data/TODO.transform-bidirectional/14-round-trip-fidelity.md +53 -0
  29. data/TODO.transform-bidirectional/README.md +23 -0
  30. data/docs/architecture.adoc +506 -0
  31. data/docs/discrepancy-log.adoc +124 -0
  32. data/docs/keiko-census-pretriage.md +37 -0
  33. data/docs/qa-plan.adoc +1616 -0
  34. data/docs/truthy-collection-audit.md +32 -0
  35. data/docs/ws5b/README.md +21 -0
  36. data/docs/ws5b/audit/a1-front.md +130 -0
  37. data/docs/ws5b/audit/a2-blocks.md +77 -0
  38. data/docs/ws5b/audit/a3-inline.md +145 -0
  39. data/docs/ws5b/audit/a4-lists-tables.md +65 -0
  40. data/docs/ws5b/audit/a5-references.md +67 -0
  41. data/docs/ws5b/audit/a6-sections-terms.md +77 -0
  42. data/docs/ws5b/audit/a7-entry-validation.md +74 -0
  43. data/docs/ws5b/consolidated.md +107 -0
  44. data/docs/ws5b/odo-report-ws5b.md +47 -0
  45. data/docs/ws5b/tickets/00-tracking.md +34 -0
  46. data/docs/ws5b/tickets/03-inline-flattening.md +23 -0
  47. data/docs/ws5b/tickets/04-footnotes.md +18 -0
  48. data/docs/ws5b/tickets/05-list-items.md +17 -0
  49. data/docs/ws5b/tickets/06-tables.md +14 -0
  50. data/docs/ws5b/tickets/07-figures-images.md +18 -0
  51. data/docs/ws5b/tickets/08-containers.md +19 -0
  52. data/docs/ws5b/tickets/09-front-matter.md +25 -0
  53. data/docs/ws5b/tickets/10-sections-root-attrs.md +23 -0
  54. data/docs/ws5b/tickets/11-terms.md +21 -0
  55. data/docs/ws5b/tickets/12-references.md +22 -0
  56. data/docs/ws5b/tickets/13-pipeline-robustness.md +19 -0
  57. data/docs/ws5b/tickets/WITHDRAWN-01-cref-stub.md +28 -0
  58. data/docs/ws5b/tickets/WITHDRAWN-02-passthrough.md +28 -0
  59. data/docs/ws5b/verdicts/verdicts-v1-blocks.md +21 -0
  60. data/docs/ws5b/verdicts/verdicts-v2-inline.md +12 -0
  61. data/docs/ws5b/verdicts/verdicts-v3-lists.md +12 -0
  62. data/docs/ws5b/verdicts/verdicts-v4-front.md +12 -0
  63. data/docs/ws5b/verdicts/verdicts-v5-pipeline.md +9 -0
  64. data/docs/ws5c/c1-grammar-vs-model.md +19 -0
  65. data/docs/ws5c/c2-model-vs-transformer.md +21 -0
  66. data/docs/ws5c/c3-transformer-vs-v3.md +15 -0
  67. data/docs/ws5c/model_coverage_exhaustiveness_spec.rb +171 -0
  68. data/docs/ws5c/odo-report-ws5c.md +32 -0
  69. data/docs/ws5c/probe-verdicts.md +10 -0
  70. data/docs/ws5c/synthesis.md +40 -0
  71. data/docs/ws5c/tickets/14-pseudocode-dead-guard.md +22 -0
  72. data/docs/ws5c/tickets/15-erefstack.md +18 -0
  73. data/docs/ws5c/tickets/16-artwork-sizing.md +14 -0
  74. data/docs/ws5c/tickets/17-concept-crash.md +30 -0
  75. data/docs/ws5c/tickets/18-metanorma-document-followup.md +19 -0
  76. data/docs/ws5c/tickets/19-park-ws4.md +10 -0
  77. data/docs/ws5c/tickets/20-park-ws7.md +10 -0
  78. data/docs/ws5c/tickets/comment-291.md +13 -0
  79. data/docs/ws5c/tickets/comment-295.md +7 -0
  80. data/docs/ws5c/tickets/comment-300.md +8 -0
  81. data/lib/isodoc/ietf/presentation_xml_convert.rb +95 -0
  82. data/lib/metanorma/ietf/cleanup.rb +2 -8
  83. data/lib/metanorma/ietf/converter.rb +0 -18
  84. data/lib/metanorma/ietf/document/metadata/ietf_bib_data_extension_type.rb +39 -0
  85. data/lib/metanorma/ietf/document/metadata/ietf_bibliographic_item.rb +51 -0
  86. data/lib/metanorma/ietf/document/metadata/ietf_editorial_group.rb +17 -0
  87. data/lib/metanorma/ietf/document/metadata/pi_settings.rb +35 -0
  88. data/lib/metanorma/ietf/document/metadata.rb +16 -0
  89. data/lib/metanorma/ietf/document/root.rb +31 -0
  90. data/lib/metanorma/ietf/document/sections/ietf_annex_section.rb +26 -0
  91. data/lib/metanorma/ietf/document/sections/ietf_clause_section.rb +26 -0
  92. data/lib/metanorma/ietf/document/sections/ietf_content_section.rb +25 -0
  93. data/lib/metanorma/ietf/document/sections/ietf_sections.rb +35 -0
  94. data/lib/metanorma/ietf/document/sections.rb +12 -0
  95. data/lib/metanorma/ietf/document.rb +59 -0
  96. data/lib/metanorma/ietf/html/renderer.rb +79 -0
  97. data/lib/metanorma/ietf/html.rb +14 -0
  98. data/lib/metanorma/ietf/ietf.rng +1 -1
  99. data/lib/metanorma/ietf/processor.rb +50 -5
  100. data/lib/metanorma/ietf/schema/reference_renderer.rb +363 -0
  101. data/lib/metanorma/ietf/{isodoc.rng → standoc.rng} +2 -2
  102. data/lib/metanorma/ietf/themes/ietf/templates/_rfc_cover.html.liquid +25 -0
  103. data/lib/metanorma/ietf/themes/ietf/theme.yaml +45 -0
  104. data/lib/metanorma/ietf/transformer/annotation_transformer.rb +25 -0
  105. data/lib/metanorma/ietf/transformer/base.rb +255 -0
  106. data/lib/metanorma/ietf/transformer/block_transformer.rb +813 -0
  107. data/lib/metanorma/ietf/transformer/cleanup_transformer.rb +505 -0
  108. data/lib/metanorma/ietf/transformer/figure_transformer.rb +310 -0
  109. data/lib/metanorma/ietf/transformer/front_transformer.rb +634 -0
  110. data/lib/metanorma/ietf/transformer/ietf_to_rfc_v3.rb +463 -0
  111. data/lib/metanorma/ietf/transformer/inline_transformer.rb +335 -0
  112. data/lib/metanorma/ietf/transformer/list_transformer.rb +485 -0
  113. data/lib/metanorma/ietf/transformer/metadata_transformer.rb +188 -0
  114. data/lib/metanorma/ietf/transformer/null_objects.rb +40 -0
  115. data/lib/metanorma/ietf/transformer/order_tracker.rb +91 -0
  116. data/lib/metanorma/ietf/transformer/reference_transformer.rb +776 -0
  117. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/annotation_transformer.rb +104 -0
  118. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/block_transformer.rb +86 -0
  119. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/cleanup_transformer.rb +66 -0
  120. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/figure_transformer.rb +82 -0
  121. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/front_transformer.rb +156 -0
  122. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/inline_transformer.rb +231 -0
  123. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/list_transformer.rb +269 -0
  124. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/metadata_transformer.rb +224 -0
  125. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/reference_transformer.rb +279 -0
  126. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/section_transformer.rb +211 -0
  127. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/table_transformer.rb +108 -0
  128. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf/term_transformer.rb +159 -0
  129. data/lib/metanorma/ietf/transformer/rfc_v3_to_ietf.rb +175 -0
  130. data/lib/metanorma/ietf/transformer/section_transformer.rb +605 -0
  131. data/lib/metanorma/ietf/transformer/table_transformer.rb +278 -0
  132. data/lib/metanorma/ietf/transformer/term_transformer.rb +349 -0
  133. data/lib/metanorma/ietf/transformer/validation_transformer.rb +248 -0
  134. data/lib/metanorma/ietf/transformer.rb +313 -0
  135. data/lib/metanorma/ietf/version.rb +1 -1
  136. data/lib/metanorma/ietf.rb +16 -1
  137. data/lib/metanorma-ietf.rb +0 -1
  138. data/metanorma-ietf.gemspec +6 -16
  139. data/test.doc +1109 -0
  140. data/test.html +282 -0
  141. data/test.pdf +0 -0
  142. data/test.pdf.err +1 -0
  143. data/test.presentation.xml +62 -0
  144. data/tools/compare_old_new.rb +141 -0
  145. data/tools/ws5_sweep.rb +87 -0
  146. metadata +157 -185
  147. data/lib/isodoc/ietf/blocks.rb +0 -244
  148. data/lib/isodoc/ietf/cleanup.rb +0 -125
  149. data/lib/isodoc/ietf/cleanup_blocks.rb +0 -211
  150. data/lib/isodoc/ietf/cleanup_inline.rb +0 -92
  151. data/lib/isodoc/ietf/footnotes.rb +0 -74
  152. data/lib/isodoc/ietf/front.rb +0 -250
  153. data/lib/isodoc/ietf/init.rb +0 -21
  154. data/lib/isodoc/ietf/inline.rb +0 -190
  155. data/lib/isodoc/ietf/lists.rb +0 -88
  156. data/lib/isodoc/ietf/metadata.rb +0 -68
  157. data/lib/isodoc/ietf/references.rb +0 -116
  158. data/lib/isodoc/ietf/reqt.rb +0 -36
  159. data/lib/isodoc/ietf/rfc_convert.rb +0 -136
  160. data/lib/isodoc/ietf/section.rb +0 -185
  161. data/lib/isodoc/ietf/table.rb +0 -54
  162. data/lib/isodoc/ietf/terms.rb +0 -152
  163. data/lib/isodoc/ietf/validation.rb +0 -212
  164. data/lib/relaton/render/config.yml +0 -60
  165. data/lib/relaton/render/date.rb +0 -12
  166. data/lib/relaton/render/fields.rb +0 -30
  167. data/lib/relaton/render/general.rb +0 -26
  168. data/lib/relaton/render/parse.rb +0 -205
  169. data/lib/relaton/render/template.rb +0 -29
  170. /data/lib/{isodoc/ietf → metanorma/ietf/schema}/SVG-1.2-RFC.rng +0 -0
  171. /data/lib/{isodoc/ietf → metanorma/ietf/schema}/v3.rng +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16abd3bccb54974e0c04c25e04bb71e79887b728395927a119922170ad13f3d6
4
- data.tar.gz: 79aee453b25eb14b62fc2f7b9842830a07d93f50c8a9b46e731679a1eeaa91f8
3
+ metadata.gz: 36d6ea8e8fab7b3db968d8ee8132b4aa2791f2e848862889e5d2ebc40d8950df
4
+ data.tar.gz: b64cae2ed6fe3e8ff272e0ce8f16fe116c63ea73ba9cb318a7ca10e900fe8701
5
5
  SHA512:
6
- metadata.gz: f054786c9b9b730213d6fd582ed2bed04591d7e78ae60c54214d6f40636cf2c88b9dcf3539d3583667d04d407bad13e3a5e94cc6c1e5e871072d0e367e979d63
7
- data.tar.gz: c43c6050cd0de928a77cd0b3ad41f1e9de94d97f31b38c53159011580d92ad52a0fba70dedd4d36573984835e7c3563d4662c2cbdfa9bad7f9550111d2e7a8c6
6
+ metadata.gz: 3c8ea1d5c55c02f2c28b541364f2f51d8e24c552cb4c00aec22f278fa8da27e12785cddef5165953db4cfb18c8a2b03d92d0071cea725ea580e387edf8c6fdd0
7
+ data.tar.gz: e5fb2a68c345b21282e3fbd45c78acab783f7d06450fa8209b9bd213b19fd6a31aba332be16587c15fe6474a4249428e76a3b765ea84211fe16e7a785741a24a
data/.gitignore CHANGED
@@ -8,6 +8,11 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .tmp.xml
11
+ test.err.html
12
+ test.rfc.xml
13
+ test.xml
14
+ .asciidoc.log.txt
15
+ metanorma.asciidoc.log.txt
11
16
 
12
17
  # rspec failure tracking
13
18
  .rspec_status
@@ -20,5 +25,11 @@
20
25
  .rubocop-https--*
21
26
 
22
27
  /Gemfile.lock
28
+ /Gemfile.devel
23
29
  /test.err
24
30
  /test.rfc.xml.err
31
+ document.xml
32
+ document.err.html
33
+ document.rfc.xml.err
34
+ *.gem
35
+ spec/relatondb/
data/.html.err.html ADDED
@@ -0,0 +1,118 @@
1
+ <html><head><title>./.html.err.html errors</title>
2
+ <meta charset="UTF-8"/>
3
+ <style> pre { white-space: pre-wrap; }
4
+ thead th { font-weight: bold; background-color: aqua; }
5
+ .severity0 { font-weight: bold; background-color: lightpink }
6
+ .severity1 { font-weight: bold; }
7
+ .severity2 { }
8
+ .severity3 { font-style: italic; color: grey; }
9
+ </style>
10
+ </head><body><h1>./.html.err.html errors</h1>
11
+ <ul><li><p><b><a href="#Relaton">Relaton</a></b>: Severity 3: <b>1</b> error</p></li>
12
+
13
+ <li><p><b><a href="#Style">Style</a></b>: Severity 2: <b>2</b> errors</p></li>
14
+
15
+ <li><p><b><a href="#Metanorma_XML_Syntax">Metanorma XML Syntax</a></b>: Severity 2: <b>22</b> errors</p></li>
16
+ </ul>
17
+ <h2 id="Relaton">Relaton</h2>
18
+ <table border="1">
19
+ <thead><th width="5%">Line</th><th width="20%">ID</th><th width="10%">Error</th>
20
+ <th width="20%">Message</th><th width="40%">Context</th><th width="5%">Severity</th></thead>
21
+ <tbody>
22
+ <tr class="severity3">
23
+ <td></td><th><code>ISO/IEC 10118-3</code></th><td>RELATON_4</td>
24
+ <td>(Error from Relaton) not found in cache, if you wish to ignore cache please use <code>no-cache</code> option.</td><td><pre></pre></td><td>3</td></tr>
25
+ </tbody></table>
26
+ <h2 id="Style">Style</h2>
27
+ <table border="1">
28
+ <thead><th width="5%">Line</th><th width="20%">ID</th><th width="10%">Error</th>
29
+ <th width="20%">Message</th><th width="40%">Context</th><th width="5%">Severity</th></thead>
30
+ <tbody>
31
+ <tr class="severity2">
32
+ <td>000433</td><th><code><a href='./.html.html#frame'>frame</a></code></th><td>STANDOC_48</td>
33
+ <td>(generic warning) Hanging paragraph in clause</td><td><pre>&lt;clause id=&quot;_7db07fdc-fcc6-b1d5-fbd9-4af3fe5d67d4&quot; anchor=&quot;frame&quot; inline-header=&quot;false&quot; obligation=&quot;normative&quot;&gt;
34
+ &lt;title id=&quot;_7f507f76-d16f-6909-7c72-3bf386b1aac3&quot;&gt;Frame Format&lt;/title&gt;
35
+ &lt;p id=&quot;_e5b93d18-9b70-055e-f3ea-e7d3e221cb31&quot;&gt;The IP &lt;em&gt;datagram&lt;/em&gt; is &lt;strong&gt;printed&lt;/strong&gt;, on a small scroll of paper, in hexadecimal, with each octet separated by whitestuff and blackstuff. The scroll of paper is wrapped around one leg of the avian carrier. A band of duct tape is used to secure the datagram&apos;s edges. The bandwidth is limited to the leg length. The MTU is variable, and paradoxically, generally increases with increased carrier age. A typical MTU is 256 milligrams. Some datagram padding may be needed.&lt;eref type=&quot;inline&quot; bibitemid=&quot;RFC7253&quot; citeas=&quot;RFC 7253&quot;&gt; &lt;display-text&gt;alt&lt;/display-text&gt; &lt;/eref&gt; &lt;/p&gt;
36
+
37
+ &lt;p id=&quot;_cbfa7d28-50f5-f4d4-8920-3ff81bb853de&quot;&gt;Upon receipt, the duct tape is removed and the paper copy of the datagram is optically scanned into a electronically transmittable form.&lt;eref type=&quot;inline&quot; bibitemid=&quot;RFC7253&quot; citeas=&quot;RFC 7253&quot;/&gt; &lt;/p&gt;</pre></td><td>2</td></tr>
38
+ <tr class="severity2">
39
+ <td>000468</td><th><code><a href='./.html.html#_b1474689-968c-d908-ec3c-52106a8e875b'>_b1474689-968c-d908-ec3c-52106a8e875b</a></code></th><td>STANDOC_48</td>
40
+ <td>(generic warning) Hanging paragraph in clause</td><td><pre>&lt;clause id=&quot;_b1474689-968c-d908-ec3c-52106a8e875b&quot; inline-header=&quot;false&quot; obligation=&quot;normative&quot;&gt;
41
+ &lt;title id=&quot;_0615fb18-bab7-fcce-7fe6-b06f78cdb707&quot;&gt;Definitions&lt;/title&gt;
42
+ &lt;dl id=&quot;_188c1a32-874f-ef99-a4e5-24156e77be2b&quot;&gt; &lt;dt&gt;OSCCA-compliant:&lt;/dt&gt;
43
+ &lt;dd id=&quot;_2c9455c4-4da3-7bc6-4086-0552e4f2e2d7&quot;&gt; &lt;p id=&quot;_5adcd946-10f3-f180-1cbb-f92b4fabcca2&quot;&gt;All cryptographic algorithms used are compliant with OSCCA regulations.&lt;/p&gt;
44
+ &lt;/dd&gt;</pre></td><td>2</td></tr>
45
+ </tbody></table>
46
+ <h2 id="Metanorma_XML_Syntax">Metanorma XML Syntax</h2>
47
+ <table border="1">
48
+ <thead><th width="5%">Line</th><th width="20%">ID</th><th width="10%">Error</th>
49
+ <th width="20%">Message</th><th width="40%">Context</th><th width="5%">Severity</th></thead>
50
+ <tbody>
51
+ <tr class="severity2">
52
+ <td></td><th><code>XML Line 000021:84</code></th><td>STANDOC_7</td>
53
+ <td>text not allowed here; expected the element end-tag or element "draft" or "revision-date"</td><td><pre></pre></td><td>2</td></tr>
54
+ <tr class="severity2">
55
+ <td></td><th><code>XML Line 000082:13</code></th><td>STANDOC_7</td>
56
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
57
+ <tr class="severity2">
58
+ <td></td><th><code>XML Line 000085:13</code></th><td>STANDOC_7</td>
59
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
60
+ <tr class="severity2">
61
+ <td></td><th><code>XML Line 000088:13</code></th><td>STANDOC_7</td>
62
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
63
+ <tr class="severity2">
64
+ <td></td><th><code>XML Line 000091:13</code></th><td>STANDOC_7</td>
65
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
66
+ <tr class="severity2">
67
+ <td></td><th><code>XML Line 000237:13</code></th><td>STANDOC_7</td>
68
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
69
+ <tr class="severity2">
70
+ <td></td><th><code>XML Line 000240:13</code></th><td>STANDOC_7</td>
71
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
72
+ <tr class="severity2">
73
+ <td></td><th><code>XML Line 000243:13</code></th><td>STANDOC_7</td>
74
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
75
+ <tr class="severity2">
76
+ <td></td><th><code>XML Line 000246:13</code></th><td>STANDOC_7</td>
77
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
78
+ <tr class="severity2">
79
+ <td></td><th><code>XML Line 000323:13</code></th><td>STANDOC_7</td>
80
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
81
+ <tr class="severity2">
82
+ <td></td><th><code>XML Line 000326:13</code></th><td>STANDOC_7</td>
83
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
84
+ <tr class="severity2">
85
+ <td></td><th><code>XML Line 000405:13</code></th><td>STANDOC_7</td>
86
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
87
+ <tr class="severity2">
88
+ <td></td><th><code>XML Line 000408:13</code></th><td>STANDOC_7</td>
89
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
90
+ <tr class="severity2">
91
+ <td></td><th><code>XML Line 000411:13</code></th><td>STANDOC_7</td>
92
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
93
+ <tr class="severity2">
94
+ <td></td><th><code>XML Line 000414:13</code></th><td>STANDOC_7</td>
95
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
96
+ <tr class="severity2">
97
+ <td></td><th><code>XML Line 000417:13</code></th><td>STANDOC_7</td>
98
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
99
+ <tr class="severity2">
100
+ <td></td><th><code>XML Line 000424:132</code></th><td>STANDOC_7</td>
101
+ <td>element "pi" not allowed here; expected the element end-tag or element "backpage-image", "coverpage-image", "ics", "index­Include", "innercoverpage-image", "ipr­Extract", "showOnFrontPage", "sort­Refs", "structuredidentifi­er", "sym­Refs", "toc­Depth", "toc­Include" or "tocside-image"</td><td><pre></pre></td><td>2</td></tr>
102
+ <tr class="severity2">
103
+ <td></td><th><code>XML Line 000435:606</code></th><td>STANDOC_7</td>
104
+ <td>element "display-text" not allowed here; expected the element end-tag, text or element "date", "locality" or "localityStack"</td><td><pre></pre></td><td>2</td></tr>
105
+ <tr class="severity2">
106
+ <td></td><th><code>XML Line 000510:6</code></th><td>STANDOC_7</td>
107
+ <td>element "pre" missing required attribute "id"</td><td><pre></pre></td><td>2</td></tr>
108
+ <tr class="severity2">
109
+ <td></td><th><code>XML Line 000648:13</code></th><td>STANDOC_7</td>
110
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
111
+ <tr class="severity2">
112
+ <td></td><th><code>XML Line 000651:13</code></th><td>STANDOC_7</td>
113
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
114
+ <tr class="severity2">
115
+ <td></td><th><code>XML Line 000654:13</code></th><td>STANDOC_7</td>
116
+ <td>element "keyword" incomplete; missing required element "taxon"</td><td><pre></pre></td><td>2</td></tr>
117
+ </tbody></table>
118
+ </body></html>
data/.rspec CHANGED
@@ -1,2 +1 @@
1
1
  --color
2
- --require spec_helper
data/Gemfile CHANGED
@@ -1,9 +1,34 @@
1
- Encoding.default_external = Encoding::UTF_8
2
- Encoding.default_internal = Encoding::UTF_8
3
-
4
1
  source "https://rubygems.org"
5
- git_source(:github) { |repo| "https://github.com/#{repo}" }
6
2
 
7
3
  gemspec
4
+ gem "metanorma-mirror", "~> 1.0", github: "metanorma/metanorma-mirror", branch: "main"
5
+
6
+ # and the pubid-2 / relaton-bib 2.2 / metanorma-document 0.5 chain.
7
+ # Revert each pin once the corresponding PR merges:
8
+ # - https://github.com/metanorma/metanorma-document/pull/45
9
+ gem "metanorma-standoc", github: "metanorma/metanorma-standoc", branch: "main"
10
+ gem "metanorma-document", github: "metanorma/metanorma-document", branch: "main"
11
+ gem "isodoc", github: "metanorma/isodoc", branch: "main" # merged as #825
12
+ gem "pubid", "~> 2.0.0.pre.alpha"
13
+
14
+ gem "canon"
15
+ gem "equivalent-xml"
16
+ gem "htmlentities"
17
+ gem "metanorma", github: "metanorma/metanorma", branch: "main"
18
+ gem "rake"
19
+ # Gemfile.devel may pin relaton-bib to a git branch (declaring the
20
+ # same gem twice aborts the rescued eval_gemfile silently)
21
+ gem "relaton-bib", "~>2.1" unless File.exist?(File.join(__dir__, "Gemfile.devel"))
22
+ gem "rspec"
23
+ gem "rubocop"
24
+ gem "rubocop-performance"
25
+ gem "simplecov"
26
+ gem "timecop"
27
+ gem "webmock"
8
28
 
9
29
  eval_gemfile("Gemfile.devel") rescue nil
30
+
31
+ gem "metanorma-iso", github: "metanorma/metanorma-iso", branch: "main"
32
+ gem "metanorma-core", github: "metanorma/metanorma-core", branch: "main"
33
+ # leptris 1.9.359+ drops Declaration#to_xml and changes the validator
34
+ # surface (leptris#1733); pin the 1.9.356-era pair until leptris ships
data/Gemfile.devel ADDED
@@ -0,0 +1 @@
1
+ gem "relaton-bib", github: "relaton/relaton-bib", branch: "feat/rfcxml-v3-export"
@@ -0,0 +1,18 @@
1
+ # Task 1: Fix bibliography reference anchors using UUIDs instead of original IDs
2
+
3
+ ## Problem
4
+ When forward-transforming ADOC input with `[bibliography] == References * [[[RFC2119,Key Words]]] ...`, the reference anchor in RFC XML output is a UUID like `_302856a2-5468-3783-9d82-c075e1073e0b` instead of the expected `RFC2119`. This causes xml2rfc to emit:
5
+ ```
6
+ Warning: Unused reference: There seems to be no reference to [_302856a2-...]
7
+ ```
8
+
9
+ ## Root Cause
10
+ The forward transformer's reference_transformer.rb likely doesn't extract the original `id` or anchor from the `<bibitem id="RFC2119">` element in semantic XML, instead generating a new UUID.
11
+
12
+ ## Fix Location
13
+ `lib/metanorma/ietf/transformer/reference_transformer.rb` — the `transform_bibitem` or equivalent method that creates `<reference>` elements must use the bibitem's `id` attribute as the RFC XML `anchor`.
14
+
15
+ ## Verification
16
+ - Run the full ADOC integration spec
17
+ - xml2rfc should have 0 warnings about unused references
18
+ - The `<reference anchor="RFC2119">` should appear in RFC XML output
@@ -0,0 +1,13 @@
1
+ # Task 2: Fix extract_paragraph_text to use `text` attribute (not `content`)
2
+
3
+ ## Problem
4
+ `extract_paragraph_text` in `inline_transformer.rb` calls `paragraph.content` but `ParagraphBlock` has no `content` attribute — it uses `text` (a string collection). This causes `NoMethodError` when forward-transforming MN XML that was produced by the reverse transformer (round-trip scenario).
5
+
6
+ ## Root Cause
7
+ `ParagraphBlock` (from metanorma-document) maps `<p>` content to the `text` attribute (collection). The `content` attribute only exists on some other model types. The forward transformer was checking `content` first, which triggers lutaml-model's `method_missing` and raises.
8
+
9
+ ## Fix Location
10
+ `lib/metanorma/ietf/transformer/inline_transformer.rb` — `extract_paragraph_text` method. Already partially fixed to use `paragraph.text`, but need to verify it's complete and no other callers depend on `content`.
11
+
12
+ ## Status
13
+ Partially done — method was updated. Need to verify all callers work.
@@ -0,0 +1,26 @@
1
+ # Task 3: Fix duplicate anchors and invalid anchor attributes in round-trip RFC XML
2
+
3
+ ## Problem
4
+ When round-tripping (RFC XML → reverse → forward → RFC XML), the output has:
5
+ 1. **Duplicate anchors** — same UUID appearing on multiple elements (e.g., `_d36058ae...` on multiple `<t>` elements)
6
+ 2. **Invalid `anchor` on `<t>`** — RFC XML v3 `<t>` element does NOT support `anchor` attribute, but the forward transformer is generating `<t anchor="...">`
7
+
8
+ xml2rfc errors:
9
+ ```
10
+ Error: Invalid attribute anchor for element t, at /rfc/middle/section[1]/t[5]
11
+ Error: Duplicate xsd:ID attribute anchor="_d36058ae-..." found.
12
+ ```
13
+
14
+ ## Root Cause
15
+ The forward transformer's `transform_paragraph` (or `transform_t`) sets `anchor` on `<t>` elements. In RFC XML v3, only `<section>`, `<figure>`, `<table>`, `<ul>`, `<ol>`, `<references>` etc. support `anchor` — NOT `<t>`.
16
+
17
+ The duplicate anchors happen because the reverse transformer preserves IDs in the MN XML, and then the forward transformer re-applies those same IDs, but the MN XML model has `id` on `ParagraphBlock` which maps to both the paragraph's `id` AND gets used as an RFC anchor.
18
+
19
+ ## Fix Location
20
+ 1. `lib/metanorma/ietf/transformer/block_transformer.rb` — `transform_paragraph` must NOT set `anchor` on `<t>` elements
21
+ 2. Check all element types in forward transformer that set `anchor` — verify they only do so for RFC v3 elements that support it
22
+
23
+ ## Verification
24
+ - Round-trip example.xml through forward→reverse→forward→xml2rfc with exit 0 and 0 errors
25
+ - No "Invalid attribute anchor" errors
26
+ - No "Duplicate xsd:ID" warnings
@@ -0,0 +1,22 @@
1
+ # Task 4: Fix `<li>` containing `<t>` children in round-trip
2
+
3
+ ## Problem
4
+ xml2rfc error:
5
+ ```
6
+ Error: Element li has extra content: t, at /rfc/middle/section[1]/ul[4]/li[1]/t
7
+ ```
8
+
9
+ In RFC XML v3, `<li>` can contain `<t>` but the xml2rfc error suggests a structural issue. This happens in the round-trip output.
10
+
11
+ ## Root Cause
12
+ The reverse transformer creates paragraph blocks inside list items. When forward-transforming back, those paragraphs become `<t>` inside `<li>`, but the surrounding structure may be wrong — e.g., the `<t>` should be a direct child of `<li>` but there might be extra wrapping, or the `<li>` has mixed content that isn't allowed.
13
+
14
+ Need to inspect the actual round-trip XML to see the exact structure.
15
+
16
+ ## Fix Location
17
+ - Likely `lib/metanorma/ietf/transformer/list_transformer.rb` — how list items with paragraph children are transformed
18
+ - Possibly `lib/metanorma/ietf/transformer/rfc_v3_to_ietf/list_transformer.rb` — how reverse transformer creates list item content
19
+
20
+ ## Verification
21
+ - Round-trip example.xml → xml2rfc exit 0
22
+ - No "Element li has extra content" errors
@@ -0,0 +1,22 @@
1
+ # Task 5: Write integration spec for Pipeline 1 (ADOC → RFC XML → xml2rfc)
2
+
3
+ ## Goal
4
+ Verify that ADOC documents can be converted to semantic XML, parsed by metanorma-document, transformed to RFC XML v3, and accepted by xml2rfc with **no errors and no warnings**.
5
+
6
+ ## Test Cases
7
+ 1. Simple document (title, sections, paragraphs) — clean pass
8
+ 2. Full document (abstract, intro, lists, tables, bibliography, BCP14 keywords, notes) — clean pass
9
+ 3. Fixture documents (example.xml, antioch.xml) — clean pass
10
+
11
+ ## Assertion Criteria
12
+ - `xml2rfc --text` exit code must be 0
13
+ - No "Error:" lines in xml2rfc output
14
+ - RFC XML must have `<rfc>`, `<front>`, `<middle>`, `<back>`
15
+ - Title, author, sections, metadata preserved correctly
16
+
17
+ ## Current Status
18
+ DONE. Integration spec includes:
19
+ - Step-by-step pipeline tests (ADOC→XML, XML→model, model→RFC XML, RFC XML→xml2rfc)
20
+ - Fixture-based tests with shared examples
21
+ - Content preservation assertions for metadata, sections, lists, tables, BCP14, notes, bibliography
22
+ - 38 integration tests pass, 288 total specs pass with 0 failures
@@ -0,0 +1,27 @@
1
+ # Task 6: Write integration spec for Pipeline 2 (RFC XML → reverse → forward → xml2rfc)
2
+
3
+ ## Goal
4
+ Verify that RFC XML v3 documents can be reverse-transformed to metanorma-document, then forward-transformed back to RFC XML v3, and the round-tripped RFC XML is accepted by xml2rfc with **no errors and no warnings**.
5
+
6
+ ## Test Cases
7
+ 1. Simple RFC XML (sections, paragraphs, lists, bibliography) — clean round-trip
8
+ 2. Complex RFC XML (example.xml fixture forward output) — clean round-trip
9
+ 3. Antioch.xml fixture forward output — clean round-trip
10
+
11
+ ## Assertion Criteria
12
+ - `xml2rfc --text` on round-tripped RFC XML exit code must be 0
13
+ - No "Error:" lines
14
+ - No "Warning:" lines
15
+ - Round-tripped RFC XML must preserve: title, author, sections, references
16
+ - Content text must be preserved (no data loss)
17
+
18
+ ## Prerequisites
19
+ - Task 2 (fix extract_paragraph_text) — DONE
20
+ - Task 3 (fix duplicate anchors) — DONE
21
+ - Task 4 (fix li/t children) — DONE
22
+
23
+ ## Current Status
24
+ DONE. Integration spec includes:
25
+ - Shared examples for fixture-based round-trip (example.xml, antioch.xml)
26
+ - ADOC-based full round-trip test (ADOC → RFC → reverse → forward → xml2rfc)
27
+ - All 38 integration tests pass, 288 total specs pass with 0 failures
@@ -0,0 +1,14 @@
1
+ # Task 7: Final verification — all specs pass
2
+
3
+ ## Goal
4
+ Ensure all 275+ specs pass with 0 failures after all fixes.
5
+
6
+ ## Steps
7
+ 1. Run `bin/rspec` — all specs green
8
+ 2. Run `bin/rspec spec/transformer/` — all transformer specs green
9
+ 3. Run `bin/rspec spec/transformer/integration_spec.rb` — all integration specs green
10
+ 4. Run rubocop if needed
11
+
12
+ ## Acceptance Criteria
13
+ - `bin/rspec` returns 0 failures
14
+ - No regressions in existing specs
@@ -0,0 +1,112 @@
1
+ # Bug Report: Circular Autoload Dependency in Register Setup
2
+
3
+ **Severity:** High — prevents any non-ISO flavor from loading via `require "metanorma/document"`
4
+
5
+ **Affected file:** `lib/metanorma/registers/setup.rb` lines 14–15
6
+
7
+ ## Description
8
+
9
+ `registers/setup.rb` defines module-level constants that trigger autoloads before the `Setup` module's methods are fully defined:
10
+
11
+ ```ruby
12
+ module Metanorma
13
+ module Registers
14
+ module Setup
15
+ SD = Metanorma::StandardDocument # line 14 — triggers autoload of standard_document
16
+ ISO = Metanorma::IsoDocument # line 15 — triggers autoload of iso_document
17
+
18
+ class << self
19
+ def setup_iso_register # line 21 — not yet defined when line 15 autoloads iso_document.rb
20
+ ...
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ ```
27
+
28
+ ## How it breaks
29
+
30
+ 1. `ietf_document.rb` line 11 calls `Metanorma::Registers::Setup.setup_ietf_register`
31
+ 2. This triggers autoload of `registers/setup.rb`
32
+ 3. Line 15: `ISO = Metanorma::IsoDocument` triggers autoload of `iso_document.rb`
33
+ 4. `iso_document.rb` line 16: `Metanorma::Registers::Setup.setup_iso_register`
34
+ 5. But `setup_iso_register` isn't defined yet — the `class << self` block hasn't been evaluated (still at line 15)
35
+ 6. **`NoMethodError: undefined method 'setup_iso_register'`**
36
+
37
+ ## Symmetric problem
38
+
39
+ Every `*_document.rb` file calls `Registers::Setup.setup_*_register` at load time. Any two flavors that are both referenced inside `setup.rb` will have this circular dependency. For example, if a new flavor's register setup references `Metanorma::IeeeDocument`, loading `ieee_document.rb` would trigger `setup.rb` which references `IsoDocument`, which calls `setup_iso_register` before it's defined.
40
+
41
+ ## Current workaround
42
+
43
+ metanorma-ietf forces the loading order in its transformer.rb:
44
+
45
+ ```ruby
46
+ require "metanorma/document"
47
+
48
+ # Force-load order to break the circular autoload
49
+ Metanorma::StandardDocument::Sections
50
+ Metanorma::IsoDocument::Sections
51
+ ```
52
+
53
+ This pre-resolves `Metanorma::IsoDocument` before `ietf_document.rb` references `Registers::Setup`, so when `setup.rb` loads, `ISO = Metanorma::IsoDocument` resolves without triggering a new autoload.
54
+
55
+ ## Suggested fix
56
+
57
+ Move the module-level constants inside the methods that use them, or lazy-initialize them:
58
+
59
+ ```ruby
60
+ module Metanorma
61
+ module Registers
62
+ module Setup
63
+ class << self
64
+ def setup_iso_register
65
+ sd = Metanorma::StandardDocument
66
+ iso = Metanorma::IsoDocument
67
+ reg = Lutaml::Model::Register.new(:iso_document)
68
+ Lutaml::Model::GlobalRegister.register(reg)
69
+
70
+ reg.register_global_type_substitution(
71
+ from_type: sd::Sections::ClauseSection,
72
+ to_type: iso::Sections::IsoClauseSection,
73
+ )
74
+ # ... etc
75
+ end
76
+
77
+ def setup_ietf_register
78
+ sd = Metanorma::StandardDocument
79
+ ietf = Metanorma::IetfDocument
80
+ reg = Lutaml::Model::Register.new(:ietf_document)
81
+ Lutaml::Model::GlobalRegister.register(reg)
82
+ # ... etc
83
+ end
84
+ end
85
+ end
86
+ end
87
+ end
88
+ ```
89
+
90
+ This way, no autoloads are triggered at module-definition time, and the circular dependency is eliminated.
91
+
92
+ ## Secondary issue: IETF content model gaps
93
+
94
+ While adapting the IETF transformer to the restructured metanorma-document, we found these model gaps. These are **not blockers** (we have workarounds), but they represent model design questions for the metanorma-document team:
95
+
96
+ ### 1. `IetfContentSection` lacks `unnumbered` and `toc`
97
+
98
+ `IetfClauseSection` (extends `ClauseSection`) inherits `unnumbered` and `toc` from its base class. But `IetfContentSection` (extends `ContentSection`) does not have these attributes. In the IETF context, preface content sections can be unnumbered, so the forward transformer needs to check `unnumbered` on content sections too.
99
+
100
+ **Current workaround:** `rescue NoMethodError` guards in the forward transformer.
101
+
102
+ ### 2. No IETF-specific term types
103
+
104
+ The `StandardDocument` base provides `Term`, `TermsSection`, `TermDefinition`, `TermExpression`, `TermNameElement`, and `Designation`. But IETF documents that include terminology need these same types. The reverse transformer uses `StandardDocument` base types instead of `IsoDocument` types (which is correct per the architecture), but there's no IETF-specific customization layer.
105
+
106
+ **Status:** Working with `StandardDocument` base types. No IETF-specific term model needed yet, but the metanorma-document team should be aware that IETF may need term model extensions in the future.
107
+
108
+ ### 3. `Preface.content` type is `ContentSection`
109
+
110
+ The `Preface` model's `content` attribute is typed as `ContentSection`, which maps `"clause" → :subsection`. But some flavors (like IETF) put clause-like content in preface `content`. The register substitution `ContentSection → IetfContentSection` applies to all content items, including objects that behave more like `ClauseSection`. This causes attribute mismatch during serialization.
111
+
112
+ **Current workaround:** The reverse transformer creates `IetfContentSection` instances for preface content, which serializes correctly. But if richer clause features (amend, terms, definitions) are needed in preface content, the type system needs a more flexible approach.
@@ -0,0 +1,86 @@
1
+ # 01: Bidirectional Transformer Architecture
2
+
3
+ ## Problem
4
+
5
+ The current transformer is one-directional: `IetfToRfcV3` only handles Metanorma XML → RFC XML v3. There is no reverse transformer. The architecture is a single monolithic class with 13 mixins, ~4,400 lines total, using private APIs and XML string manipulation.
6
+
7
+ ## Design
8
+
9
+ ### 1. Introduce `Transform` protocol module
10
+
11
+ Define a `Transform` module that both directions implement:
12
+
13
+ ```ruby
14
+ module Metanorma::Ietf::Transformer
15
+ module Transform
16
+ # @param input [String] XML string
17
+ # @param options [Hash] transformation options
18
+ # @return [String] transformed XML string
19
+ def self.call(input, options = {})
20
+ raise NotImplementedError
21
+ end
22
+ end
23
+ end
24
+ ```
25
+
26
+ ### 2. Split into two transformer classes under a common base
27
+
28
+ ```
29
+ lib/metanorma/ietf/transformer/
30
+ base.rb # Shared utilities (ls_text, to_ncname, etc.)
31
+ ietf_to_rfc_v3.rb # Forward: Metanorma XML → RFC XML v3 (refactored)
32
+ rfc_v3_to_ietf.rb # Reverse: RFC XML v3 → Metanorma XML (NEW)
33
+ ```
34
+
35
+ `Base` holds:
36
+ - `ls_text`, `extract_text`, `escape_xml_text`, `to_ncname`, `to_array`, `anchor_for`
37
+ - `build_organization` (shared between forward and reverse)
38
+ - No state (no `@doc`, `@xrefs`, etc.) — those belong to the concrete transformers
39
+
40
+ ### 3. Refactor `IetfToRfcV3` to extend `Base`
41
+
42
+ Move shared helpers to `Base`. Keep the 13 existing modules but:
43
+ - Each module becomes a standalone class or remains a mixin — but no more `send` to private lutaml-model APIs
44
+ - Replace `NullBibdata`/`NullExt` with proper null objects (see TODO 04)
45
+
46
+ ### 4. Create `RfcV3ToIetf` (reverse transformer)
47
+
48
+ New class extending `Base` with its own modules:
49
+ - `RfcV3ToIetf::Metadata` — RFC attributes → bibdata
50
+ - `RfcV3ToIetf::Front` — `<front>` → Metanorma front matter
51
+ - `RfcV3ToIetf::Section` — `<middle>`/`<back>` → Metanorma sections
52
+ - `RfcV3ToIetf::Block` — paragraphs, sourcecode, etc.
53
+ - `RfcV3ToIetf::Inline` — xref, eref, cref, etc.
54
+ - `RfcV3ToIetf::Table` — tables
55
+ - `RfcV3ToIetf::Figure` — figures/artwork
56
+ - `RfcV3ToIetf::List` — lists
57
+ - `RfcV3ToIetf::Term` — terms/definitions
58
+ - `RfcV3ToIetf::Reference` — bibliography
59
+ - `RfcV3ToIetf::Cleanup` — post-processing
60
+
61
+ ### 5. Update entry point
62
+
63
+ ```ruby
64
+ module Metanorma::Ietf::Transformer
65
+ def self.convert(xml_string, direction: :forward, options = {})
66
+ case direction
67
+ when :forward then Forward.call(xml_string, options)
68
+ when :reverse then Reverse.call(xml_string, options)
69
+ end
70
+ end
71
+ end
72
+ ```
73
+
74
+ ## Files to modify/create
75
+
76
+ | File | Action |
77
+ |------|--------|
78
+ | `lib/metanorma/ietf/transformer/base.rb` | NEW — shared utilities |
79
+ | `lib/metanorma/ietf/transformer/ietf_to_rfc_v3.rb` | Refactor to extend Base |
80
+ | `lib/metanorma/ietf/transformer/rfc_v3_to_ietf.rb` | NEW — reverse transformer |
81
+ | `lib/metanorma/ietf/transformer.rb` | Update entry point with direction parameter |
82
+
83
+ ## Dependencies
84
+
85
+ - TODO 02 (private API encapsulation) must be done first
86
+ - TODO 04 (NullBibdata replacement) should be done before refactoring