sts 0.5.6 → 0.6.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.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +3 -0
- data/.github/workflows/release.yml +11 -5
- data/.rubocop.yml +24 -9
- data/.rubocop_todo.yml +92 -4
- data/TODO.sts-refactor/00-overview.md +24 -4
- data/TODO.sts-refactor/03-namespace-coupling.md +108 -147
- data/lib/sts/iso_sts/alt_text.rb +23 -0
- data/lib/sts/iso_sts/app.rb +1 -1
- data/lib/sts/iso_sts/array.rb +1 -1
- data/lib/sts/iso_sts/disp_formula.rb +1 -1
- data/lib/sts/iso_sts/doc_number.rb +16 -0
- data/lib/sts/iso_sts/doc_type.rb +16 -0
- data/lib/sts/iso_sts/document_identification.rb +4 -4
- data/lib/sts/iso_sts/fpage.rb +23 -0
- data/lib/sts/iso_sts/graphic.rb +2 -2
- data/lib/sts/iso_sts/ics.rb +16 -0
- data/lib/sts/iso_sts/is_proof.rb +13 -0
- data/lib/sts/iso_sts/iso_meta.rb +3 -3
- data/lib/sts/iso_sts/issue.rb +23 -0
- data/lib/sts/iso_sts/long_desc.rb +23 -0
- data/lib/sts/iso_sts/lpage.rb +21 -0
- data/lib/sts/iso_sts/mixed_citation.rb +7 -7
- data/lib/sts/iso_sts/nat_meta.rb +3 -3
- data/lib/sts/iso_sts/originator.rb +16 -0
- data/lib/sts/iso_sts/page_range.rb +21 -0
- data/lib/sts/iso_sts/part_number.rb +16 -0
- data/lib/sts/iso_sts/proj_id.rb +16 -0
- data/lib/sts/iso_sts/pub_date.rb +17 -0
- data/lib/sts/iso_sts/pub_id.rb +19 -0
- data/lib/sts/iso_sts/reg_meta.rb +5 -5
- data/lib/sts/iso_sts/release_version.rb +16 -0
- data/lib/sts/{tbx_iso_tml/mi.rb → iso_sts/release_version_id.rb} +5 -7
- data/lib/sts/iso_sts/sdo.rb +16 -0
- data/lib/sts/iso_sts/secretariat.rb +3 -4
- data/lib/sts/iso_sts/standard.rb +1 -0
- data/lib/sts/iso_sts/standard_identification.rb +8 -8
- data/lib/sts/iso_sts/std_ref.rb +7 -7
- data/lib/sts/iso_sts/styled_content.rb +0 -2
- data/lib/sts/iso_sts/suppl_number.rb +16 -0
- data/lib/sts/iso_sts/suppl_type.rb +16 -0
- data/lib/sts/iso_sts/suppl_version.rb +16 -0
- data/lib/sts/iso_sts/table_wrap_foot.rb +1 -1
- data/lib/sts/iso_sts/tex_math.rb +23 -0
- data/lib/sts/iso_sts/urn.rb +16 -0
- data/lib/sts/iso_sts/version.rb +16 -0
- data/lib/sts/iso_sts/volume.rb +23 -0
- data/lib/sts/iso_sts/wi_number.rb +19 -0
- data/lib/sts/iso_sts/year.rb +21 -0
- data/lib/sts/iso_sts.rb +27 -0
- data/lib/sts/niso_sts/display_formula.rb +1 -3
- data/lib/sts/niso_sts/inline_formula.rb +1 -3
- data/lib/sts/niso_sts/standard.rb +1 -0
- data/lib/sts/tbx_iso_tml/definition.rb +1 -1
- data/lib/sts/tbx_iso_tml/note.rb +1 -1
- data/lib/sts/tbx_iso_tml/td.rb +1 -1
- data/lib/sts/tbx_iso_tml/term.rb +1 -1
- data/lib/sts/tbx_iso_tml/th.rb +1 -1
- data/lib/sts/tbx_iso_tml.rb +0 -12
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -1
- data/sts.gemspec +2 -2
- metadata +32 -18
- data/lib/sts/mathml.rb +0 -21
- data/lib/sts/tbx_iso_tml/math.rb +0 -49
- data/lib/sts/tbx_iso_tml/mfenced.rb +0 -40
- data/lib/sts/tbx_iso_tml/mfrac.rb +0 -30
- data/lib/sts/tbx_iso_tml/mrow.rb +0 -41
- data/lib/sts/tbx_iso_tml/mspace.rb +0 -18
- data/lib/sts/tbx_iso_tml/mstyle.rb +0 -29
- data/lib/sts/tbx_iso_tml/msub.rb +0 -31
- data/lib/sts/tbx_iso_tml/msup.rb +0 -25
- data/lib/sts/tbx_iso_tml/munder.rb +0 -19
- data/lib/sts/tbx_iso_tml/munderover.rb +0 -23
- data/lib/sts/tbx_iso_tml/semantics.rb +0 -27
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 13e2f7f08de69885f2e625b3e46d6d459116fe58692c735a5a003113e7a80a77
|
|
4
|
+
data.tar.gz: eb1de3ce704b4d955a89bce414ceea801ebd6d8c51ecb3c3bc73ec44b88eb6f2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 530f4e261194c92e8543cf8eb242e851be5aede2d365ff8ef7bef98f21d0f9a25e4d464632ae108b61bdbaa43d5bb77c583c8c1ec7e14bc355f78016690cc01f
|
|
7
|
+
data.tar.gz: 231aebbc44901782184e018394071dbfc98db1245960b5161158a301b32ab6640a6c1190b1f23a133059848e7dc0e977ac625a47e1ad6198520aa88caff7441b
|
data/.github/workflows/rake.yml
CHANGED
|
@@ -2,11 +2,6 @@
|
|
|
2
2
|
# See https://github.com/metanorma/cimas
|
|
3
3
|
name: release
|
|
4
4
|
|
|
5
|
-
permissions:
|
|
6
|
-
contents: write
|
|
7
|
-
packages: write
|
|
8
|
-
id-token: write
|
|
9
|
-
|
|
10
5
|
on:
|
|
11
6
|
workflow_dispatch:
|
|
12
7
|
inputs:
|
|
@@ -24,6 +19,17 @@ jobs:
|
|
|
24
19
|
uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
|
|
25
20
|
with:
|
|
26
21
|
next_version: ${{ github.event.inputs.next_version }}
|
|
22
|
+
# Explicit release_command needed since metanorma/ci#314 deprecated
|
|
23
|
+
# `bundler_cache` (hardcoded to false) — the reusable's release job no
|
|
24
|
+
# longer runs `bundle install` implicitly via ruby/setup-ruby, so the
|
|
25
|
+
# default `bundle exec rake release` fires against uninstalled gems.
|
|
26
|
+
# Surfaced by kwkwan on metanorma-plugin-lutaml#285. Deeper fix
|
|
27
|
+
# (bundle install inside rubygems-release.yml's release job) tracked
|
|
28
|
+
# separately.
|
|
29
|
+
release_command: |
|
|
30
|
+
bundle install
|
|
31
|
+
bundle exec rake release
|
|
27
32
|
secrets:
|
|
28
33
|
rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
|
|
29
34
|
pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
|
|
35
|
+
|
data/.rubocop.yml
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
|
2
|
+
# See https://github.com/metanorma/cimas
|
|
1
3
|
inherit_from:
|
|
4
|
+
- https://raw.githubusercontent.com/riboseinc/oss-guides/main/ci/rubocop.yml
|
|
5
|
+
# .rubocop_todo.yml MUST be the last entry. inherit_from is last-wins:
|
|
6
|
+
# if listed before oss-guides, the shared config's stricter Metrics/
|
|
7
|
+
# (MethodLength, BlockLength, etc.) rules override the todo's per-file
|
|
8
|
+
# grandfathering, and the todo becomes inert on those cops. Empirically
|
|
9
|
+
# verified on suma 2026-07-06: with todo listed first, 34 Metrics/* offenses
|
|
10
|
+
# remained; moved last, cleared. Every gem in the metanorma-org fleet
|
|
11
|
+
# already ships a `.rubocop_todo.yml` on its live tree (audited 2026-07-06,
|
|
12
|
+
# 54/54 have it), so this reference is safe to emit unconditionally.
|
|
2
13
|
- .rubocop_todo.yml
|
|
3
|
-
|
|
14
|
+
|
|
15
|
+
# Rubocop plugins enabled centrally so every metanorma-org gem picks them up
|
|
16
|
+
# on cimas sync — best practice belongs at the shared-template layer, not
|
|
17
|
+
# per-repo. Per ronaldtse feedback on metanorma/ci#332.
|
|
18
|
+
plugins:
|
|
19
|
+
- rubocop-rspec
|
|
20
|
+
- rubocop-performance
|
|
21
|
+
- rubocop-rake
|
|
4
22
|
|
|
5
23
|
# local repo-specific modifications
|
|
6
24
|
# ...
|
|
7
25
|
|
|
8
|
-
Metrics/BlockLength:
|
|
9
|
-
Max: 35
|
|
10
|
-
|
|
11
26
|
AllCops:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
# 3.3 matches the org-wide minimum being pushed via #274 (Raise minimum
|
|
28
|
+
# Ruby version to 3.3 due to EOL of 3.2 on 2026-03-31). Was 3.4 before
|
|
29
|
+
# this commit — 3.4 was above the org's stated minimum and would have
|
|
30
|
+
# applied Rubocop rules that fail-close on gems still targeting 3.3.
|
|
31
|
+
TargetRubyVersion: 3.3
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on 2026-
|
|
3
|
+
# on 2026-07-15 03:29:27 UTC using RuboCop version 1.86.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
7
7
|
# versions of RuboCop, may require this file to be generated again.
|
|
8
8
|
|
|
9
|
+
# Offense count: 4
|
|
10
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
11
|
+
Layout/EmptyLines:
|
|
12
|
+
Exclude:
|
|
13
|
+
- 'spec/sts_spec.rb'
|
|
14
|
+
|
|
9
15
|
# Offense count: 14
|
|
10
16
|
# This cop supports safe autocorrection (--autocorrect).
|
|
11
17
|
# Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
|
|
@@ -21,16 +27,98 @@ Layout/LineLength:
|
|
|
21
27
|
- 'spec/round_trip/reference_docs_spec.rb'
|
|
22
28
|
- 'spec/spec_helper.rb'
|
|
23
29
|
|
|
30
|
+
# Offense count: 1
|
|
31
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
32
|
+
Lint/RedundantDirGlobSort:
|
|
33
|
+
Exclude:
|
|
34
|
+
- 'spec/spec_helper.rb'
|
|
35
|
+
|
|
24
36
|
# Offense count: 1
|
|
25
37
|
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
26
38
|
Metrics/AbcSize:
|
|
27
39
|
Exclude:
|
|
28
40
|
- 'lib/sts/iso_sts/mathml2/math.rb'
|
|
29
41
|
|
|
42
|
+
# Offense count: 10
|
|
43
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode.
|
|
44
|
+
# AllowedMethods: refine
|
|
45
|
+
Metrics/BlockLength:
|
|
46
|
+
Max: 35
|
|
47
|
+
|
|
30
48
|
# Offense count: 1
|
|
31
49
|
# This cop supports safe autocorrection (--autocorrect).
|
|
32
|
-
# Configuration parameters: EnforcedStyle
|
|
33
|
-
# SupportedStyles:
|
|
34
|
-
|
|
50
|
+
# Configuration parameters: EnforcedStyle.
|
|
51
|
+
# SupportedStyles: be, be_nil
|
|
52
|
+
RSpec/BeNil:
|
|
35
53
|
Exclude:
|
|
54
|
+
- 'spec/sts_spec.rb'
|
|
55
|
+
|
|
56
|
+
# Offense count: 9
|
|
57
|
+
# Configuration parameters: IgnoredMetadata.
|
|
58
|
+
RSpec/DescribeClass:
|
|
59
|
+
Exclude:
|
|
60
|
+
- '**/spec/features/**/*'
|
|
61
|
+
- '**/spec/requests/**/*'
|
|
62
|
+
- '**/spec/routing/**/*'
|
|
63
|
+
- '**/spec/system/**/*'
|
|
64
|
+
- '**/spec/views/**/*'
|
|
65
|
+
- 'spec/anti_patterns_spec.rb'
|
|
66
|
+
- 'spec/elements/expanded_models_spec.rb'
|
|
67
|
+
- 'spec/elements/index_toc_spec.rb'
|
|
68
|
+
- 'spec/elements/missing_attributes_spec.rb'
|
|
69
|
+
- 'spec/elements/modified_elements_spec.rb'
|
|
36
70
|
- 'spec/elements/new_elements_spec.rb'
|
|
71
|
+
- 'spec/elements/reference_models_spec.rb'
|
|
72
|
+
- 'spec/elements/structural_models_spec.rb'
|
|
73
|
+
- 'spec/round_trip/reference_docs_spec.rb'
|
|
74
|
+
|
|
75
|
+
# Offense count: 1
|
|
76
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
77
|
+
RSpec/EmptyLineAfterFinalLet:
|
|
78
|
+
Exclude:
|
|
79
|
+
- 'spec/sts_spec.rb'
|
|
80
|
+
|
|
81
|
+
# Offense count: 62
|
|
82
|
+
# Configuration parameters: CountAsOne.
|
|
83
|
+
RSpec/ExampleLength:
|
|
84
|
+
Max: 40
|
|
85
|
+
|
|
86
|
+
# Offense count: 5
|
|
87
|
+
RSpec/LeakyLocalVariable:
|
|
88
|
+
Exclude:
|
|
89
|
+
- 'spec/anti_patterns_spec.rb'
|
|
90
|
+
- 'spec/round_trip/reference_docs_spec.rb'
|
|
91
|
+
|
|
92
|
+
# Offense count: 4
|
|
93
|
+
# This cop supports safe autocorrection (--autocorrect).
|
|
94
|
+
RSpec/LetBeforeExamples:
|
|
95
|
+
Exclude:
|
|
96
|
+
- 'spec/sts_spec.rb'
|
|
97
|
+
|
|
98
|
+
# Offense count: 1
|
|
99
|
+
RSpec/MultipleDescribes:
|
|
100
|
+
Exclude:
|
|
101
|
+
- 'spec/profiles/iso_iec_validator_spec.rb'
|
|
102
|
+
|
|
103
|
+
# Offense count: 67
|
|
104
|
+
RSpec/MultipleExpectations:
|
|
105
|
+
Max: 14
|
|
106
|
+
|
|
107
|
+
# Offense count: 4
|
|
108
|
+
# Configuration parameters: AllowedPatterns.
|
|
109
|
+
# AllowedPatterns: ^expect_, ^assert_
|
|
110
|
+
RSpec/NoExpectationExample:
|
|
111
|
+
Exclude:
|
|
112
|
+
- 'spec/iso_sts/iso_sts_spec.rb'
|
|
113
|
+
- 'spec/sts_spec.rb'
|
|
114
|
+
|
|
115
|
+
# Offense count: 2
|
|
116
|
+
# Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
|
|
117
|
+
# SupportedInflectors: default, active_support
|
|
118
|
+
RSpec/SpecFilePathFormat:
|
|
119
|
+
Exclude:
|
|
120
|
+
- '**/spec/routing/**/*'
|
|
121
|
+
- 'spec/sts_element_spec.rb'
|
|
122
|
+
- 'spec/sts_table_spec.rb'
|
|
123
|
+
- 'spec/iso_sts/iso_sts_spec.rb'
|
|
124
|
+
- 'spec/iso_sts/iso_sts_element_spec.rb'
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
|---|------|----------|----------|--------------|
|
|
20
20
|
| 01 | `01-mathml-delegation.md` | Anti-Pattern Fix | DONE | — |
|
|
21
21
|
| 02 | `02-type-resolution.md` | Anti-Pattern Fix | DONE | — |
|
|
22
|
-
| 03 | `03-namespace-coupling.md` | Architecture | IN PROGRESS | 01, 02 |
|
|
22
|
+
| 03 | `03-namespace-coupling.md` | Architecture | IN PROGRESS (63→20 refs) | 01, 02 |
|
|
23
23
|
| 04 | `04-register-versioning.md` | Architecture | HIGH | 01, 02 |
|
|
24
24
|
| 05 | `05-missing-elements.md` | Feature Gap | MOSTLY DONE | 04 |
|
|
25
25
|
| 06 | `06-missing-attributes.md` | Feature Gap | DONE | 04 |
|
|
@@ -140,7 +140,9 @@ grep -r "method_missing|respond_to_missing|Object.const_get|\.send" lib/
|
|
|
140
140
|
```
|
|
141
141
|
|
|
142
142
|
### IsoSts Namespace Independence (2026-05-07)
|
|
143
|
-
- ARCHITECTURE DECISION: IsoSts
|
|
143
|
+
- ARCHITECTURE DECISION: IsoSts must be independent **of NisoSts**. This is not
|
|
144
|
+
independence in general — `lib/sts/iso_sts/` still references `TbxIsoTml` and
|
|
145
|
+
MathML types directly, and those shared namespaces are outside this ADR.
|
|
144
146
|
- ISOSTS is frozen legacy; NISO STS evolves — combining them violates OCP
|
|
145
147
|
- Created 11 new IsoSts-specific types: Monospace, Sc, Strike, Underline, Uri,
|
|
146
148
|
NamedContent, StandardRef, MetaDate, ContentLanguage (with autoloads)
|
|
@@ -164,9 +166,27 @@ grep -r "method_missing|respond_to_missing|Object.const_get|\.send" lib/
|
|
|
164
166
|
- ~~Expand StringName usage (in contrib, element-citation, related-article — NISO STS 1.2)~~ → DONE: added to name-alternatives; already in person-group and mixed-citation
|
|
165
167
|
|
|
166
168
|
### Architectural Items (High Effort)
|
|
167
|
-
- `03-namespace-coupling.md` — IN PROGRESS:
|
|
169
|
+
- `03-namespace-coupling.md` — IN PROGRESS: 63→20 IsoSts→NisoSts references
|
|
170
|
+
remaining (issue #40). Source of truth is `ISOSTS.xsd`, NOT the NisoSts
|
|
171
|
+
models — they disagree on nearly every element.
|
|
168
172
|
- `04-register-versioning.md` — Version the models via lutaml-model Registers
|
|
169
173
|
- `11-duplicate-models.md` — 44 overlapping element resolution (depends on 03)
|
|
170
174
|
|
|
175
|
+
### Known bugs — schema conformance (separate from 03)
|
|
176
|
+
The 2026-05-07 "@id added to all models (XSD-verified)" pass verified against
|
|
177
|
+
the **NISO** XSD and applied the result to IsoSts. ISOSTS disagrees:
|
|
178
|
+
- **16 IsoSts models silently drop ISOSTS attributes that exist** — real data
|
|
179
|
+
loss. `sub`/`sup` lose `arrange`+`specific-use`; `ext-link` loses 5 xlink
|
|
180
|
+
attrs; `mixed-citation` loses 6; `graphic`, `copyright-*`, `edition`,
|
|
181
|
+
`title`, `label`, `uri`, `named-content`, `underline`, `meta-date`, `body`
|
|
182
|
+
lose others.
|
|
183
|
+
- **25 IsoSts models carry an `@id` ISOSTS does not define** — harmless (never
|
|
184
|
+
populated on parse, never emitted on serialise), but dead surface.
|
|
185
|
+
|
|
171
186
|
## Next Action
|
|
172
|
-
|
|
187
|
+
Two independent tracks:
|
|
188
|
+
1. Finish `03` — the 20 remaining refs split into 11 deep-root refs (each
|
|
189
|
+
reaching a ~152-class recursive core) and 9 child-bearing refs whose closure
|
|
190
|
+
is unmeasured. Both need sizing before planning.
|
|
191
|
+
2. File and fix the 16 lossy models above — real data loss, unrelated to
|
|
192
|
+
decoupling.
|
|
@@ -3,156 +3,117 @@
|
|
|
3
3
|
**Priority**: HIGH
|
|
4
4
|
**Category**: Architecture
|
|
5
5
|
**Estimated Effort**: High
|
|
6
|
-
**
|
|
6
|
+
**Status**: Partially done — 63 → 20 references (GitHub issue #40)
|
|
7
7
|
|
|
8
8
|
## Problem
|
|
9
9
|
|
|
10
|
-
`lib/sts/iso_sts
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
map_attribute "style-type", to: :style_type
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
end
|
|
118
|
-
end
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Implementation Strategy
|
|
122
|
-
|
|
123
|
-
1. **Phase 1**: Identify all shared element types (bold, italic, sub, sup, p, etc.)
|
|
124
|
-
2. **Phase 2**: Create base types with MINIMAL shared attributes
|
|
125
|
-
3. **Phase 3**: Refactor IsoSts to extend bases
|
|
126
|
-
4. **Phase 4**: Refactor NisoSts to extend bases
|
|
127
|
-
5. **Phase 5**: Delete `Sts::NisoSts::*` references from IsoSts content groups
|
|
128
|
-
|
|
129
|
-
## Files to Refactor
|
|
130
|
-
|
|
131
|
-
Primary targets:
|
|
132
|
-
- `lib/sts/iso_sts/content_groups/highlight_elements.rb`
|
|
133
|
-
- `lib/sts/iso_sts/content_groups/emphasis_elements.rb` (if exists)
|
|
134
|
-
- `lib/sts/niso_sts/content_groups/highlight_elements.rb`
|
|
10
|
+
`lib/sts/iso_sts/` references `Sts::NisoSts::*` types directly. IsoSts must be
|
|
11
|
+
independent of NisoSts (ADR 2026-05-07): ISOSTS is frozen legacy, NISO STS
|
|
12
|
+
evolves, so coupling them violates OCP.
|
|
13
|
+
|
|
14
|
+
PR #31 reduced this from 157 to 63 references. Issue #40 reduced it further,
|
|
15
|
+
from 63 to 20.
|
|
16
|
+
|
|
17
|
+
## Source of truth: ISOSTS.xsd, NOT the NisoSts models
|
|
18
|
+
|
|
19
|
+
The obvious approach — duplicate each NisoSts class into IsoSts — produces
|
|
20
|
+
**schema-incorrect models**. The NisoSts models disagree with
|
|
21
|
+
`reference-docs/isosts-v1/xsd/ISOSTS.xsd` on nearly every element:
|
|
22
|
+
|
|
23
|
+
| Element | ISOSTS says | NisoSts model |
|
|
24
|
+
|---|---|---|
|
|
25
|
+
| `year` (:948) | `content-type`, `specific-use`, `xml:lang` — no `@id` | `@id` only |
|
|
26
|
+
| `doc-type` (:6378) | `type="xs:string"` — no attributes at all | `@id` + content |
|
|
27
|
+
| `ics` (:6373) | `type="xs:string"` | `@id` + `ics-desc` child |
|
|
28
|
+
| `fpage` | `content-type`, `seq`, `specific-use`, `xml:lang`; no children | `@id` + bold/italic |
|
|
29
|
+
| `license` (:51) | `license-type`, `specific-use`, `xml:lang` | `@id`, `xlink:href` |
|
|
30
|
+
| `ruby` | **not an ISOSTS element** | exists (NISO only) |
|
|
31
|
+
|
|
32
|
+
`feature_doc.xml` declares `<!DOCTYPE standard SYSTEM ".../ISOSTS.dtd">`, and
|
|
33
|
+
the ISOSTS DTD agrees with ISOSTS.xsd (both derive `bold`, `sub` etc. from the
|
|
34
|
+
JATS 0.4 modules). ISOSTS.xsd is a faithful conversion and is the authority.
|
|
35
|
+
|
|
36
|
+
**Round-tripping does not prove correctness.** A model that invents or drops an
|
|
37
|
+
attribute still parses and serialises symmetrically, so the suite stays green
|
|
38
|
+
while the model is wrong. Assert the exact attribute set per element instead.
|
|
39
|
+
|
|
40
|
+
Attribute lists must be **generated** from the XSD, never hand-read: `version`
|
|
41
|
+
on `tex-math` and `specific-use` on `pub-id` sit after long `xs:enumeration`
|
|
42
|
+
blocks and are invisible to a truncated read.
|
|
43
|
+
|
|
44
|
+
## Done in issue #40 — 43 refs removed, 27 classes added
|
|
45
|
+
|
|
46
|
+
- **14 `xs:string` elements** (`originator`, `doc-type`, `doc-number`,
|
|
47
|
+
`part-number`, `version`, `suppl-type`, `suppl-number`, `suppl-version`,
|
|
48
|
+
`urn`, `sdo`, `proj-id`, `release-version`, `ics`, `secretariat`) — modelled
|
|
49
|
+
as content-only IsoSts classes with no attributes. 23 refs.
|
|
50
|
+
- **3 `permissions` refs** repointed to the existing `IsoSts::Permissions`.
|
|
51
|
+
- **`ruby` deleted** from `StyledContent` — ISOSTS defines no such element.
|
|
52
|
+
Behaviour change: `<ruby>` in `<styled-content>` no longer round-trips.
|
|
53
|
+
- **13 element classes** modelled from ISOSTS.xsd: `Year`, `PubDate`,
|
|
54
|
+
`ReleaseVersionId`, `IsProof`, `AltText`, `LongDesc`, `TexMath`, `PubId`,
|
|
55
|
+
`Volume`, `Issue`, `Fpage`, `Lpage`, `PageRange`. 16 refs.
|
|
56
|
+
- **`WiNumber` added** — ISOSTS gives `wi-number` an `@id`; it was typed as a
|
|
57
|
+
plain string, silently discarding that `@id`.
|
|
58
|
+
|
|
59
|
+
### Why classes and not plain `:string`
|
|
60
|
+
|
|
61
|
+
`xs:string` elements look like they need no class. They do: an empty element
|
|
62
|
+
(`<sdo/>`, which `feature_doc.xml` contains) does not survive a `:string`
|
|
63
|
+
round-trip. For a scalar, `render_empty: :empty` recovers it; for a collection
|
|
64
|
+
(`secretariat`, `ics` — both `maxOccurs="unbounded"`) an empty element parses
|
|
65
|
+
to `[]`, destroying the information at parse time before any render option
|
|
66
|
+
applies. Content-only classes round-trip every case.
|
|
67
|
+
|
|
68
|
+
## Remaining — 20 refs
|
|
69
|
+
|
|
70
|
+
**11 refs to 9 deep roots**: `MetadataStd`, `ElementCitation`, `PersonGroup`,
|
|
71
|
+
`Collab`, `Source`, `DispQuote`, `EditingInstruction`, `TermDisplay`,
|
|
72
|
+
`BoxedText`. Each reaches the same ~152-class mutually-recursive core
|
|
73
|
+
(`Section` → `Paragraph` → `DispQuote` → `Paragraph`). `DispQuote` has 3 direct
|
|
74
|
+
children but pulls all 152. No incremental path — needs its own decision.
|
|
75
|
+
|
|
76
|
+
**9 refs whose ISOSTS content models have real children**, closure not measured:
|
|
77
|
+
`attrib` (:1082), `term-head` (:4308), `article-title`, `license` → `license-p`
|
|
78
|
+
(:51), `publisher` → `publisher-loc`, `custom-meta-group` → `custom-meta`.
|
|
79
|
+
`attrib` and `term-head` are **not** trivial leaves in ISOSTS despite what the
|
|
80
|
+
NisoSts models suggest; `license-p` reaches `array`/`alternatives`, so these may
|
|
81
|
+
not be cheap. Measure before planning.
|
|
82
|
+
|
|
83
|
+
## Rejected: three-tier `Sts::Base` hierarchy
|
|
84
|
+
|
|
85
|
+
An earlier draft of this document proposed shared base types in `Sts::Base` that
|
|
86
|
+
both namespaces inherit. This contradicts the 2026-05-07 ADR, and the schemas
|
|
87
|
+
genuinely diverge — `IsoSts::Fig` has `title`/`alternatives` that
|
|
88
|
+
`NisoSts::Figure` lacks; `IsoSts::Ref` has `nlm-citation`/`citation-alternatives`
|
|
89
|
+
that `NisoSts::Reference` lacks. A shared base would fight the schemas.
|
|
90
|
+
|
|
91
|
+
That draft also targeted `lib/sts/iso_sts/content_groups/highlight_elements.rb`
|
|
92
|
+
and "194+ references" to emphasis types. That file was deleted as dead code; the
|
|
93
|
+
real work was metadata types, not highlight elements.
|
|
94
|
+
|
|
95
|
+
## Naming trap (for the deferred work)
|
|
96
|
+
|
|
97
|
+
A mechanical `s/NisoSts::/IsoSts::/` is wrong. Nine elements already have
|
|
98
|
+
different class names per namespace, so a blind rename creates `IsoSts::Section`
|
|
99
|
+
alongside the existing `IsoSts::Sec` — two classes for one `sec` element:
|
|
100
|
+
|
|
101
|
+
`Section`/`Sec`, `Figure`/`Fig`, `Reference`/`Ref`, `ReferenceList`/`RefList`,
|
|
102
|
+
`SectionArray`/`Array`, `StdCrossReference`/`StandardCrossReference`,
|
|
103
|
+
`DisplayFormula`/`DispFormula`, `TermSection`/`TermSec`,
|
|
104
|
+
`ReferenceStandard`/`Std`.
|
|
105
|
+
|
|
106
|
+
Remap child references by **XML element name**, not class name.
|
|
107
|
+
|
|
108
|
+
## Scope boundary
|
|
109
|
+
|
|
110
|
+
Independence from NisoSts is not independence in general: `lib/sts/iso_sts/`
|
|
111
|
+
still references 6 `TbxIsoTml` types directly, and much of the deferred closure
|
|
112
|
+
reaches `TbxIsoTml`/MathML. Those are shared namespaces, outside this ADR.
|
|
135
113
|
|
|
136
114
|
## Verification
|
|
137
115
|
|
|
138
|
-
1.
|
|
139
|
-
2.
|
|
140
|
-
3.
|
|
141
|
-
|
|
142
|
-
## Dependencies
|
|
143
|
-
|
|
144
|
-
- `01-mathml-delegation.md` — uses similar patterns
|
|
145
|
-
- `02-type-resolution.md` — must be clean first
|
|
146
|
-
|
|
147
|
-
## TODO Checklist
|
|
148
|
-
|
|
149
|
-
- [ ] Audit all IsoSts → NisoSts references
|
|
150
|
-
- [ ] Categorize by shared vs. truly namespace-specific
|
|
151
|
-
- [ ] Design base type hierarchy
|
|
152
|
-
- [ ] Create `lib/sts/base/` directory structure
|
|
153
|
-
- [ ] Implement base types for shared elements
|
|
154
|
-
- [ ] Refactor IsoSts to use base types
|
|
155
|
-
- [ ] Refactor NisoSts to use base types
|
|
156
|
-
- [ ] Remove cross-namespace references
|
|
157
|
-
- [ ] Verify no circular dependencies
|
|
158
|
-
- [ ] Run full test suite
|
|
116
|
+
1. `grep -rho "Sts::NisoSts::" lib/sts/iso_sts/ | wc -l` → `20`
|
|
117
|
+
2. Every attribute on an IsoSts model traces to a line in `ISOSTS.xsd`
|
|
118
|
+
3. Autoload registry 1:1 with the directory (112/112)
|
|
119
|
+
4. `bundle exec rspec` green; `bundle exec rubocop` clean
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sts
|
|
4
|
+
module IsoSts
|
|
5
|
+
class AltText < Lutaml::Model::Serializable
|
|
6
|
+
attribute :content, :string
|
|
7
|
+
attribute :id, :string
|
|
8
|
+
attribute :content_type, :string
|
|
9
|
+
attribute :specific_use, :string
|
|
10
|
+
attribute :xml_lang, :string
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
element "alt-text"
|
|
14
|
+
|
|
15
|
+
map_content to: :content
|
|
16
|
+
map_attribute "id", to: :id
|
|
17
|
+
map_attribute "content-type", to: :content_type
|
|
18
|
+
map_attribute "specific-use", to: :specific_use
|
|
19
|
+
map_attribute "xml:lang", to: :xml_lang
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
data/lib/sts/iso_sts/app.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Sts
|
|
|
15
15
|
attribute :term_sec, ::Sts::IsoSts::TermSec, collection: true
|
|
16
16
|
attribute :fn_group, ::Sts::IsoSts::FnGroup, collection: true
|
|
17
17
|
attribute :ref_list, ::Sts::IsoSts::RefList, collection: true
|
|
18
|
-
attribute :permissions, ::Sts::
|
|
18
|
+
attribute :permissions, ::Sts::IsoSts::Permissions
|
|
19
19
|
attribute :non_normative_note, ::Sts::IsoSts::NonNormativeNote,
|
|
20
20
|
collection: true
|
|
21
21
|
attribute :non_normative_example, ::Sts::IsoSts::NonNormativeExample,
|
data/lib/sts/iso_sts/array.rb
CHANGED
|
@@ -12,7 +12,7 @@ module Sts
|
|
|
12
12
|
attribute :label, ::Sts::IsoSts::Label
|
|
13
13
|
attribute :table, ::Sts::IsoSts::Table
|
|
14
14
|
attribute :attrib, ::Sts::NisoSts::Attrib, collection: true
|
|
15
|
-
attribute :permissions, ::Sts::
|
|
15
|
+
attribute :permissions, ::Sts::IsoSts::Permissions, collection: true
|
|
16
16
|
|
|
17
17
|
xml do
|
|
18
18
|
element "array"
|
|
@@ -17,7 +17,7 @@ module Sts
|
|
|
17
17
|
attribute :styled_content, ::Sts::IsoSts::StyledContent
|
|
18
18
|
attribute :preformat, ::Sts::IsoSts::Preformat
|
|
19
19
|
attribute :graphic, ::Sts::IsoSts::Graphic, collection: true
|
|
20
|
-
attribute :tex_math, ::Sts::
|
|
20
|
+
attribute :tex_math, ::Sts::IsoSts::TexMath
|
|
21
21
|
|
|
22
22
|
xml do
|
|
23
23
|
element "disp-formula"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sts
|
|
4
|
+
module IsoSts
|
|
5
|
+
# ISOSTS declares <doc-number> as type="xs:string" -- no attributes.
|
|
6
|
+
class DocNumber < Lutaml::Model::Serializable
|
|
7
|
+
attribute :content, :string
|
|
8
|
+
|
|
9
|
+
xml do
|
|
10
|
+
element "doc-number"
|
|
11
|
+
|
|
12
|
+
map_content to: :content
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Sts
|
|
4
|
+
module IsoSts
|
|
5
|
+
# ISOSTS declares <doc-type> as type="xs:string" -- no attributes.
|
|
6
|
+
class DocType < Lutaml::Model::Serializable
|
|
7
|
+
attribute :content, :string
|
|
8
|
+
|
|
9
|
+
xml do
|
|
10
|
+
element "doc-type"
|
|
11
|
+
|
|
12
|
+
map_content to: :content
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -4,11 +4,11 @@ module Sts
|
|
|
4
4
|
module IsoSts
|
|
5
5
|
class DocumentIdentification < Lutaml::Model::Serializable
|
|
6
6
|
attribute :id, :string
|
|
7
|
-
attribute :sdo, ::Sts::
|
|
8
|
-
attribute :proj_id, ::Sts::
|
|
7
|
+
attribute :sdo, ::Sts::IsoSts::Sdo
|
|
8
|
+
attribute :proj_id, ::Sts::IsoSts::ProjId
|
|
9
9
|
attribute :language, ::Sts::IsoSts::Language
|
|
10
|
-
attribute :release_version, ::Sts::
|
|
11
|
-
attribute :urn, ::Sts::
|
|
10
|
+
attribute :release_version, ::Sts::IsoSts::ReleaseVersion
|
|
11
|
+
attribute :urn, ::Sts::IsoSts::Urn
|
|
12
12
|
|
|
13
13
|
xml do
|
|
14
14
|
element "doc-ident"
|