@driftsys/markspec 0.4.0 → 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.
- package/README.md +74 -20
- package/esm/ast/build.d.ts +60 -0
- package/esm/ast/build.d.ts.map +1 -0
- package/esm/ast/build.js +516 -0
- package/esm/ast/equivalence.d.ts +18 -0
- package/esm/ast/equivalence.d.ts.map +1 -0
- package/esm/ast/equivalence.js +56 -0
- package/esm/ast/nodes.d.ts +189 -0
- package/esm/ast/nodes.d.ts.map +1 -0
- package/esm/ast/nodes.js +17 -0
- package/esm/ast/normalize.d.ts +58 -0
- package/esm/ast/normalize.d.ts.map +1 -0
- package/esm/ast/normalize.js +197 -0
- package/esm/ast/render.d.ts +34 -0
- package/esm/ast/render.d.ts.map +1 -0
- package/esm/ast/render.js +215 -0
- package/esm/compiler/constants.d.ts +16 -0
- package/esm/compiler/constants.d.ts.map +1 -0
- package/esm/compiler/constants.js +26 -0
- package/esm/compiler/discipline_classifier.d.ts +55 -0
- package/esm/compiler/discipline_classifier.d.ts.map +1 -0
- package/esm/compiler/discipline_classifier.js +191 -0
- package/esm/compiler/inverses.d.ts +2 -1
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +33 -14
- package/esm/compiler/manifest.d.ts +59 -0
- package/esm/compiler/manifest.d.ts.map +1 -0
- package/esm/compiler/manifest.js +48 -0
- package/esm/compiler/mod.d.ts +38 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +202 -50
- package/esm/compiler/ndjson_writer.d.ts +50 -0
- package/esm/compiler/ndjson_writer.d.ts.map +1 -0
- package/esm/compiler/ndjson_writer.js +73 -0
- package/esm/compiler/schema.d.ts +33 -1
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +30 -9
- package/esm/config/markspec.d.ts +5 -0
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +17 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +54 -0
- package/esm/formatter/mod.d.ts +55 -4
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +423 -46
- package/esm/formatter/synth_ulid.d.ts +21 -0
- package/esm/formatter/synth_ulid.d.ts.map +1 -0
- package/esm/formatter/synth_ulid.js +64 -0
- package/esm/lexicons/loader.d.ts +35 -0
- package/esm/lexicons/loader.d.ts.map +1 -0
- package/esm/lexicons/loader.js +51 -0
- package/esm/lexicons/mod.d.ts +13 -0
- package/esm/lexicons/mod.d.ts.map +1 -0
- package/esm/lexicons/mod.js +12 -0
- package/esm/lint/glossary.d.ts +45 -0
- package/esm/lint/glossary.d.ts.map +1 -0
- package/esm/lint/glossary.js +85 -0
- package/esm/lint/mod.d.ts +14 -0
- package/esm/lint/mod.d.ts.map +1 -0
- package/esm/lint/mod.js +9 -0
- package/esm/lint/range_util.d.ts +25 -0
- package/esm/lint/range_util.d.ts.map +1 -0
- package/esm/lint/range_util.js +50 -0
- package/esm/lint/rules/ears.d.ts +39 -0
- package/esm/lint/rules/ears.d.ts.map +1 -0
- package/esm/lint/rules/ears.js +316 -0
- package/esm/lint/rules/incose_sentence.d.ts +46 -0
- package/esm/lint/rules/incose_sentence.d.ts.map +1 -0
- package/esm/lint/rules/incose_sentence.js +417 -0
- package/esm/lint/rules/lexicon.d.ts +24 -0
- package/esm/lint/rules/lexicon.d.ts.map +1 -0
- package/esm/lint/rules/lexicon.js +236 -0
- package/esm/lint/rules/modal_sentence.d.ts +46 -0
- package/esm/lint/rules/modal_sentence.d.ts.map +1 -0
- package/esm/lint/rules/modal_sentence.js +146 -0
- package/esm/lint/rules/passive.d.ts +64 -0
- package/esm/lint/rules/passive.d.ts.map +1 -0
- package/esm/lint/rules/passive.js +282 -0
- package/esm/lint/rules/struct.d.ts +17 -0
- package/esm/lint/rules/struct.d.ts.map +1 -0
- package/esm/lint/rules/struct.js +55 -0
- package/esm/lint/rules/suppression.d.ts +54 -0
- package/esm/lint/rules/suppression.d.ts.map +1 -0
- package/esm/lint/rules/suppression.js +129 -0
- package/esm/lint/rules/xref.d.ts +19 -0
- package/esm/lint/rules/xref.d.ts.map +1 -0
- package/esm/lint/rules/xref.js +248 -0
- package/esm/lint/runner.d.ts +59 -0
- package/esm/lint/runner.d.ts.map +1 -0
- package/esm/lint/runner.js +153 -0
- package/esm/lint/score.d.ts +64 -0
- package/esm/lint/score.d.ts.map +1 -0
- package/esm/lint/score.js +163 -0
- package/esm/lint/segmenter.d.ts +32 -0
- package/esm/lint/segmenter.d.ts.map +1 -0
- package/esm/lint/segmenter.js +79 -0
- package/esm/lint/types.d.ts +31 -0
- package/esm/lint/types.d.ts.map +1 -0
- package/esm/lint/types.js +9 -0
- package/esm/lock/canonical_edges.d.ts +31 -0
- package/esm/lock/canonical_edges.d.ts.map +1 -0
- package/esm/lock/canonical_edges.js +57 -0
- package/esm/lock/check.d.ts +24 -0
- package/esm/lock/check.d.ts.map +1 -0
- package/esm/lock/check.js +127 -0
- package/esm/lock/hash.d.ts +12 -0
- package/esm/lock/hash.d.ts.map +1 -0
- package/esm/lock/hash.js +32 -0
- package/esm/lock/mod.d.ts +19 -0
- package/esm/lock/mod.d.ts.map +1 -0
- package/esm/lock/mod.js +14 -0
- package/esm/lock/model.d.ts +81 -0
- package/esm/lock/model.d.ts.map +1 -0
- package/esm/lock/model.js +7 -0
- package/esm/lock/parser.d.ts +26 -0
- package/esm/lock/parser.d.ts.map +1 -0
- package/esm/lock/parser.js +195 -0
- package/esm/lock/resolve.d.ts +142 -0
- package/esm/lock/resolve.d.ts.map +1 -0
- package/esm/lock/resolve.js +389 -0
- package/esm/lock/serializer.d.ts +14 -0
- package/esm/lock/serializer.d.ts.map +1 -0
- package/esm/lock/serializer.js +104 -0
- package/esm/mod.d.ts +28 -8
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +23 -4
- package/esm/model/attributes.d.ts +6 -0
- package/esm/model/attributes.d.ts.map +1 -1
- package/esm/model/attributes.js +200 -2
- package/esm/model/discipline.d.ts +53 -0
- package/esm/model/discipline.d.ts.map +1 -0
- package/esm/model/discipline.js +50 -0
- package/esm/model/discriminating_attr.d.ts +33 -0
- package/esm/model/discriminating_attr.d.ts.map +1 -0
- package/esm/model/discriminating_attr.js +74 -0
- package/esm/model/mod.d.ts +267 -14
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +99 -3
- package/esm/model/profile.d.ts +102 -27
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/model/source_introspection.d.ts +26 -0
- package/esm/model/source_introspection.d.ts.map +1 -0
- package/esm/model/source_introspection.js +77 -0
- package/esm/model/type_hierarchy.d.ts +51 -0
- package/esm/model/type_hierarchy.d.ts.map +1 -0
- package/esm/model/type_hierarchy.js +126 -0
- package/esm/model/uri_scheme_map.d.ts +21 -0
- package/esm/model/uri_scheme_map.d.ts.map +1 -0
- package/esm/model/uri_scheme_map.js +66 -0
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +10 -16
- package/esm/parser/body_tokens.d.ts +35 -0
- package/esm/parser/body_tokens.d.ts.map +1 -0
- package/esm/parser/body_tokens.js +232 -0
- package/esm/parser/glossary.d.ts +51 -0
- package/esm/parser/glossary.d.ts.map +1 -0
- package/esm/parser/glossary.js +219 -0
- package/esm/parser/grammars.d.ts +5 -3
- package/esm/parser/grammars.d.ts.map +1 -1
- package/esm/parser/grammars.js +12 -4
- package/esm/parser/language_spec.d.ts +55 -0
- package/esm/parser/language_spec.d.ts.map +1 -0
- package/esm/parser/language_spec.js +419 -0
- package/esm/parser/line_map.d.ts +60 -0
- package/esm/parser/line_map.d.ts.map +1 -0
- package/esm/parser/line_map.js +41 -0
- package/esm/parser/markdown.d.ts +9 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +317 -25
- package/esm/parser/mod.d.ts +5 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +31 -8
- package/esm/parser/source.d.ts +53 -2
- package/esm/parser/source.d.ts.map +1 -1
- package/esm/parser/source.js +158 -68
- package/esm/parser/translate.d.ts +24 -0
- package/esm/parser/translate.d.ts.map +1 -0
- package/esm/parser/translate.js +99 -0
- package/esm/profile/chain.d.ts +8 -0
- package/esm/profile/chain.d.ts.map +1 -1
- package/esm/profile/chain.js +32 -14
- package/esm/profile/colors.js +1 -1
- package/esm/profile/default_profile.d.ts +25 -0
- package/esm/profile/default_profile.d.ts.map +1 -0
- package/esm/profile/default_profile.js +43 -0
- package/esm/profile/discipline_mode.d.ts +64 -0
- package/esm/profile/discipline_mode.d.ts.map +1 -0
- package/esm/profile/discipline_mode.js +133 -0
- package/esm/profile/discipline_registry.d.ts +41 -0
- package/esm/profile/discipline_registry.d.ts.map +1 -0
- package/esm/profile/discipline_registry.js +67 -0
- package/esm/profile/introspect.d.ts +135 -0
- package/esm/profile/introspect.d.ts.map +1 -0
- package/esm/profile/introspect.js +378 -0
- package/esm/profile/load.d.ts +3 -1
- package/esm/profile/load.d.ts.map +1 -1
- package/esm/profile/load.js +91 -5
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +512 -90
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +251 -39
- package/esm/profile/mod.d.ts +4 -4
- package/esm/profile/mod.d.ts.map +1 -1
- package/esm/profile/mod.js +7 -2
- package/esm/reporter/mod.js +4 -4
- package/esm/sync/locked_attributes.d.ts +19 -0
- package/esm/sync/locked_attributes.d.ts.map +1 -0
- package/esm/sync/locked_attributes.js +27 -0
- package/esm/sync/log.d.ts +34 -0
- package/esm/sync/log.d.ts.map +1 -0
- package/esm/sync/log.js +48 -0
- package/esm/sync/mapping.d.ts +66 -0
- package/esm/sync/mapping.d.ts.map +1 -0
- package/esm/sync/mapping.js +165 -0
- package/esm/sync/mod.d.ts +16 -0
- package/esm/sync/mod.d.ts.map +1 -0
- package/esm/sync/mod.js +12 -0
- package/esm/sync/status.d.ts +23 -0
- package/esm/sync/status.d.ts.map +1 -0
- package/esm/sync/status.js +21 -0
- package/esm/typl/ast.d.ts +87 -0
- package/esm/typl/ast.d.ts.map +1 -0
- package/esm/typl/ast.js +21 -0
- package/esm/typl/bridge.d.ts +32 -0
- package/esm/typl/bridge.d.ts.map +1 -0
- package/esm/typl/bridge.js +27 -0
- package/esm/typl/bullet.d.ts +34 -0
- package/esm/typl/bullet.d.ts.map +1 -0
- package/esm/typl/bullet.js +44 -0
- package/esm/typl/diagnostics.d.ts +43 -0
- package/esm/typl/diagnostics.d.ts.map +1 -0
- package/esm/typl/diagnostics.js +61 -0
- package/esm/typl/fence.d.ts +31 -0
- package/esm/typl/fence.d.ts.map +1 -0
- package/esm/typl/fence.js +24 -0
- package/esm/typl/grammar.d.ts +20 -0
- package/esm/typl/grammar.d.ts.map +1 -0
- package/esm/typl/grammar.js +471 -0
- package/esm/typl/inline.d.ts +34 -0
- package/esm/typl/inline.d.ts.map +1 -0
- package/esm/typl/inline.js +48 -0
- package/esm/typl/lexer.d.ts +37 -0
- package/esm/typl/lexer.d.ts.map +1 -0
- package/esm/typl/lexer.js +234 -0
- package/esm/typl/mod.d.ts +23 -0
- package/esm/typl/mod.d.ts.map +1 -0
- package/esm/typl/mod.js +16 -0
- package/esm/typl/registry.d.ts +42 -0
- package/esm/typl/registry.d.ts.map +1 -0
- package/esm/typl/registry.js +26 -0
- package/esm/typl/validator.d.ts +29 -0
- package/esm/typl/validator.d.ts.map +1 -0
- package/esm/typl/validator.js +141 -0
- package/esm/util/fence.d.ts +30 -0
- package/esm/util/fence.d.ts.map +1 -0
- package/esm/util/fence.js +40 -0
- package/esm/util/line_endings.d.ts +33 -0
- package/esm/util/line_endings.d.ts.map +1 -0
- package/esm/util/line_endings.js +53 -0
- package/esm/util/modals.d.ts +29 -0
- package/esm/util/modals.d.ts.map +1 -0
- package/esm/util/modals.js +38 -0
- package/esm/validator/attributes.d.ts +3 -3
- package/esm/validator/attributes.d.ts.map +1 -1
- package/esm/validator/attributes.js +1 -18
- package/esm/validator/body_blocks.d.ts +38 -0
- package/esm/validator/body_blocks.d.ts.map +1 -0
- package/esm/validator/body_blocks.js +218 -0
- package/esm/validator/caption_convention.d.ts +29 -0
- package/esm/validator/caption_convention.d.ts.map +1 -0
- package/esm/validator/caption_convention.js +58 -0
- package/esm/validator/captions.d.ts +22 -0
- package/esm/validator/captions.d.ts.map +1 -0
- package/esm/validator/captions.js +137 -0
- package/esm/validator/component_schemes.d.ts +73 -0
- package/esm/validator/component_schemes.d.ts.map +1 -0
- package/esm/validator/component_schemes.js +375 -0
- package/esm/validator/discipline.d.ts +35 -0
- package/esm/validator/discipline.d.ts.map +1 -0
- package/esm/validator/discipline.js +204 -0
- package/esm/validator/feature_ac.d.ts +28 -0
- package/esm/validator/feature_ac.d.ts.map +1 -0
- package/esm/validator/feature_ac.js +102 -0
- package/esm/validator/listing.d.ts +42 -0
- package/esm/validator/listing.d.ts.map +1 -0
- package/esm/validator/listing.js +295 -0
- package/esm/validator/mod.d.ts +3 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +275 -13
- package/esm/validator/modal_keywords.d.ts +25 -0
- package/esm/validator/modal_keywords.d.ts.map +1 -0
- package/esm/validator/modal_keywords.js +54 -0
- package/esm/validator/pattern.d.ts +15 -8
- package/esm/validator/pattern.d.ts.map +1 -1
- package/esm/validator/pattern.js +42 -19
- package/esm/validator/per_type_attrs.d.ts +29 -0
- package/esm/validator/per_type_attrs.d.ts.map +1 -0
- package/esm/validator/per_type_attrs.js +75 -0
- package/esm/validator/pipeline.d.ts +18 -2
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +76 -21
- package/esm/validator/trace_types.d.ts +26 -0
- package/esm/validator/trace_types.d.ts.map +1 -0
- package/esm/validator/trace_types.js +232 -0
- package/esm/validator/traceability.d.ts +3 -4
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +5 -10
- package/esm/validator/type_resolution.d.ts +67 -0
- package/esm/validator/type_resolution.d.ts.map +1 -0
- package/esm/validator/type_resolution.js +162 -0
- package/esm/validator/types.d.ts +45 -0
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +128 -16
- package/esm/validator/value_types.d.ts +8 -0
- package/esm/validator/value_types.d.ts.map +1 -1
- package/esm/validator/value_types.js +8 -1
- package/package.json +2 -2
- package/script/ast/build.d.ts +60 -0
- package/script/ast/build.d.ts.map +1 -0
- package/script/ast/build.js +521 -0
- package/script/ast/equivalence.d.ts +18 -0
- package/script/ast/equivalence.d.ts.map +1 -0
- package/script/ast/equivalence.js +59 -0
- package/script/ast/nodes.d.ts +189 -0
- package/script/ast/nodes.d.ts.map +1 -0
- package/script/ast/nodes.js +18 -0
- package/script/ast/normalize.d.ts +58 -0
- package/script/ast/normalize.d.ts.map +1 -0
- package/script/ast/normalize.js +200 -0
- package/script/ast/render.d.ts +34 -0
- package/script/ast/render.d.ts.map +1 -0
- package/script/ast/render.js +218 -0
- package/script/compiler/constants.d.ts +16 -0
- package/script/compiler/constants.d.ts.map +1 -0
- package/script/compiler/constants.js +29 -0
- package/script/compiler/discipline_classifier.d.ts +55 -0
- package/script/compiler/discipline_classifier.d.ts.map +1 -0
- package/script/compiler/discipline_classifier.js +196 -0
- package/script/compiler/inverses.d.ts +2 -1
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +33 -14
- package/script/compiler/manifest.d.ts +59 -0
- package/script/compiler/manifest.d.ts.map +1 -0
- package/script/compiler/manifest.js +51 -0
- package/script/compiler/mod.d.ts +38 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +206 -54
- package/script/compiler/ndjson_writer.d.ts +50 -0
- package/script/compiler/ndjson_writer.d.ts.map +1 -0
- package/script/compiler/ndjson_writer.js +78 -0
- package/script/compiler/schema.d.ts +33 -1
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +30 -8
- package/script/config/markspec.d.ts +5 -0
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +17 -2
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +54 -0
- package/script/formatter/mod.d.ts +55 -4
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +426 -46
- package/script/formatter/synth_ulid.d.ts +21 -0
- package/script/formatter/synth_ulid.d.ts.map +1 -0
- package/script/formatter/synth_ulid.js +67 -0
- package/script/lexicons/loader.d.ts +35 -0
- package/script/lexicons/loader.d.ts.map +1 -0
- package/script/lexicons/loader.js +55 -0
- package/script/lexicons/mod.d.ts +13 -0
- package/script/lexicons/mod.d.ts.map +1 -0
- package/script/lexicons/mod.js +17 -0
- package/script/lint/glossary.d.ts +45 -0
- package/script/lint/glossary.d.ts.map +1 -0
- package/script/lint/glossary.js +88 -0
- package/script/lint/mod.d.ts +14 -0
- package/script/lint/mod.d.ts.map +1 -0
- package/script/lint/mod.js +17 -0
- package/script/lint/range_util.d.ts +25 -0
- package/script/lint/range_util.d.ts.map +1 -0
- package/script/lint/range_util.js +53 -0
- package/script/lint/rules/ears.d.ts +39 -0
- package/script/lint/rules/ears.d.ts.map +1 -0
- package/script/lint/rules/ears.js +320 -0
- package/script/lint/rules/incose_sentence.d.ts +46 -0
- package/script/lint/rules/incose_sentence.d.ts.map +1 -0
- package/script/lint/rules/incose_sentence.js +421 -0
- package/script/lint/rules/lexicon.d.ts +24 -0
- package/script/lint/rules/lexicon.d.ts.map +1 -0
- package/script/lint/rules/lexicon.js +240 -0
- package/script/lint/rules/modal_sentence.d.ts +46 -0
- package/script/lint/rules/modal_sentence.d.ts.map +1 -0
- package/script/lint/rules/modal_sentence.js +150 -0
- package/script/lint/rules/passive.d.ts +64 -0
- package/script/lint/rules/passive.d.ts.map +1 -0
- package/script/lint/rules/passive.js +286 -0
- package/script/lint/rules/struct.d.ts +17 -0
- package/script/lint/rules/struct.d.ts.map +1 -0
- package/script/lint/rules/struct.js +59 -0
- package/script/lint/rules/suppression.d.ts +54 -0
- package/script/lint/rules/suppression.d.ts.map +1 -0
- package/script/lint/rules/suppression.js +136 -0
- package/script/lint/rules/xref.d.ts +19 -0
- package/script/lint/rules/xref.d.ts.map +1 -0
- package/script/lint/rules/xref.js +251 -0
- package/script/lint/runner.d.ts +59 -0
- package/script/lint/runner.d.ts.map +1 -0
- package/script/lint/runner.js +157 -0
- package/script/lint/score.d.ts +64 -0
- package/script/lint/score.d.ts.map +1 -0
- package/script/lint/score.js +167 -0
- package/script/lint/segmenter.d.ts +32 -0
- package/script/lint/segmenter.d.ts.map +1 -0
- package/script/lint/segmenter.js +82 -0
- package/script/lint/types.d.ts +31 -0
- package/script/lint/types.d.ts.map +1 -0
- package/script/lint/types.js +10 -0
- package/script/lock/canonical_edges.d.ts +31 -0
- package/script/lock/canonical_edges.d.ts.map +1 -0
- package/script/lock/canonical_edges.js +61 -0
- package/script/lock/check.d.ts +24 -0
- package/script/lock/check.d.ts.map +1 -0
- package/script/lock/check.js +130 -0
- package/script/lock/hash.d.ts +12 -0
- package/script/lock/hash.d.ts.map +1 -0
- package/script/lock/hash.js +36 -0
- package/script/lock/mod.d.ts +19 -0
- package/script/lock/mod.d.ts.map +1 -0
- package/script/lock/mod.js +31 -0
- package/script/lock/model.d.ts +81 -0
- package/script/lock/model.d.ts.map +1 -0
- package/script/lock/model.js +10 -0
- package/script/lock/parser.d.ts +26 -0
- package/script/lock/parser.d.ts.map +1 -0
- package/script/lock/parser.js +198 -0
- package/script/lock/resolve.d.ts +142 -0
- package/script/lock/resolve.d.ts.map +1 -0
- package/script/lock/resolve.js +397 -0
- package/script/lock/serializer.d.ts +14 -0
- package/script/lock/serializer.d.ts.map +1 -0
- package/script/lock/serializer.js +107 -0
- package/script/mod.d.ts +28 -8
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +129 -32
- package/script/model/attributes.d.ts +6 -0
- package/script/model/attributes.d.ts.map +1 -1
- package/script/model/attributes.js +201 -3
- package/script/model/discipline.d.ts +53 -0
- package/script/model/discipline.d.ts.map +1 -0
- package/script/model/discipline.js +53 -0
- package/script/model/discriminating_attr.d.ts +33 -0
- package/script/model/discriminating_attr.d.ts.map +1 -0
- package/script/model/discriminating_attr.js +77 -0
- package/script/model/mod.d.ts +267 -14
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +111 -3
- package/script/model/profile.d.ts +102 -27
- package/script/model/profile.d.ts.map +1 -1
- package/script/model/source_introspection.d.ts +26 -0
- package/script/model/source_introspection.d.ts.map +1 -0
- package/script/model/source_introspection.js +80 -0
- package/script/model/type_hierarchy.d.ts +51 -0
- package/script/model/type_hierarchy.d.ts.map +1 -0
- package/script/model/type_hierarchy.js +130 -0
- package/script/model/uri_scheme_map.d.ts +21 -0
- package/script/model/uri_scheme_map.d.ts.map +1 -0
- package/script/model/uri_scheme_map.js +69 -0
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +10 -16
- package/script/parser/body_tokens.d.ts +35 -0
- package/script/parser/body_tokens.d.ts.map +1 -0
- package/script/parser/body_tokens.js +235 -0
- package/script/parser/glossary.d.ts +51 -0
- package/script/parser/glossary.d.ts.map +1 -0
- package/script/parser/glossary.js +224 -0
- package/script/parser/grammars.d.ts +5 -3
- package/script/parser/grammars.d.ts.map +1 -1
- package/script/parser/grammars.js +15 -8
- package/script/parser/language_spec.d.ts +55 -0
- package/script/parser/language_spec.d.ts.map +1 -0
- package/script/parser/language_spec.js +423 -0
- package/script/parser/line_map.d.ts +60 -0
- package/script/parser/line_map.d.ts.map +1 -0
- package/script/parser/line_map.js +44 -0
- package/script/parser/markdown.d.ts +9 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +315 -23
- package/script/parser/mod.d.ts +5 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +36 -7
- package/script/parser/source.d.ts +53 -2
- package/script/parser/source.d.ts.map +1 -1
- package/script/parser/source.js +159 -69
- package/script/parser/translate.d.ts +24 -0
- package/script/parser/translate.d.ts.map +1 -0
- package/script/parser/translate.js +102 -0
- package/script/profile/chain.d.ts +8 -0
- package/script/profile/chain.d.ts.map +1 -1
- package/script/profile/chain.js +32 -14
- package/script/profile/colors.js +1 -1
- package/script/profile/default_profile.d.ts +25 -0
- package/script/profile/default_profile.d.ts.map +1 -0
- package/script/profile/default_profile.js +46 -0
- package/script/profile/discipline_mode.d.ts +64 -0
- package/script/profile/discipline_mode.d.ts.map +1 -0
- package/script/profile/discipline_mode.js +138 -0
- package/script/profile/discipline_registry.d.ts +41 -0
- package/script/profile/discipline_registry.d.ts.map +1 -0
- package/script/profile/discipline_registry.js +70 -0
- package/script/profile/introspect.d.ts +135 -0
- package/script/profile/introspect.d.ts.map +1 -0
- package/script/profile/introspect.js +381 -0
- package/script/profile/load.d.ts +3 -1
- package/script/profile/load.d.ts.map +1 -1
- package/script/profile/load.js +91 -5
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +511 -89
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +251 -39
- package/script/profile/mod.d.ts +4 -4
- package/script/profile/mod.d.ts.map +1 -1
- package/script/profile/mod.js +12 -6
- package/script/reporter/mod.js +4 -4
- package/script/sync/locked_attributes.d.ts +19 -0
- package/script/sync/locked_attributes.d.ts.map +1 -0
- package/script/sync/locked_attributes.js +30 -0
- package/script/sync/log.d.ts +34 -0
- package/script/sync/log.d.ts.map +1 -0
- package/script/sync/log.js +52 -0
- package/script/sync/mapping.d.ts +66 -0
- package/script/sync/mapping.d.ts.map +1 -0
- package/script/sync/mapping.js +169 -0
- package/script/sync/mod.d.ts +16 -0
- package/script/sync/mod.d.ts.map +1 -0
- package/script/sync/mod.js +21 -0
- package/script/sync/status.d.ts +23 -0
- package/script/sync/status.d.ts.map +1 -0
- package/script/sync/status.js +24 -0
- package/script/typl/ast.d.ts +87 -0
- package/script/typl/ast.d.ts.map +1 -0
- package/script/typl/ast.js +24 -0
- package/script/typl/bridge.d.ts +32 -0
- package/script/typl/bridge.d.ts.map +1 -0
- package/script/typl/bridge.js +30 -0
- package/script/typl/bullet.d.ts +34 -0
- package/script/typl/bullet.d.ts.map +1 -0
- package/script/typl/bullet.js +47 -0
- package/script/typl/diagnostics.d.ts +43 -0
- package/script/typl/diagnostics.d.ts.map +1 -0
- package/script/typl/diagnostics.js +65 -0
- package/script/typl/fence.d.ts +31 -0
- package/script/typl/fence.d.ts.map +1 -0
- package/script/typl/fence.js +27 -0
- package/script/typl/grammar.d.ts +20 -0
- package/script/typl/grammar.d.ts.map +1 -0
- package/script/typl/grammar.js +474 -0
- package/script/typl/inline.d.ts +34 -0
- package/script/typl/inline.d.ts.map +1 -0
- package/script/typl/inline.js +51 -0
- package/script/typl/lexer.d.ts +37 -0
- package/script/typl/lexer.d.ts.map +1 -0
- package/script/typl/lexer.js +237 -0
- package/script/typl/mod.d.ts +23 -0
- package/script/typl/mod.d.ts.map +1 -0
- package/script/typl/mod.js +29 -0
- package/script/typl/registry.d.ts +42 -0
- package/script/typl/registry.d.ts.map +1 -0
- package/script/typl/registry.js +29 -0
- package/script/typl/validator.d.ts +29 -0
- package/script/typl/validator.d.ts.map +1 -0
- package/script/typl/validator.js +144 -0
- package/script/util/fence.d.ts +30 -0
- package/script/util/fence.d.ts.map +1 -0
- package/script/util/fence.js +44 -0
- package/script/util/line_endings.d.ts +33 -0
- package/script/util/line_endings.d.ts.map +1 -0
- package/script/util/line_endings.js +58 -0
- package/script/util/modals.d.ts +29 -0
- package/script/util/modals.d.ts.map +1 -0
- package/script/util/modals.js +42 -0
- package/script/validator/attributes.d.ts +3 -3
- package/script/validator/attributes.d.ts.map +1 -1
- package/script/validator/attributes.js +1 -18
- package/script/validator/body_blocks.d.ts +38 -0
- package/script/validator/body_blocks.d.ts.map +1 -0
- package/script/validator/body_blocks.js +221 -0
- package/script/validator/caption_convention.d.ts +29 -0
- package/script/validator/caption_convention.d.ts.map +1 -0
- package/script/validator/caption_convention.js +61 -0
- package/script/validator/captions.d.ts +22 -0
- package/script/validator/captions.d.ts.map +1 -0
- package/script/validator/captions.js +140 -0
- package/script/validator/component_schemes.d.ts +73 -0
- package/script/validator/component_schemes.d.ts.map +1 -0
- package/script/validator/component_schemes.js +384 -0
- package/script/validator/discipline.d.ts +35 -0
- package/script/validator/discipline.d.ts.map +1 -0
- package/script/validator/discipline.js +207 -0
- package/script/validator/feature_ac.d.ts +28 -0
- package/script/validator/feature_ac.d.ts.map +1 -0
- package/script/validator/feature_ac.js +105 -0
- package/script/validator/listing.d.ts +42 -0
- package/script/validator/listing.d.ts.map +1 -0
- package/script/validator/listing.js +298 -0
- package/script/validator/mod.d.ts +3 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +278 -14
- package/script/validator/modal_keywords.d.ts +25 -0
- package/script/validator/modal_keywords.d.ts.map +1 -0
- package/script/validator/modal_keywords.js +57 -0
- package/script/validator/pattern.d.ts +15 -8
- package/script/validator/pattern.d.ts.map +1 -1
- package/script/validator/pattern.js +42 -19
- package/script/validator/per_type_attrs.d.ts +29 -0
- package/script/validator/per_type_attrs.d.ts.map +1 -0
- package/script/validator/per_type_attrs.js +78 -0
- package/script/validator/pipeline.d.ts +18 -2
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +78 -22
- package/script/validator/trace_types.d.ts +26 -0
- package/script/validator/trace_types.d.ts.map +1 -0
- package/script/validator/trace_types.js +235 -0
- package/script/validator/traceability.d.ts +3 -4
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +5 -10
- package/script/validator/type_resolution.d.ts +67 -0
- package/script/validator/type_resolution.d.ts.map +1 -0
- package/script/validator/type_resolution.js +168 -0
- package/script/validator/types.d.ts +45 -0
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +131 -16
- package/script/validator/value_types.d.ts +8 -0
- package/script/validator/value_types.d.ts.map +1 -1
- package/script/validator/value_types.js +10 -2
package/script/validator/mod.js
CHANGED
|
@@ -15,13 +15,34 @@
|
|
|
15
15
|
* a profile-aware validator layer (not in the core).
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.validateTraceabilityForEntry = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.normalizeListValues = exports.validateValue = exports.validateAttributesForEntry = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.runPipeline = void 0;
|
|
18
|
+
exports.validateTraceabilityForEntry = exports.matchesAnyTarget = exports.effectiveTraceRules = exports.normalizeListValues = exports.validateValue = exports.validateAttributesForEntry = exports.effectiveScope = exports.compileDisplayIdPattern = exports.classifyEntry = exports.classifyEntriesStage = exports.validateListingDocuments = exports.suppressDeclaredAttrR010 = exports.runPipeline = void 0;
|
|
19
19
|
exports.validate = validate;
|
|
20
20
|
exports.indexByDisplayId = indexByDisplayId;
|
|
21
21
|
exports.findAttr = findAttr;
|
|
22
22
|
const mod_js_1 = require("../model/mod.js");
|
|
23
|
+
const value_types_js_1 = require("./value_types.js");
|
|
24
|
+
const mod_js_2 = require("../typl/mod.js");
|
|
23
25
|
/** Universal attribute keys the core recognizes. */
|
|
24
26
|
const UNIVERSAL_KEYS = new Set(mod_js_1.UNIVERSAL_ATTRIBUTE_KEYS);
|
|
27
|
+
/**
|
|
28
|
+
* Value-type set that's repeatable per spec §1.8 — these attributes
|
|
29
|
+
* accept multiple lines for distinct values, so multiple trailers with
|
|
30
|
+
* the same key are legal. Single-cardinality attributes are anything
|
|
31
|
+
* not in this set.
|
|
32
|
+
*/
|
|
33
|
+
const REPEATABLE_VALUE_TYPES = new Set([
|
|
34
|
+
"id-list",
|
|
35
|
+
"tag-list",
|
|
36
|
+
"citation",
|
|
37
|
+
"external-id",
|
|
38
|
+
]);
|
|
39
|
+
/**
|
|
40
|
+
* Slug pattern for Reference-shape display IDs (spec §1.7, ADR-002 §Part 3).
|
|
41
|
+
* Pandoc/BibTeX cite-key convention, restricted to a portable character
|
|
42
|
+
* set: starts with a letter, body alphanumeric + `.` / `/` / `-` / `_`,
|
|
43
|
+
* ends with an alphanumeric.
|
|
44
|
+
*/
|
|
45
|
+
const REFERENCE_SLUG_RE = /^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$/;
|
|
25
46
|
/**
|
|
26
47
|
* Validate a set of parsed entries for structural correctness and
|
|
27
48
|
* cross-reference integrity.
|
|
@@ -32,6 +53,11 @@ function validate(entries) {
|
|
|
32
53
|
const diagnostics = [];
|
|
33
54
|
checkStructural(entries, diagnostics);
|
|
34
55
|
checkReferences(entries, diagnostics);
|
|
56
|
+
// Typl cross-entry collisions (TYPL-002/003) and undefined-typedef-refs
|
|
57
|
+
// (TYPL-005). Per-block diagnostics (TYPL-001/004/006/007/008) already
|
|
58
|
+
// fired during parse via the bridge.
|
|
59
|
+
const typlResult = (0, mod_js_2.validateTypl)(entries);
|
|
60
|
+
diagnostics.push(...typlResult.diagnostics);
|
|
35
61
|
const valid = !diagnostics.some((d) => d.severity === "error");
|
|
36
62
|
return { diagnostics, valid };
|
|
37
63
|
}
|
|
@@ -41,6 +67,8 @@ function checkStructural(entries, diagnostics) {
|
|
|
41
67
|
const ids = new Map();
|
|
42
68
|
for (const entry of entries) {
|
|
43
69
|
// MSL-R003: exactly one `Id:` attribute per entry.
|
|
70
|
+
// Dual-emit: MSL-I002 (Reference missing Id), MSL-I003 (Authored missing
|
|
71
|
+
// Id), MSL-I004 (multiple Id) — nextgen §4.2 codes alongside legacy.
|
|
44
72
|
const idAttrs = entry.rawAttributes.filter((a) => a.key === mod_js_1.IDENTITY_KEY);
|
|
45
73
|
if (idAttrs.length === 0) {
|
|
46
74
|
diagnostics.push({
|
|
@@ -49,6 +77,25 @@ function checkStructural(entries, diagnostics) {
|
|
|
49
77
|
message: `${entry.displayId}: missing Id: attribute`,
|
|
50
78
|
location: entry.location,
|
|
51
79
|
});
|
|
80
|
+
// Dual-emit: shape-specific nextgen code
|
|
81
|
+
if (entry.shape === "Reference") {
|
|
82
|
+
diagnostics.push({
|
|
83
|
+
code: "MSL-I002",
|
|
84
|
+
severity: "error",
|
|
85
|
+
message: `${entry.displayId}: Reference-shape entry without Id: ` +
|
|
86
|
+
`fmt cannot mint URIs (spec section 4.2)`,
|
|
87
|
+
location: entry.location,
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
diagnostics.push({
|
|
92
|
+
code: "MSL-I003",
|
|
93
|
+
severity: "error",
|
|
94
|
+
message: `${entry.displayId}: Authored-shape entry without Id: ` +
|
|
95
|
+
`run fmt to mint a ULID (spec section 4.2)`,
|
|
96
|
+
location: entry.location,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
52
99
|
}
|
|
53
100
|
else if (idAttrs.length > 1) {
|
|
54
101
|
diagnostics.push({
|
|
@@ -57,8 +104,17 @@ function checkStructural(entries, diagnostics) {
|
|
|
57
104
|
message: `${entry.displayId}: multiple Id: attributes (${idAttrs.length}) — exactly one is required`,
|
|
58
105
|
location: entry.location,
|
|
59
106
|
});
|
|
107
|
+
// Dual-emit: MSL-I004
|
|
108
|
+
diagnostics.push({
|
|
109
|
+
code: "MSL-I004",
|
|
110
|
+
severity: "error",
|
|
111
|
+
message: `${entry.displayId}: multiple Id: trailers ` +
|
|
112
|
+
`(${idAttrs.length}) on the same entry (spec section 4.2)`,
|
|
113
|
+
location: entry.location,
|
|
114
|
+
});
|
|
60
115
|
}
|
|
61
116
|
// MSL-R004: `Id:` value must be a ULID or a scheme-qualified URI.
|
|
117
|
+
// Dual-emit: MSL-I001 — nextgen §4.2 code alongside legacy.
|
|
62
118
|
if (idAttrs.length > 0) {
|
|
63
119
|
const value = idAttrs[0].value;
|
|
64
120
|
const isUlid = mod_js_1.ULID_RE.test(value);
|
|
@@ -70,9 +126,16 @@ function checkStructural(entries, diagnostics) {
|
|
|
70
126
|
message: `${entry.displayId}: Id: value '${value}' is neither a bare ULID nor a scheme-qualified URI`,
|
|
71
127
|
location: entry.location,
|
|
72
128
|
});
|
|
129
|
+
diagnostics.push({
|
|
130
|
+
code: "MSL-I001",
|
|
131
|
+
severity: "error",
|
|
132
|
+
message: `${entry.displayId}: Id: value '${value}' is neither a ULID ` +
|
|
133
|
+
`(^[0-9A-HJKMNP-TV-Z]{26}$) nor an RFC 3986 URI (spec section 4.2)`,
|
|
134
|
+
location: entry.location,
|
|
135
|
+
});
|
|
73
136
|
}
|
|
74
137
|
// Shape consistency: ULID ↔ identified, URI ↔ referenced.
|
|
75
|
-
if (isUlid && entry.shape !== "
|
|
138
|
+
if (isUlid && entry.shape !== "Authored") {
|
|
76
139
|
diagnostics.push({
|
|
77
140
|
code: "MSL-R004",
|
|
78
141
|
severity: "error",
|
|
@@ -80,7 +143,7 @@ function checkStructural(entries, diagnostics) {
|
|
|
80
143
|
location: entry.location,
|
|
81
144
|
});
|
|
82
145
|
}
|
|
83
|
-
else if (isUri && entry.shape !== "
|
|
146
|
+
else if (isUri && entry.shape !== "Reference") {
|
|
84
147
|
diagnostics.push({
|
|
85
148
|
code: "MSL-R004",
|
|
86
149
|
severity: "error",
|
|
@@ -89,7 +152,21 @@ function checkStructural(entries, diagnostics) {
|
|
|
89
152
|
});
|
|
90
153
|
}
|
|
91
154
|
}
|
|
155
|
+
// MSL-I006: Reference-shape display ID must match the slug pattern
|
|
156
|
+
// (spec §1.7, ADR-002 §Part 3). Authored entries have a free-form
|
|
157
|
+
// display ID at core level (tightened by profile patterns).
|
|
158
|
+
if (entry.shape === "Reference" && !REFERENCE_SLUG_RE.test(entry.displayId)) {
|
|
159
|
+
diagnostics.push({
|
|
160
|
+
code: "MSL-I006",
|
|
161
|
+
severity: "error",
|
|
162
|
+
message: `${entry.displayId}: Reference-shape display ID does not ` +
|
|
163
|
+
`match the slug pattern (spec §1.7); expected ` +
|
|
164
|
+
`^[A-Za-z]([A-Za-z0-9._/-]*[A-Za-z0-9])?$`,
|
|
165
|
+
location: entry.location,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
92
168
|
// MSL-R006: Display ID unique across all entries.
|
|
169
|
+
// Dual-emit: MSL-I008 (warning) — nextgen §4.2.
|
|
93
170
|
const existingDisplay = displayIds.get(entry.displayId);
|
|
94
171
|
if (existingDisplay) {
|
|
95
172
|
diagnostics.push({
|
|
@@ -98,11 +175,21 @@ function checkStructural(entries, diagnostics) {
|
|
|
98
175
|
message: `duplicate display ID '${entry.displayId}' (also at ${existingDisplay.location.file}:${existingDisplay.location.line})`,
|
|
99
176
|
location: entry.location,
|
|
100
177
|
});
|
|
178
|
+
diagnostics.push({
|
|
179
|
+
code: "MSL-I008",
|
|
180
|
+
severity: "warning",
|
|
181
|
+
message: `duplicate display ID '${entry.displayId}' within the same ` +
|
|
182
|
+
`shape (also at ${existingDisplay.location.file}:` +
|
|
183
|
+
`${existingDisplay.location.line}) -- cross-references resolve ` +
|
|
184
|
+
`by Id:, so this is style-only (spec section 4.2)`,
|
|
185
|
+
location: entry.location,
|
|
186
|
+
});
|
|
101
187
|
}
|
|
102
188
|
else {
|
|
103
189
|
displayIds.set(entry.displayId, entry);
|
|
104
190
|
}
|
|
105
191
|
// MSL-R005: identity value unique across all entries.
|
|
192
|
+
// Dual-emit: MSL-I007 — nextgen §4.2.
|
|
106
193
|
if (entry.id) {
|
|
107
194
|
const existingId = ids.get(entry.id);
|
|
108
195
|
if (existingId) {
|
|
@@ -112,17 +199,174 @@ function checkStructural(entries, diagnostics) {
|
|
|
112
199
|
message: `duplicate Id '${entry.id}' (also at ${existingId.location.file}:${existingId.location.line})`,
|
|
113
200
|
location: entry.location,
|
|
114
201
|
});
|
|
202
|
+
diagnostics.push({
|
|
203
|
+
code: "MSL-I007",
|
|
204
|
+
severity: "error",
|
|
205
|
+
message: `duplicate Id: value '${entry.id}' across the project (also ` +
|
|
206
|
+
`at ${existingId.location.file}:${existingId.location.line}) ` +
|
|
207
|
+
`(spec section 4.2)`,
|
|
208
|
+
location: entry.location,
|
|
209
|
+
});
|
|
115
210
|
}
|
|
116
211
|
else {
|
|
117
212
|
ids.set(entry.id, entry);
|
|
118
213
|
}
|
|
119
214
|
}
|
|
120
|
-
// MSL-
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
//
|
|
215
|
+
// MSL-P010 — entry title is empty after trimming. The parser
|
|
216
|
+
// accepts an empty title for shape stability (`[REQ-001]` with
|
|
217
|
+
// nothing after) but the canonical form per spec §4.2 requires a
|
|
218
|
+
// non-empty human-readable title. Fires regardless of shape.
|
|
219
|
+
if (entry.title.trim().length === 0) {
|
|
220
|
+
diagnostics.push({
|
|
221
|
+
code: "MSL-P010",
|
|
222
|
+
severity: "error",
|
|
223
|
+
message: `${entry.displayId}: title is empty after trimming ` +
|
|
224
|
+
`(spec §4.2); add a non-empty human-readable title after ']'`,
|
|
225
|
+
location: entry.location,
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
// MSL-A011 — `citation`-typed attribute (References:) used CSV
|
|
229
|
+
// form. The canonical form is multi-line per spec §2.3.2: locators
|
|
230
|
+
// may contain commas (e.g. `[@iso26262, p. 42]`), so the parser
|
|
231
|
+
// never CSV-splits citation values. Detection scans for a `,` at
|
|
232
|
+
// bracket-depth zero — commas inside `[…]` are locators and OK.
|
|
233
|
+
for (const attr of entry.rawAttributes) {
|
|
234
|
+
const spec = (0, mod_js_1.attributeSpec)(attr.key);
|
|
235
|
+
if (spec?.type !== "citation")
|
|
236
|
+
continue;
|
|
237
|
+
let depth = 0;
|
|
238
|
+
let sawTopLevelComma = false;
|
|
239
|
+
for (const ch of attr.value) {
|
|
240
|
+
if (ch === "[")
|
|
241
|
+
depth++;
|
|
242
|
+
else if (ch === "]" && depth > 0)
|
|
243
|
+
depth--;
|
|
244
|
+
else if (ch === "," && depth === 0) {
|
|
245
|
+
sawTopLevelComma = true;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (sawTopLevelComma) {
|
|
250
|
+
diagnostics.push({
|
|
251
|
+
code: "MSL-A011",
|
|
252
|
+
severity: "error",
|
|
253
|
+
message: `${entry.displayId}: '${attr.key}' is citation-typed and ` +
|
|
254
|
+
`must use multi-line form (spec §2.3.2); CSV is rejected because ` +
|
|
255
|
+
`Pandoc locators may contain commas`,
|
|
256
|
+
location: entry.location,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
// MSL-A012 — repeatable attribute value list is empty (spec §1.8).
|
|
261
|
+
// Fires when an authored repeatable attribute (id-list, tag-list,
|
|
262
|
+
// citation, external-id) carries no non-empty values after trimming
|
|
263
|
+
// and CSV splitting. `citation` is not CSV-splittable, so its check
|
|
264
|
+
// is a plain trim-and-empty test.
|
|
124
265
|
for (const attr of entry.rawAttributes) {
|
|
125
|
-
|
|
266
|
+
const spec = (0, mod_js_1.attributeSpec)(attr.key);
|
|
267
|
+
if (!spec)
|
|
268
|
+
continue;
|
|
269
|
+
if (!REPEATABLE_VALUE_TYPES.has(spec.type))
|
|
270
|
+
continue;
|
|
271
|
+
const raw = attr.value;
|
|
272
|
+
const isCitation = spec.type === "citation";
|
|
273
|
+
const values = isCitation
|
|
274
|
+
? [raw.trim()].filter((s) => s.length > 0)
|
|
275
|
+
: raw.split(",").map((s) => s.trim()).filter((s) => s.length > 0);
|
|
276
|
+
if (values.length === 0) {
|
|
277
|
+
diagnostics.push({
|
|
278
|
+
code: "MSL-A012",
|
|
279
|
+
severity: "error",
|
|
280
|
+
message: `${entry.displayId}: '${attr.key}' is a repeatable ` +
|
|
281
|
+
`attribute but the value list is empty (spec §1.8)`,
|
|
282
|
+
location: entry.location,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
// MSL-A013 — single-cardinality core attribute used more than once.
|
|
287
|
+
// `Id:` is excluded because MSL-R003 (above) reports its duplicates
|
|
288
|
+
// with a more specific message. Profile-declared attribute
|
|
289
|
+
// cardinality is enforced by the profile-aware Stage 3 (MSL-A002).
|
|
290
|
+
const seenSingleKeys = new Set();
|
|
291
|
+
const reportedA013 = new Set();
|
|
292
|
+
for (const attr of entry.rawAttributes) {
|
|
293
|
+
if (attr.key === mod_js_1.IDENTITY_KEY)
|
|
294
|
+
continue;
|
|
295
|
+
const spec = (0, mod_js_1.attributeSpec)(attr.key);
|
|
296
|
+
if (!spec)
|
|
297
|
+
continue;
|
|
298
|
+
if (REPEATABLE_VALUE_TYPES.has(spec.type))
|
|
299
|
+
continue;
|
|
300
|
+
if (seenSingleKeys.has(attr.key)) {
|
|
301
|
+
if (!reportedA013.has(attr.key)) {
|
|
302
|
+
diagnostics.push({
|
|
303
|
+
code: "MSL-A013",
|
|
304
|
+
severity: "error",
|
|
305
|
+
message: `${entry.displayId}: '${attr.key}' is single-cardinality ` +
|
|
306
|
+
`but appears more than once (spec §1.8)`,
|
|
307
|
+
location: entry.location,
|
|
308
|
+
});
|
|
309
|
+
reportedA013.add(attr.key);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
seenSingleKeys.add(attr.key);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// MSL-A030 / MSL-A050 / MSL-R010 checks per attribute
|
|
317
|
+
// (§4.4 / §4.8 / spec §1.5).
|
|
318
|
+
for (const attr of entry.rawAttributes) {
|
|
319
|
+
// MSL-A030: generated-origin attributes must not appear in source.
|
|
320
|
+
const spec = (0, mod_js_1.attributeSpec)(attr.key);
|
|
321
|
+
if (spec?.origin === "generated") {
|
|
322
|
+
diagnostics.push({
|
|
323
|
+
code: "MSL-A030",
|
|
324
|
+
severity: "error",
|
|
325
|
+
message: `${entry.displayId}: '${attr.key}' has generated origin and must not appear in source (computed at build time per ADR-003 §Part 3)`,
|
|
326
|
+
location: entry.location,
|
|
327
|
+
});
|
|
328
|
+
continue;
|
|
329
|
+
}
|
|
330
|
+
// MSL-A050: value does not parse against the declared value type
|
|
331
|
+
// (§4.4). The core knows the value type for the promoted Reference
|
|
332
|
+
// attributes (spec §1.5) and the universal enum attributes;
|
|
333
|
+
// profile-declared attribute types are validated by the
|
|
334
|
+
// profile-aware Stage 3 instead.
|
|
335
|
+
if (attr.key === "Reference-url") {
|
|
336
|
+
if (!value_types_js_1.HTTP_URL_RE.test(attr.value.trim())) {
|
|
337
|
+
diagnostics.push({
|
|
338
|
+
code: "MSL-A050",
|
|
339
|
+
severity: "error",
|
|
340
|
+
message: `${entry.displayId}: Reference-url value ` +
|
|
341
|
+
`'${attr.value.trim()}' is not an http(s) URL (spec §1.5)`,
|
|
342
|
+
location: entry.location,
|
|
343
|
+
});
|
|
344
|
+
continue;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
if (spec?.type === "enum" && spec.enumValues) {
|
|
348
|
+
const trimmed = attr.value.trim();
|
|
349
|
+
if (trimmed.length > 0 && !spec.enumValues.includes(trimmed)) {
|
|
350
|
+
diagnostics.push({
|
|
351
|
+
code: "MSL-A050",
|
|
352
|
+
severity: "error",
|
|
353
|
+
message: `${entry.displayId}: ${attr.key} value '${trimmed}' ` +
|
|
354
|
+
`is not in the allowed set ` +
|
|
355
|
+
`{${spec.enumValues.join(", ")}} (spec §1.8 enum)`,
|
|
356
|
+
location: entry.location,
|
|
357
|
+
});
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
// MSL-R010: Unknown attributes are warnings in the core. A
|
|
362
|
+
// profile-aware validator widens this check to include profile-declared
|
|
363
|
+
// attributes; until then, anything outside the universal set is
|
|
364
|
+
// unrecognized. Core-typed attributes (per ADR-003 §Part 2) are
|
|
365
|
+
// suppressed here — the per-type validator emits a more specific
|
|
366
|
+
// MSL-T022 when they appear on the "wrong" type.
|
|
367
|
+
if (!UNIVERSAL_KEYS.has(attr.key) &&
|
|
368
|
+
attr.key !== "Type" &&
|
|
369
|
+
!mod_js_1.CORE_TYPE_SCOPED_ATTRS.has(attr.key)) {
|
|
126
370
|
diagnostics.push({
|
|
127
371
|
code: "MSL-R010",
|
|
128
372
|
severity: "warning",
|
|
@@ -130,6 +374,21 @@ function checkStructural(entries, diagnostics) {
|
|
|
130
374
|
location: entry.location,
|
|
131
375
|
});
|
|
132
376
|
}
|
|
377
|
+
// MSL-A006: empty element in CSV attribute value (e.g. "A,,B").
|
|
378
|
+
const csvSpec = (0, mod_js_1.attributeSpec)(attr.key);
|
|
379
|
+
if (csvSpec && mod_js_1.CSV_SPLITTABLE_TYPES.has(csvSpec.type) &&
|
|
380
|
+
attr.value.includes(",")) {
|
|
381
|
+
const parts = attr.value.split(",").map((s) => s.trim());
|
|
382
|
+
const emptyCount = parts.filter((s) => s.length === 0).length;
|
|
383
|
+
if (emptyCount > 0) {
|
|
384
|
+
diagnostics.push({
|
|
385
|
+
code: "MSL-A006",
|
|
386
|
+
severity: "warning",
|
|
387
|
+
message: `${entry.displayId}: attribute '${attr.key}' contains ${emptyCount} empty element(s) in CSV value "${attr.value}"`,
|
|
388
|
+
location: entry.location,
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
}
|
|
133
392
|
}
|
|
134
393
|
}
|
|
135
394
|
}
|
|
@@ -186,11 +445,13 @@ function checkReferences(entries, diagnostics) {
|
|
|
186
445
|
});
|
|
187
446
|
continue;
|
|
188
447
|
}
|
|
189
|
-
if (resolved.shape !== "
|
|
448
|
+
if (resolved.shape !== "Reference") {
|
|
190
449
|
diagnostics.push({
|
|
191
|
-
code: "MSL-
|
|
192
|
-
severity: "
|
|
193
|
-
message: `${entry.displayId}: References: target '${slug}'
|
|
450
|
+
code: "MSL-R085",
|
|
451
|
+
severity: "warning",
|
|
452
|
+
message: `${entry.displayId}: References: target '${slug}' resolves to a ` +
|
|
453
|
+
`'${resolved.shape}' entry but References must cite a ` +
|
|
454
|
+
`Reference-shape entry (spec §4.8)`,
|
|
194
455
|
location: entry.location,
|
|
195
456
|
});
|
|
196
457
|
}
|
|
@@ -213,6 +474,9 @@ function findAttr(attrs, key) {
|
|
|
213
474
|
}
|
|
214
475
|
var pipeline_js_1 = require("./pipeline.js");
|
|
215
476
|
Object.defineProperty(exports, "runPipeline", { enumerable: true, get: function () { return pipeline_js_1.runPipeline; } });
|
|
477
|
+
Object.defineProperty(exports, "suppressDeclaredAttrR010", { enumerable: true, get: function () { return pipeline_js_1.suppressDeclaredAttrR010; } });
|
|
478
|
+
var listing_js_1 = require("./listing.js");
|
|
479
|
+
Object.defineProperty(exports, "validateListingDocuments", { enumerable: true, get: function () { return listing_js_1.validateListingDocuments; } });
|
|
216
480
|
var types_js_1 = require("./types.js");
|
|
217
481
|
Object.defineProperty(exports, "classifyEntriesStage", { enumerable: true, get: function () { return types_js_1.classifyEntriesStage; } });
|
|
218
482
|
Object.defineProperty(exports, "classifyEntry", { enumerable: true, get: function () { return types_js_1.classifyEntry; } });
|
|
@@ -221,8 +485,8 @@ Object.defineProperty(exports, "compileDisplayIdPattern", { enumerable: true, ge
|
|
|
221
485
|
var attributes_js_1 = require("./attributes.js");
|
|
222
486
|
Object.defineProperty(exports, "effectiveScope", { enumerable: true, get: function () { return attributes_js_1.effectiveScope; } });
|
|
223
487
|
Object.defineProperty(exports, "validateAttributesForEntry", { enumerable: true, get: function () { return attributes_js_1.validateAttributesForEntry; } });
|
|
224
|
-
var
|
|
225
|
-
Object.defineProperty(exports, "validateValue", { enumerable: true, get: function () { return
|
|
488
|
+
var value_types_js_2 = require("./value_types.js");
|
|
489
|
+
Object.defineProperty(exports, "validateValue", { enumerable: true, get: function () { return value_types_js_2.validateValue; } });
|
|
226
490
|
var normalize_js_1 = require("./normalize.js");
|
|
227
491
|
Object.defineProperty(exports, "normalizeListValues", { enumerable: true, get: function () { return normalize_js_1.normalizeListValues; } });
|
|
228
492
|
var traceability_js_1 = require("./traceability.js");
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/validator/modal_keywords
|
|
3
|
+
*
|
|
4
|
+
* MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
|
|
5
|
+
* `SHOULD`, `MAY`, `MUST`, `WILL`) in entry-body prose. The formatter
|
|
6
|
+
* normalises these to lowercase per spec §3.4.1; this validator
|
|
7
|
+
* surfaces the deviation in a lint-only flow. Profiles may promote the
|
|
8
|
+
* severity.
|
|
9
|
+
*
|
|
10
|
+
* Reads `Entry.bodyTokens` (ADR-016) and filters for `kind === "modal"`
|
|
11
|
+
* AND `case === "upper"`. Code, feature, and math blocks are
|
|
12
|
+
* automatically excluded because the parser's `extractBodyTokens` does
|
|
13
|
+
* not emit tokens inside verbatim regions.
|
|
14
|
+
*/
|
|
15
|
+
import type { Diagnostic, Entry } from "../model/mod.js";
|
|
16
|
+
/**
|
|
17
|
+
* MSL-M060: report every uppercase RFC 2119 modal keyword in entry-body
|
|
18
|
+
* prose. Emits one diagnostic per uppercase occurrence with the exact
|
|
19
|
+
* source text in the message.
|
|
20
|
+
*
|
|
21
|
+
* MSL-M061: report when a Requirement-type entry contains no modal
|
|
22
|
+
* keyword at all (info severity; style hint to add an obligation verb).
|
|
23
|
+
*/
|
|
24
|
+
export declare function validateModalKeywords(entry: Entry): readonly Diagnostic[];
|
|
25
|
+
//# sourceMappingURL=modal_keywords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modal_keywords.d.ts","sourceRoot":"","sources":["../../src/validator/modal_keywords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAa,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAKpE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,UAAU,EAAE,CAoCzE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/validator/modal_keywords
|
|
4
|
+
*
|
|
5
|
+
* MSL-M060 validator — uppercase RFC 2119 modal keyword (`SHALL`,
|
|
6
|
+
* `SHOULD`, `MAY`, `MUST`, `WILL`) in entry-body prose. The formatter
|
|
7
|
+
* normalises these to lowercase per spec §3.4.1; this validator
|
|
8
|
+
* surfaces the deviation in a lint-only flow. Profiles may promote the
|
|
9
|
+
* severity.
|
|
10
|
+
*
|
|
11
|
+
* Reads `Entry.bodyTokens` (ADR-016) and filters for `kind === "modal"`
|
|
12
|
+
* AND `case === "upper"`. Code, feature, and math blocks are
|
|
13
|
+
* automatically excluded because the parser's `extractBodyTokens` does
|
|
14
|
+
* not emit tokens inside verbatim regions.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.validateModalKeywords = validateModalKeywords;
|
|
18
|
+
const type_resolution_js_1 = require("./type_resolution.js");
|
|
19
|
+
/**
|
|
20
|
+
* MSL-M060: report every uppercase RFC 2119 modal keyword in entry-body
|
|
21
|
+
* prose. Emits one diagnostic per uppercase occurrence with the exact
|
|
22
|
+
* source text in the message.
|
|
23
|
+
*
|
|
24
|
+
* MSL-M061: report when a Requirement-type entry contains no modal
|
|
25
|
+
* keyword at all (info severity; style hint to add an obligation verb).
|
|
26
|
+
*/
|
|
27
|
+
function validateModalKeywords(entry) {
|
|
28
|
+
const diagnostics = [];
|
|
29
|
+
const modalTokens = entry.bodyTokens.filter((t) => t.kind === "modal");
|
|
30
|
+
const anyModalSeen = modalTokens.length > 0;
|
|
31
|
+
for (const t of modalTokens) {
|
|
32
|
+
if (t.case !== "upper")
|
|
33
|
+
continue;
|
|
34
|
+
diagnostics.push({
|
|
35
|
+
code: "MSL-M060",
|
|
36
|
+
severity: "warning",
|
|
37
|
+
message: `modal keyword '${t.text}' should be lowercase`,
|
|
38
|
+
location: t.location,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// MSL-M061 — Requirement-type entry contains no modal keyword
|
|
42
|
+
// (info; style hint). Gated on the resolved core type being
|
|
43
|
+
// `Requirement` so non-requirement entries (Tests, Contracts, etc.)
|
|
44
|
+
// are not flagged. The hint stays at info severity so it doesn't
|
|
45
|
+
// affect exit codes; profiles may promote.
|
|
46
|
+
if (!anyModalSeen && (0, type_resolution_js_1.resolvedCoreType)(entry) === "Requirement") {
|
|
47
|
+
diagnostics.push({
|
|
48
|
+
code: "MSL-M061",
|
|
49
|
+
severity: "info",
|
|
50
|
+
message: `${entry.displayId}: Requirement entry contains no modal ` +
|
|
51
|
+
`keyword (shall / should / may / must) — consider declaring one ` +
|
|
52
|
+
`to make the obligation explicit (spec §3.4.1 "Modal keywords")`,
|
|
53
|
+
location: entry.location,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return diagnostics;
|
|
57
|
+
}
|
|
@@ -4,20 +4,27 @@
|
|
|
4
4
|
* Display-ID pattern template → anchored RegExp.
|
|
5
5
|
*
|
|
6
6
|
* Grammar (per ADR-009 §5):
|
|
7
|
-
* pattern
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* pattern := segment+ (exactly one counter)
|
|
8
|
+
* segment := literal | counter | named
|
|
9
|
+
* counter := "{n}" | "{n:" PADDING "d}"
|
|
10
|
+
* named := "{" identifier "}" (e.g. {scope}, {feature})
|
|
11
|
+
* PADDING := "0" digits
|
|
12
|
+
*
|
|
13
|
+
* The counter `{n}` is the numeric running index (exactly one required). A
|
|
14
|
+
* named placeholder such as `{scope}` matches a free alphanumeric segment —
|
|
15
|
+
* it validates the *shape* `PREFIX_<scope>_<NNNN>` without pinning the scope
|
|
16
|
+
* to a fixed value, so one profile pattern serves every feature scope.
|
|
10
17
|
*
|
|
11
18
|
* Examples:
|
|
12
|
-
* REQ-{n}
|
|
13
|
-
* REQ-{n:04d}
|
|
14
|
-
*
|
|
19
|
+
* REQ-{n} → ^REQ-(\d+)$
|
|
20
|
+
* REQ-{n:04d} → ^REQ-(\d{4})$
|
|
21
|
+
* XREQ_{scope}_{n:04d} → ^XREQ_(?<scope>[A-Za-z0-9]+)_(\d{4})$
|
|
15
22
|
*/
|
|
16
23
|
/**
|
|
17
24
|
* Compile a display-ID pattern template into an anchored RegExp.
|
|
18
25
|
*
|
|
19
|
-
* Throws if the template is missing the `{n}`
|
|
20
|
-
* padding specifier.
|
|
26
|
+
* Throws if the template is missing the `{n}` counter, has more than one, or
|
|
27
|
+
* has an invalid padding specifier.
|
|
21
28
|
*/
|
|
22
29
|
export declare function compileDisplayIdPattern(template: string): RegExp;
|
|
23
30
|
//# sourceMappingURL=pattern.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/validator/pattern.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"pattern.d.ts","sourceRoot":"","sources":["../../src/validator/pattern.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAKH;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAuChE"}
|
|
@@ -5,41 +5,64 @@
|
|
|
5
5
|
* Display-ID pattern template → anchored RegExp.
|
|
6
6
|
*
|
|
7
7
|
* Grammar (per ADR-009 §5):
|
|
8
|
-
* pattern
|
|
9
|
-
*
|
|
10
|
-
*
|
|
8
|
+
* pattern := segment+ (exactly one counter)
|
|
9
|
+
* segment := literal | counter | named
|
|
10
|
+
* counter := "{n}" | "{n:" PADDING "d}"
|
|
11
|
+
* named := "{" identifier "}" (e.g. {scope}, {feature})
|
|
12
|
+
* PADDING := "0" digits
|
|
13
|
+
*
|
|
14
|
+
* The counter `{n}` is the numeric running index (exactly one required). A
|
|
15
|
+
* named placeholder such as `{scope}` matches a free alphanumeric segment —
|
|
16
|
+
* it validates the *shape* `PREFIX_<scope>_<NNNN>` without pinning the scope
|
|
17
|
+
* to a fixed value, so one profile pattern serves every feature scope.
|
|
11
18
|
*
|
|
12
19
|
* Examples:
|
|
13
|
-
* REQ-{n}
|
|
14
|
-
* REQ-{n:04d}
|
|
15
|
-
*
|
|
20
|
+
* REQ-{n} → ^REQ-(\d+)$
|
|
21
|
+
* REQ-{n:04d} → ^REQ-(\d{4})$
|
|
22
|
+
* XREQ_{scope}_{n:04d} → ^XREQ_(?<scope>[A-Za-z0-9]+)_(\d{4})$
|
|
16
23
|
*/
|
|
17
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
25
|
exports.compileDisplayIdPattern = compileDisplayIdPattern;
|
|
19
|
-
|
|
26
|
+
// One token: the {n} counter (optionally padded) OR a {named} segment.
|
|
27
|
+
const TOKEN_RE = /\{n(?::(0\d+)d)?\}|\{([A-Za-z][A-Za-z0-9_]*)\}/g;
|
|
20
28
|
/**
|
|
21
29
|
* Compile a display-ID pattern template into an anchored RegExp.
|
|
22
30
|
*
|
|
23
|
-
* Throws if the template is missing the `{n}`
|
|
24
|
-
* padding specifier.
|
|
31
|
+
* Throws if the template is missing the `{n}` counter, has more than one, or
|
|
32
|
+
* has an invalid padding specifier.
|
|
25
33
|
*/
|
|
26
34
|
function compileDisplayIdPattern(template) {
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
let regexSource = "^";
|
|
36
|
+
let lastIndex = 0;
|
|
37
|
+
let counters = 0;
|
|
38
|
+
const re = new RegExp(TOKEN_RE);
|
|
39
|
+
let match;
|
|
40
|
+
while ((match = re.exec(template)) !== null) {
|
|
41
|
+
regexSource += escapeRegex(template.slice(lastIndex, match.index));
|
|
42
|
+
const named = match[2];
|
|
43
|
+
if (named === undefined) {
|
|
44
|
+
// {n} / {n:0Nd} counter
|
|
45
|
+
const padding = match[1];
|
|
46
|
+
regexSource += "(" + (padding ? `\\d{${Number(padding)}}` : `\\d+`) + ")";
|
|
47
|
+
counters++;
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
// {scope}-style named segment → free alphanumeric capture
|
|
51
|
+
regexSource += `(?<${named}>[A-Za-z0-9]+)`;
|
|
52
|
+
}
|
|
53
|
+
lastIndex = match.index + match[0].length;
|
|
54
|
+
}
|
|
55
|
+
regexSource += escapeRegex(template.slice(lastIndex)) + "$";
|
|
56
|
+
if (counters === 0) {
|
|
29
57
|
if (/\{n:[^}]*\}/.test(template)) {
|
|
30
58
|
throw new Error(`display-id-pattern '${template}': invalid padding specifier ` +
|
|
31
59
|
`(expected {n} or {n:NNd})`);
|
|
32
60
|
}
|
|
33
61
|
throw new Error(`display-id-pattern '${template}': missing {n} placeholder`);
|
|
34
62
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const prefix = template.slice(0, placeholderStart);
|
|
39
|
-
const suffix = template.slice(placeholderEnd);
|
|
40
|
-
const digitGroup = padding ? `\\d{${Number(padding)}}` : `\\d+`;
|
|
41
|
-
const regexSource = "^" + escapeRegex(prefix) + "(" + digitGroup + ")" +
|
|
42
|
-
escapeRegex(suffix) + "$";
|
|
63
|
+
if (counters > 1) {
|
|
64
|
+
throw new Error(`display-id-pattern '${template}': multiple {n} counters (expected one)`);
|
|
65
|
+
}
|
|
43
66
|
return new RegExp(regexSource);
|
|
44
67
|
}
|
|
45
68
|
function escapeRegex(s) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/validator/per_type_attrs
|
|
3
|
+
*
|
|
4
|
+
* Per-type attribute compatibility check (spec §4.3 — MSL-T022). When
|
|
5
|
+
* an entry's effective type resolves to a core type — via explicit
|
|
6
|
+
* `Type:`, profile classification, or URI-scheme inference for
|
|
7
|
+
* Reference-shape entries — any attribute that's known to the core
|
|
8
|
+
* hierarchy but not allowed on that type fires MSL-T022 as a warning.
|
|
9
|
+
* Unknown attributes (neither universal nor core-typed) fall through
|
|
10
|
+
* to the existing MSL-R010 unknown-attribute warning in
|
|
11
|
+
* `validator/mod.ts`.
|
|
12
|
+
*/
|
|
13
|
+
import type { Diagnostic, EffectiveProfile, Entry } from "../model/mod.js";
|
|
14
|
+
/**
|
|
15
|
+
* Emit per-type attribute diagnostics:
|
|
16
|
+
*
|
|
17
|
+
* - **MSL-T022** (warning) — an attribute is core-known but not
|
|
18
|
+
* valid on the entry's *resolved* type.
|
|
19
|
+
* - **MSL-T024** (warning) — the entry's core type could not be
|
|
20
|
+
* resolved (no explicit `Type:`, no profile classification, no
|
|
21
|
+
* inferable signal — display-ID prefix / URI scheme /
|
|
22
|
+
* discriminating attribute) yet it carries a core-type-scoped
|
|
23
|
+
* attribute, so that attribute cannot be validated. Without this,
|
|
24
|
+
* such attributes slipped through silently (e.g. `Manufacturer:`
|
|
25
|
+
* on a `jira:`-scheme reference). Universal and entirely unknown
|
|
26
|
+
* attributes are exempt — those go through MSL-R010.
|
|
27
|
+
*/
|
|
28
|
+
export declare function validatePerTypeAttributes(entry: Entry, profile?: EffectiveProfile): readonly Diagnostic[];
|
|
29
|
+
//# sourceMappingURL=per_type_attrs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"per_type_attrs.d.ts","sourceRoot":"","sources":["../../src/validator/per_type_attrs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAmB3E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,SAAS,UAAU,EAAE,CAsCvB"}
|