metanorma-ietf 3.7.15 → 3.7.17
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 +4 -4
- data/Gemfile +0 -3
- data/lib/metanorma/ietf/front.rb +8 -2
- data/lib/metanorma/ietf/schema/v3.rng +9 -0
- data/lib/metanorma/ietf/transformer/front_transformer.rb +20 -5
- data/lib/metanorma/ietf/transformer/metadata_transformer.rb +10 -1
- data/lib/metanorma/ietf/transformer/validation_transformer.rb +82 -0
- data/lib/metanorma/ietf/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: abcc3856de061ccbe82625eec533e0d60595eac991405092b05e706b8725f1bd
|
|
4
|
+
data.tar.gz: 44356953e5d937b8419015b0772e9beefcfc7be99c7f7fcf0506d246c01fadc7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 45a5436a0a28a429670aae9537ee3e595b1dd9459709294d3ff2f0fcc86fed4edfb4a37a8c7d3701c659e831cf3be551222d0f46f7deeb4b18b769783e47e522
|
|
7
|
+
data.tar.gz: ba8129dfac06cb1666508c5ddfe4b1f9182ce05e9a0134b72230a8cd4124e7d8bf1ba0fb82f2e2678ca763b5ae46b4136d6133124f5ffc86b084625c3afc64e1
|
data/Gemfile
CHANGED
|
@@ -12,9 +12,6 @@ gem "canon"
|
|
|
12
12
|
gem "htmlentities"
|
|
13
13
|
gem "metanorma", "~> 2.5.14"
|
|
14
14
|
gem "rake"
|
|
15
|
-
# Gemfile.devel may pin relaton-bib to a git branch (declaring the
|
|
16
|
-
# same gem twice aborts the rescued eval_gemfile silently)
|
|
17
|
-
gem "relaton-bib", "~>2.1" unless File.exist?(File.join(__dir__, "Gemfile.devel"))
|
|
18
15
|
gem "rspec"
|
|
19
16
|
gem "rubocop"
|
|
20
17
|
gem "rubocop-performance"
|
data/lib/metanorma/ietf/front.rb
CHANGED
|
@@ -26,8 +26,10 @@ module Metanorma
|
|
|
26
26
|
|
|
27
27
|
def metadata_series(node, xml)
|
|
28
28
|
xml.series **{ type: "stream" } do |s|
|
|
29
|
-
|
|
30
|
-
#
|
|
29
|
+
# Asciidoctor downcases attribute names: :submissionType: lands
|
|
30
|
+
# as "submissiontype", :submission-type: as "submission-type";
|
|
31
|
+
# the RFC-XML world spells it camelCase, so accept both.
|
|
32
|
+
add_noko_elem(s, "title", submission_type_attr(node) || "IETF")
|
|
31
33
|
end
|
|
32
34
|
a = node.attr("intended-series") and
|
|
33
35
|
xml.series **{ type: "intended" } do |s|
|
|
@@ -37,6 +39,10 @@ module Metanorma
|
|
|
37
39
|
end
|
|
38
40
|
end
|
|
39
41
|
|
|
42
|
+
def submission_type_attr(node)
|
|
43
|
+
node.attr("submission-type") || node.attr("submissiontype")
|
|
44
|
+
end
|
|
45
|
+
|
|
40
46
|
def title_fallback(node, xml)
|
|
41
47
|
xml.parent.at("./title[not(normalize-space(.)='')]" \
|
|
42
48
|
"[not(@type = 'abbrev' or @type = 'ascii')]") and return
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
<value>IAB</value>
|
|
61
61
|
<value>IRTF</value>
|
|
62
62
|
<value>independent</value>
|
|
63
|
+
<value>editorial</value>
|
|
63
64
|
</choice>
|
|
64
65
|
</attribute>
|
|
65
66
|
</optional>
|
|
@@ -1265,6 +1266,8 @@
|
|
|
1265
1266
|
<choice>
|
|
1266
1267
|
<ref name="artset"/>
|
|
1267
1268
|
<ref name="artwork"/>
|
|
1269
|
+
<ref name="aside"/>
|
|
1270
|
+
<ref name="blockquote"/>
|
|
1268
1271
|
<ref name="dl"/>
|
|
1269
1272
|
<ref name="figure"/>
|
|
1270
1273
|
<ref name="ol"/>
|
|
@@ -1576,6 +1579,8 @@
|
|
|
1576
1579
|
<ref name="iref"/>
|
|
1577
1580
|
<ref name="relref"/>
|
|
1578
1581
|
<ref name="strong"/>
|
|
1582
|
+
<ref name="sub"/>
|
|
1583
|
+
<ref name="sup"/>
|
|
1579
1584
|
<ref name="tt"/>
|
|
1580
1585
|
<ref name="xref"/>
|
|
1581
1586
|
</choice>
|
|
@@ -1600,6 +1605,8 @@
|
|
|
1600
1605
|
<ref name="iref"/>
|
|
1601
1606
|
<ref name="relref"/>
|
|
1602
1607
|
<ref name="strong"/>
|
|
1608
|
+
<ref name="sub"/>
|
|
1609
|
+
<ref name="sup"/>
|
|
1603
1610
|
<ref name="tt"/>
|
|
1604
1611
|
<ref name="xref"/>
|
|
1605
1612
|
</choice>
|
|
@@ -2378,6 +2385,7 @@
|
|
|
2378
2385
|
<value>IAB</value>
|
|
2379
2386
|
<value>IRTF</value>
|
|
2380
2387
|
<value>independent</value>
|
|
2388
|
+
<value>editorial</value>
|
|
2381
2389
|
</choice>
|
|
2382
2390
|
</optional>
|
|
2383
2391
|
</element>
|
|
@@ -2430,6 +2438,7 @@
|
|
|
2430
2438
|
<value>IAB</value>
|
|
2431
2439
|
<value>IRTF</value>
|
|
2432
2440
|
<value>independent</value>
|
|
2441
|
+
<value>editorial</value>
|
|
2433
2442
|
</choice>
|
|
2434
2443
|
</attribute>
|
|
2435
2444
|
</optional>
|
|
@@ -4,6 +4,12 @@ module Metanorma
|
|
|
4
4
|
module Ietf
|
|
5
5
|
module Transformer
|
|
6
6
|
module FrontTransformer
|
|
7
|
+
# RFC 7991 s2.29 subseries pointer names, keyed by the
|
|
8
|
+
# intended-series title the flavor accepts
|
|
9
|
+
SERIES_INFO_NAMES = {
|
|
10
|
+
"standard" => "STD", "std" => "STD", "full-standard" => "STD",
|
|
11
|
+
"bcp" => "BCP", "fyi" => "FYI",
|
|
12
|
+
}.freeze
|
|
7
13
|
|
|
8
14
|
def build_front
|
|
9
15
|
front = Rfcxml::V3::Front.new
|
|
@@ -85,12 +91,21 @@ module Metanorma
|
|
|
85
91
|
series_list = [series_list] unless series_list.is_a?(Array)
|
|
86
92
|
series_list.each do |s|
|
|
87
93
|
next unless s.type == "intended"
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
#
|
|
94
|
+
# RFC 7991 s2.29: the subseries pointers carry a name and
|
|
95
|
+
# number ("BCP 14" -> name="BCP" value="14", #298); the
|
|
96
|
+
# informational/experimental/historic statuses have no
|
|
97
|
+
# subseries (they live on the rfc category), and a
|
|
98
|
+
# seriesInfo without a number has nothing valid to point
|
|
99
|
+
# at — the former empty name="" value="" entries were
|
|
100
|
+
# schema-legal junk
|
|
101
|
+
title = ls_text(s.title)
|
|
102
|
+
name = title && SERIES_INFO_NAMES[title.downcase]
|
|
91
103
|
num = s.respond_to?(:number) ? ls_text(s.number) : nil
|
|
92
|
-
|
|
93
|
-
|
|
104
|
+
num = num&.strip
|
|
105
|
+
next unless name && num && !num.empty?
|
|
106
|
+
si = Rfcxml::V3::SeriesInfo.new
|
|
107
|
+
si.name = name
|
|
108
|
+
si.value = num
|
|
94
109
|
infos << si
|
|
95
110
|
end
|
|
96
111
|
end
|
|
@@ -119,7 +119,16 @@ module Metanorma
|
|
|
119
119
|
return SERIES2CATEGORY.fetch(title.downcase, "std") if title
|
|
120
120
|
end
|
|
121
121
|
end
|
|
122
|
-
|
|
122
|
+
category_default
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# With no intended series declared, fall back to a category the
|
|
126
|
+
# stream actually carries (RFC 7841): xml2rfc's preptool dies
|
|
127
|
+
# on stream/category combinations it has no boilerplate for,
|
|
128
|
+
# and the former blanket std default handed every independent
|
|
129
|
+
# document one
|
|
130
|
+
def category_default
|
|
131
|
+
extract_submission_type == "IETF" ? "std" : "info"
|
|
123
132
|
end
|
|
124
133
|
|
|
125
134
|
def extract_doc_name
|
|
@@ -193,6 +193,7 @@ module Metanorma
|
|
|
193
193
|
ret += link_check(xml)
|
|
194
194
|
ret += series_info_check(xml)
|
|
195
195
|
ret += ipr_check(xml)
|
|
196
|
+
ret += submission_type_check(xml)
|
|
196
197
|
ret
|
|
197
198
|
end
|
|
198
199
|
|
|
@@ -242,6 +243,87 @@ module Metanorma
|
|
|
242
243
|
"#{xml.root['ipr']}"]
|
|
243
244
|
[]
|
|
244
245
|
end
|
|
246
|
+
|
|
247
|
+
# RFC 7991 s2.45.11: the legal submissionType (stream) values.
|
|
248
|
+
RFC7841_STREAMS = %w(IETF IAB IRTF independent editorial).freeze
|
|
249
|
+
|
|
250
|
+
# RFC 7841 s2: the category each stream may carry; source of
|
|
251
|
+
# truth is the xml2rfc boilerplate_rfc_7841.py
|
|
252
|
+
# boilerplate_rfc_status_of_memo table
|
|
253
|
+
RFC7841_STREAM_CATEGORIES = {
|
|
254
|
+
"IETF" => %w(std bcp exp historic info),
|
|
255
|
+
"IAB" => %w(info historic),
|
|
256
|
+
"IRTF" => %w(exp historic info),
|
|
257
|
+
"independent" => %w(exp historic info),
|
|
258
|
+
"editorial" => %w(info),
|
|
259
|
+
}.freeze
|
|
260
|
+
|
|
261
|
+
# Stream consistency across <rfc>, <front> <seriesInfo>,
|
|
262
|
+
# <category> and <consensus>. The schema enum rejects unknown
|
|
263
|
+
# stream values, but schema errors do not quarantine output;
|
|
264
|
+
# these content checks do, with messages citing the document
|
|
265
|
+
# attribute that produced the value. Mirrors xml2rfc preptool
|
|
266
|
+
# 5.4.x stream checks.
|
|
267
|
+
def submission_type_check(xml)
|
|
268
|
+
ret = []
|
|
269
|
+
ret += submission_type_enum_check(xml)
|
|
270
|
+
ret += stream_category_check(xml)
|
|
271
|
+
ret += series_info_stream_check(xml)
|
|
272
|
+
ret += consensus_check(xml)
|
|
273
|
+
ret
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
def submission_type_enum_check(xml)
|
|
277
|
+
st = xml.root["submissionType"] or return []
|
|
278
|
+
RFC7841_STREAMS.include?(st) or
|
|
279
|
+
return ["Unknown submissionType (stream) on <rfc> element " \
|
|
280
|
+
"(:submission-type: #{st}): must be one of " \
|
|
281
|
+
"#{RFC7841_STREAMS.join(', ')}"]
|
|
282
|
+
[]
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
def stream_category_check(xml)
|
|
286
|
+
st = xml.root["submissionType"] || "IETF"
|
|
287
|
+
cat = xml.root["category"] or return []
|
|
288
|
+
legal = RFC7841_STREAM_CATEGORIES[st] or return []
|
|
289
|
+
legal.include?(cat) or
|
|
290
|
+
return ["The category of <rfc> (:intended-series: TYPE " \
|
|
291
|
+
"NUMBER) is invalid for the #{st} stream: must be " \
|
|
292
|
+
"one of #{legal.join(', ')}, but is #{cat}"]
|
|
293
|
+
[]
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# 5.4.2.1. Compare <rfc> "submissionType" and
|
|
297
|
+
# <seriesInfo> "stream"
|
|
298
|
+
def series_info_stream_check(xml)
|
|
299
|
+
st = xml.root["submissionType"] || "IETF"
|
|
300
|
+
xml.xpath("//front//seriesInfo[@stream]").each do |s|
|
|
301
|
+
s["stream"] == st or
|
|
302
|
+
return ["The stream setting of <front> <seriesInfo> " \
|
|
303
|
+
"(#{s['stream']}) is inconsistent with the " \
|
|
304
|
+
"submissionType of <rfc> (#{st})"]
|
|
305
|
+
end
|
|
306
|
+
[]
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# 5.4.2.2. "Status of This Memo" Insertion: the independent
|
|
310
|
+
# and editorial streams take no consensus setting, and the
|
|
311
|
+
# IRTF stream only when the document names a workgroup
|
|
312
|
+
def consensus_check(xml)
|
|
313
|
+
st = xml.root["submissionType"] || "IETF"
|
|
314
|
+
c = xml.root["consensus"] or return []
|
|
315
|
+
if %w(independent editorial).include?(st)
|
|
316
|
+
return ["Expected no consensus setting for the #{st} " \
|
|
317
|
+
"stream (:consensus: #{c}); remove the " \
|
|
318
|
+
":consensus: document attribute"]
|
|
319
|
+
end
|
|
320
|
+
if st == "IRTF" && xml.at("//front/workgroup").nil?
|
|
321
|
+
return ["Expected no consensus setting for the IRTF " \
|
|
322
|
+
"stream with no workgroup (:consensus: #{c}); " \
|
|
323
|
+
"declare :workgroup: or remove :consensus:"]
|
|
324
|
+
end
|
|
325
|
+
[]
|
|
326
|
+
end
|
|
245
327
|
end
|
|
246
328
|
end
|
|
247
329
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-ietf
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.7.
|
|
4
|
+
version: 3.7.17
|
|
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-
|
|
11
|
+
date: 2026-11-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|