@driftsys/markspec 0.5.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 +11 -21
- package/esm/ast/build.d.ts.map +1 -1
- package/esm/ast/build.js +50 -139
- package/esm/ast/nodes.d.ts +11 -43
- package/esm/ast/nodes.d.ts.map +1 -1
- package/esm/ast/nodes.js +6 -1
- package/esm/ast/normalize.d.ts +8 -17
- package/esm/ast/normalize.d.ts.map +1 -1
- package/esm/ast/normalize.js +14 -72
- 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 +7 -0
- package/esm/compiler/inverses.d.ts.map +1 -1
- package/esm/compiler/inverses.js +1 -18
- package/esm/compiler/mod.d.ts +30 -1
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +198 -65
- package/esm/compiler/schema.d.ts +15 -0
- package/esm/compiler/schema.d.ts.map +1 -1
- package/esm/compiler/schema.js +12 -0
- 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/formatter/mod.d.ts +9 -3
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +97 -49
- 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 +4 -0
- package/esm/lint/mod.d.ts.map +1 -1
- package/esm/lint/mod.js +2 -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/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/suppression.d.ts +38 -3
- package/esm/lint/rules/suppression.d.ts.map +1 -1
- package/esm/lint/rules/suppression.js +58 -4
- 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 +31 -11
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +67 -26
- 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 +12 -0
- package/esm/lint/types.d.ts.map +1 -1
- 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 +16 -9
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +12 -4
- package/esm/model/attributes.d.ts +6 -0
- package/esm/model/attributes.d.ts.map +1 -1
- package/esm/model/attributes.js +37 -0
- 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/mod.d.ts +188 -30
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +42 -1
- package/esm/model/profile.d.ts +69 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/attributes.d.ts.map +1 -1
- package/esm/parser/attributes.js +1 -10
- 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 +8 -0
- package/esm/parser/glossary.d.ts.map +1 -1
- package/esm/parser/glossary.js +6 -4
- 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 +107 -31
- package/esm/parser/mod.d.ts +4 -0
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +30 -8
- package/esm/parser/source.d.ts +39 -8
- package/esm/parser/source.d.ts.map +1 -1
- package/esm/parser/source.js +155 -65
- 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 +29 -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/load.d.ts +3 -1
- package/esm/profile/load.d.ts.map +1 -1
- package/esm/profile/load.js +24 -5
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +253 -20
- package/esm/profile/merge.d.ts.map +1 -1
- package/esm/profile/merge.js +112 -0
- package/esm/profile/mod.d.ts +2 -0
- package/esm/profile/mod.d.ts.map +1 -1
- package/esm/profile/mod.js +2 -0
- 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/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/discipline.d.ts +35 -0
- package/esm/validator/discipline.d.ts.map +1 -0
- package/esm/validator/discipline.js +204 -0
- package/esm/validator/mod.d.ts +1 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +23 -2
- package/esm/validator/modal_keywords.d.ts +15 -13
- package/esm/validator/modal_keywords.d.ts.map +1 -1
- package/esm/validator/modal_keywords.js +26 -109
- 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 +2 -2
- package/esm/validator/per_type_attrs.d.ts.map +1 -1
- package/esm/validator/per_type_attrs.js +2 -2
- package/esm/validator/pipeline.d.ts +11 -0
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +37 -15
- package/esm/validator/type_resolution.d.ts +3 -3
- package/esm/validator/type_resolution.d.ts.map +1 -1
- package/esm/validator/type_resolution.js +31 -9
- package/package.json +2 -2
- package/script/ast/build.d.ts +11 -21
- package/script/ast/build.d.ts.map +1 -1
- package/script/ast/build.js +51 -140
- package/script/ast/nodes.d.ts +11 -43
- package/script/ast/nodes.d.ts.map +1 -1
- package/script/ast/nodes.js +6 -1
- package/script/ast/normalize.d.ts +8 -17
- package/script/ast/normalize.d.ts.map +1 -1
- package/script/ast/normalize.js +16 -74
- 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 +7 -0
- package/script/compiler/inverses.d.ts.map +1 -1
- package/script/compiler/inverses.js +2 -19
- package/script/compiler/mod.d.ts +30 -1
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +202 -69
- package/script/compiler/schema.d.ts +15 -0
- package/script/compiler/schema.d.ts.map +1 -1
- package/script/compiler/schema.js +12 -0
- 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/formatter/mod.d.ts +9 -3
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +99 -51
- 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 +4 -0
- package/script/lint/mod.d.ts.map +1 -1
- package/script/lint/mod.js +6 -1
- 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/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/suppression.d.ts +38 -3
- package/script/lint/rules/suppression.d.ts.map +1 -1
- package/script/lint/rules/suppression.js +59 -3
- 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 +31 -11
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +67 -26
- 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 +12 -0
- package/script/lint/types.d.ts.map +1 -1
- 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 +16 -9
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +111 -38
- package/script/model/attributes.d.ts +6 -0
- package/script/model/attributes.d.ts.map +1 -1
- package/script/model/attributes.js +38 -1
- 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/mod.d.ts +188 -30
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +48 -1
- package/script/model/profile.d.ts +69 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/attributes.d.ts.map +1 -1
- package/script/parser/attributes.js +1 -10
- 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 +8 -0
- package/script/parser/glossary.d.ts.map +1 -1
- package/script/parser/glossary.js +7 -4
- 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 +105 -29
- package/script/parser/mod.d.ts +4 -0
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +32 -7
- package/script/parser/source.d.ts +39 -8
- package/script/parser/source.d.ts.map +1 -1
- package/script/parser/source.js +156 -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 +29 -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/load.d.ts +3 -1
- package/script/profile/load.d.ts.map +1 -1
- package/script/profile/load.js +24 -5
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +252 -19
- package/script/profile/merge.d.ts.map +1 -1
- package/script/profile/merge.js +112 -0
- package/script/profile/mod.d.ts +2 -0
- package/script/profile/mod.d.ts.map +1 -1
- package/script/profile/mod.js +6 -1
- 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/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/discipline.d.ts +35 -0
- package/script/validator/discipline.d.ts.map +1 -0
- package/script/validator/discipline.js +207 -0
- package/script/validator/mod.d.ts +1 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +23 -1
- package/script/validator/modal_keywords.d.ts +15 -13
- package/script/validator/modal_keywords.d.ts.map +1 -1
- package/script/validator/modal_keywords.js +26 -109
- 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 +2 -2
- package/script/validator/per_type_attrs.d.ts.map +1 -1
- package/script/validator/per_type_attrs.js +2 -2
- package/script/validator/pipeline.d.ts +11 -0
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +40 -17
- package/script/validator/type_resolution.d.ts +3 -3
- package/script/validator/type_resolution.d.ts.map +1 -1
- package/script/validator/type_resolution.js +31 -9
- package/esm/parser/entity_refs.d.ts +0 -53
- package/esm/parser/entity_refs.d.ts.map +0 -1
- package/esm/parser/entity_refs.js +0 -151
- package/script/parser/entity_refs.d.ts +0 -53
- package/script/parser/entity_refs.d.ts.map +0 -1
- package/script/parser/entity_refs.js +0 -155
|
@@ -27,6 +27,9 @@ const ALLOWED_PROFILE_KEYS = new Set([
|
|
|
27
27
|
"conventions",
|
|
28
28
|
"types",
|
|
29
29
|
"documents",
|
|
30
|
+
"kinds",
|
|
31
|
+
"prose",
|
|
32
|
+
"discipline-mode",
|
|
30
33
|
]);
|
|
31
34
|
const ALLOWED_TYPE_KEYS = new Set([
|
|
32
35
|
"extends",
|
|
@@ -37,6 +40,7 @@ const ALLOWED_TYPE_KEYS = new Set([
|
|
|
37
40
|
"attributes",
|
|
38
41
|
"traceability",
|
|
39
42
|
"color",
|
|
43
|
+
"discipline",
|
|
40
44
|
]);
|
|
41
45
|
const ALLOWED_DOC_TYPE_KEYS = new Set(["id", "contains", "description"]);
|
|
42
46
|
const ALLOWED_DOCUMENTS_KEYS = new Set(["types", "frontMatter"]);
|
|
@@ -174,6 +178,42 @@ function parseCardinality(raw, fallback, context, sourcePath, diagnostics) {
|
|
|
174
178
|
}
|
|
175
179
|
return { lower, upper };
|
|
176
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
* Flatten a (possibly grouped) value list to its leaf value names. Accepts
|
|
183
|
+
* items that are bare strings, `{name, description?}` objects, or
|
|
184
|
+
* `{group, description?, values: [...]}` group objects (recursed). Group
|
|
185
|
+
* labels and descriptions are documentation-only and dropped — markspec
|
|
186
|
+
* validates against the value names. Returns `null` when any item matches
|
|
187
|
+
* none of these shapes.
|
|
188
|
+
*/
|
|
189
|
+
function flattenGroupedNames(raw) {
|
|
190
|
+
if (!Array.isArray(raw))
|
|
191
|
+
return null;
|
|
192
|
+
const out = [];
|
|
193
|
+
for (const item of raw) {
|
|
194
|
+
if (typeof item === "string") {
|
|
195
|
+
out.push(item);
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
if (item == null || typeof item !== "object" || Array.isArray(item)) {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
const o = item;
|
|
202
|
+
if (typeof o.name === "string") {
|
|
203
|
+
out.push(o.name);
|
|
204
|
+
}
|
|
205
|
+
else if (Array.isArray(o.values)) {
|
|
206
|
+
const nested = flattenGroupedNames(o.values);
|
|
207
|
+
if (nested === null)
|
|
208
|
+
return null;
|
|
209
|
+
out.push(...nested);
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return out;
|
|
216
|
+
}
|
|
177
217
|
function parseAttrDecl(raw, context, sourcePath, diagnostics) {
|
|
178
218
|
if (raw == null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
179
219
|
diagnostics.push({
|
|
@@ -221,19 +261,18 @@ function parseAttrDecl(raw, context, sourcePath, diagnostics) {
|
|
|
221
261
|
const cardinality = parseCardinality(r.cardinality, defaultCardinality(vtype), `${context}/${name}`, sourcePath, diagnostics);
|
|
222
262
|
let values;
|
|
223
263
|
if (vtype === "enum") {
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
rawValues.some((v) => typeof v !== "string") ||
|
|
227
|
-
rawValues.length === 0) {
|
|
264
|
+
const flat = flattenGroupedNames(r.values);
|
|
265
|
+
if (flat === null || flat.length === 0) {
|
|
228
266
|
diagnostics.push({
|
|
229
267
|
code: "PROFILE-LOAD-003",
|
|
230
268
|
severity: "error",
|
|
231
|
-
message: `${context}: enum attribute '${name}' requires a non-empty 'values' list
|
|
269
|
+
message: `${context}: enum attribute '${name}' requires a non-empty 'values' list ` +
|
|
270
|
+
`(strings, {name, description?}, or {group, values: [...]})`,
|
|
232
271
|
location: { file: sourcePath, line: 1, column: 1 },
|
|
233
272
|
});
|
|
234
273
|
return undefined;
|
|
235
274
|
}
|
|
236
|
-
values =
|
|
275
|
+
values = flat;
|
|
237
276
|
}
|
|
238
277
|
let inverse;
|
|
239
278
|
if (r.inverse !== undefined) {
|
|
@@ -462,27 +501,157 @@ function parseColorsMap(raw, sourcePath, diagnostics) {
|
|
|
462
501
|
}
|
|
463
502
|
return out;
|
|
464
503
|
}
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
504
|
+
/**
|
|
505
|
+
* Parse the `profile.kinds:` block. Each key must match COLOR_NAME_RE
|
|
506
|
+
* (the same lexical rule used for color names — lowercase letters,
|
|
507
|
+
* digits, hyphens, starting with a letter). Values may be:
|
|
508
|
+
* - `null` / `undefined` — declare the kind with no description.
|
|
509
|
+
* - a bare string — treated as the description shorthand.
|
|
510
|
+
* - a mapping with optional `description:`.
|
|
511
|
+
*
|
|
512
|
+
* Validation:
|
|
513
|
+
* - PROFILE-DISCIPLINE-001 (error): name fails the regex.
|
|
514
|
+
* - PROFILE-DISCIPLINE-002 (error): name is the reserved sentinel
|
|
515
|
+
* `MIXED_DISCIPLINE` ("mixed").
|
|
516
|
+
* - PROFILE-DISCIPLINE-003 (warning): name shadows a core kind
|
|
517
|
+
* (`system`/`software`/`hardware`).
|
|
518
|
+
*/
|
|
519
|
+
function parseKindsMap(raw, sourcePath, diagnostics) {
|
|
520
|
+
const out = new Map();
|
|
468
521
|
if (raw === undefined)
|
|
469
|
-
return
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
522
|
+
return out;
|
|
523
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
524
|
+
diagnostics.push({
|
|
525
|
+
code: "PROFILE-LOAD-003",
|
|
526
|
+
severity: "error",
|
|
527
|
+
message: "profile.kinds: must be a mapping",
|
|
528
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
529
|
+
});
|
|
530
|
+
return out;
|
|
531
|
+
}
|
|
532
|
+
for (const [name, value] of Object.entries(raw)) {
|
|
533
|
+
if (name === mod_js_1.MIXED_DISCIPLINE) {
|
|
534
|
+
diagnostics.push({
|
|
535
|
+
code: "PROFILE-DISCIPLINE-002",
|
|
536
|
+
severity: "error",
|
|
537
|
+
message: `profile.kinds: '${name}' is a reserved sentinel name; choose a different kind name`,
|
|
538
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
539
|
+
});
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
if (!mod_js_1.COLOR_NAME_RE.test(name)) {
|
|
543
|
+
diagnostics.push({
|
|
544
|
+
code: "PROFILE-DISCIPLINE-001",
|
|
545
|
+
severity: "error",
|
|
546
|
+
message: `profile.kinds: '${name}' is not a valid kind name (lowercase letters, digits, hyphens; must start with a letter)`,
|
|
547
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
548
|
+
});
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
if (mod_js_1.CORE_KINDS.has(name)) {
|
|
552
|
+
diagnostics.push({
|
|
553
|
+
code: "PROFILE-DISCIPLINE-003",
|
|
554
|
+
severity: "warning",
|
|
555
|
+
message: `profile.kinds: '${name}' redeclares a core kind (already shipped by markspec core); the declaration is idempotent and will be ignored`,
|
|
556
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
557
|
+
});
|
|
558
|
+
continue;
|
|
559
|
+
}
|
|
560
|
+
let description;
|
|
561
|
+
if (value === null || value === undefined) {
|
|
562
|
+
// declaration only
|
|
563
|
+
}
|
|
564
|
+
else if (typeof value === "string") {
|
|
565
|
+
description = value;
|
|
566
|
+
}
|
|
567
|
+
else if (typeof value === "object" && !Array.isArray(value)) {
|
|
568
|
+
const r = value;
|
|
569
|
+
if (r.description !== undefined && typeof r.description !== "string") {
|
|
475
570
|
diagnostics.push({
|
|
476
571
|
code: "PROFILE-LOAD-003",
|
|
477
572
|
severity: "error",
|
|
478
|
-
message:
|
|
573
|
+
message: `profile.kinds.${name}: 'description' must be a string`,
|
|
479
574
|
location: { file: sourcePath, line: 1, column: 1 },
|
|
480
575
|
});
|
|
481
|
-
|
|
576
|
+
continue;
|
|
482
577
|
}
|
|
483
|
-
|
|
578
|
+
description = typeof r.description === "string"
|
|
579
|
+
? r.description
|
|
580
|
+
: undefined;
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
diagnostics.push({
|
|
584
|
+
code: "PROFILE-LOAD-003",
|
|
585
|
+
severity: "error",
|
|
586
|
+
message: `profile.kinds.${name}: value must be null, a string, or a mapping with 'description'`,
|
|
587
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
588
|
+
});
|
|
589
|
+
continue;
|
|
484
590
|
}
|
|
485
|
-
|
|
591
|
+
out.set(name, description !== undefined ? { description } : {});
|
|
592
|
+
}
|
|
593
|
+
return out;
|
|
594
|
+
}
|
|
595
|
+
/** Closed enum of valid discipline-mode values (ADR-017 Slice 5). */
|
|
596
|
+
const DISCIPLINE_MODE_VALUES = new Set([
|
|
597
|
+
"flat",
|
|
598
|
+
"tiered",
|
|
599
|
+
"none",
|
|
600
|
+
]);
|
|
601
|
+
/**
|
|
602
|
+
* Parse the `profile.discipline-mode:` field. Must be a scalar string in
|
|
603
|
+
* {flat, tiered, none}. Returns `undefined` when the field is absent.
|
|
604
|
+
*
|
|
605
|
+
* Validation:
|
|
606
|
+
* - PROFILE-DISCIPLINE-006 (error): value is a scalar string but not
|
|
607
|
+
* in the allowed enum.
|
|
608
|
+
* - PROFILE-DISCIPLINE-007 (error): value is not a scalar string
|
|
609
|
+
* (mapping, list, etc.).
|
|
610
|
+
*/
|
|
611
|
+
function parseDisciplineMode(raw, sourcePath, diagnostics) {
|
|
612
|
+
if (raw === undefined || raw === null)
|
|
613
|
+
return undefined;
|
|
614
|
+
if (typeof raw !== "string") {
|
|
615
|
+
diagnostics.push({
|
|
616
|
+
code: "PROFILE-DISCIPLINE-007",
|
|
617
|
+
severity: "error",
|
|
618
|
+
message: `profile.discipline-mode: must be a scalar string (one of flat / tiered / none)`,
|
|
619
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
620
|
+
});
|
|
621
|
+
return undefined;
|
|
622
|
+
}
|
|
623
|
+
if (!DISCIPLINE_MODE_VALUES.has(raw)) {
|
|
624
|
+
diagnostics.push({
|
|
625
|
+
code: "PROFILE-DISCIPLINE-006",
|
|
626
|
+
severity: "error",
|
|
627
|
+
message: `profile.discipline-mode: '${raw}' is not a valid mode (must be one of: flat, tiered, none)`,
|
|
628
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
629
|
+
});
|
|
630
|
+
return undefined;
|
|
631
|
+
}
|
|
632
|
+
return raw;
|
|
633
|
+
}
|
|
634
|
+
const KNOWN_CONVENTIONS = new Set(["modal-keywords"]);
|
|
635
|
+
const MODAL_KEYWORDS_CASING_VALUES = new Set(["rfc2119", "iso", "preserve"]);
|
|
636
|
+
function parseLabelConcerns(raw, sourcePath, diagnostics) {
|
|
637
|
+
if (raw === undefined)
|
|
638
|
+
return [];
|
|
639
|
+
// Form A: sequence of label names → each becomes a flag concern. Entries
|
|
640
|
+
// may be bare strings or grouped objects ({group, values: [{name}, ...]});
|
|
641
|
+
// groups and descriptions are documentation-only and flattened away.
|
|
642
|
+
if (Array.isArray(raw)) {
|
|
643
|
+
const names = flattenGroupedNames(raw);
|
|
644
|
+
if (names === null) {
|
|
645
|
+
diagnostics.push({
|
|
646
|
+
code: "PROFILE-LOAD-003",
|
|
647
|
+
severity: "error",
|
|
648
|
+
message: "profile.labels: list entries must be strings, {name, description?}, " +
|
|
649
|
+
"or {group, values: [...]}",
|
|
650
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
651
|
+
});
|
|
652
|
+
return [];
|
|
653
|
+
}
|
|
654
|
+
return names.map((name) => ({ name, kind: "flag", values: [] }));
|
|
486
655
|
}
|
|
487
656
|
// Form B: mapping — each key is a concern name.
|
|
488
657
|
if (raw === null || typeof raw !== "object") {
|
|
@@ -653,6 +822,46 @@ function parseConventions(raw, sourcePath, diagnostics) {
|
|
|
653
822
|
}
|
|
654
823
|
return out;
|
|
655
824
|
}
|
|
825
|
+
/**
|
|
826
|
+
* Parse the `profile.prose:` section. Returns a normalized object with
|
|
827
|
+
* the two lexicon lists; absent lists default to `[]`.
|
|
828
|
+
*/
|
|
829
|
+
function parseProse(raw, sourcePath, diagnostics) {
|
|
830
|
+
const empty = {
|
|
831
|
+
lexicons: { "capitalized-allow": [], "sentence-abbrev": [] },
|
|
832
|
+
};
|
|
833
|
+
if (raw === undefined || raw === null)
|
|
834
|
+
return empty;
|
|
835
|
+
if (typeof raw !== "object" || Array.isArray(raw)) {
|
|
836
|
+
diagnostics.push({
|
|
837
|
+
code: "PROFILE-LOAD-003",
|
|
838
|
+
severity: "error",
|
|
839
|
+
message: "'profile.prose' must be a mapping",
|
|
840
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
841
|
+
});
|
|
842
|
+
return empty;
|
|
843
|
+
}
|
|
844
|
+
const r = raw;
|
|
845
|
+
const lexRaw = r.lexicons;
|
|
846
|
+
if (lexRaw === undefined || lexRaw === null) {
|
|
847
|
+
return empty;
|
|
848
|
+
}
|
|
849
|
+
if (typeof lexRaw !== "object" || Array.isArray(lexRaw)) {
|
|
850
|
+
diagnostics.push({
|
|
851
|
+
code: "PROFILE-LOAD-003",
|
|
852
|
+
severity: "error",
|
|
853
|
+
message: "'profile.prose.lexicons' must be a mapping",
|
|
854
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
855
|
+
});
|
|
856
|
+
return empty;
|
|
857
|
+
}
|
|
858
|
+
const lex = lexRaw;
|
|
859
|
+
const capAllow = parseStringList(lex["capitalized-allow"], "profile.prose.lexicons.capitalized-allow", sourcePath, diagnostics);
|
|
860
|
+
const sentAbbrev = parseStringList(lex["sentence-abbrev"], "profile.prose.lexicons.sentence-abbrev", sourcePath, diagnostics);
|
|
861
|
+
return {
|
|
862
|
+
lexicons: { "capitalized-allow": capAllow, "sentence-abbrev": sentAbbrev },
|
|
863
|
+
};
|
|
864
|
+
}
|
|
656
865
|
function parseTypeDef(name, raw, sourcePath, diagnostics) {
|
|
657
866
|
const ctx = `profile.types.${name}`;
|
|
658
867
|
if (raw == null || typeof raw !== "object" || Array.isArray(raw)) {
|
|
@@ -735,6 +944,20 @@ function parseTypeDef(name, raw, sourcePath, diagnostics) {
|
|
|
735
944
|
}
|
|
736
945
|
color = r.color;
|
|
737
946
|
}
|
|
947
|
+
// PROFILE-DISCIPLINE-005 (error): value is not a non-empty string.
|
|
948
|
+
let discipline;
|
|
949
|
+
if (r.discipline !== undefined) {
|
|
950
|
+
if (typeof r.discipline !== "string" || r.discipline.length === 0) {
|
|
951
|
+
diagnostics.push({
|
|
952
|
+
code: "PROFILE-DISCIPLINE-005",
|
|
953
|
+
severity: "error",
|
|
954
|
+
message: `${ctx}: 'discipline' must be a non-empty string`,
|
|
955
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
956
|
+
});
|
|
957
|
+
return undefined;
|
|
958
|
+
}
|
|
959
|
+
discipline = r.discipline;
|
|
960
|
+
}
|
|
738
961
|
const description = typeof r.description === "string"
|
|
739
962
|
? r.description
|
|
740
963
|
: undefined;
|
|
@@ -751,6 +974,7 @@ function parseTypeDef(name, raw, sourcePath, diagnostics) {
|
|
|
751
974
|
traceability,
|
|
752
975
|
color,
|
|
753
976
|
description,
|
|
977
|
+
discipline,
|
|
754
978
|
};
|
|
755
979
|
}
|
|
756
980
|
function parseTypesMap(raw, sourcePath, diagnostics) {
|
|
@@ -952,6 +1176,8 @@ function parseManifest(rawYaml, sourcePath = "<markspec.yaml>") {
|
|
|
952
1176
|
const universalAttributes = parseAttrList(profileSection.attributes, "profile.attributes", sourcePath, diagnostics);
|
|
953
1177
|
const labels = parseLabelConcerns(profileSection.labels, sourcePath, diagnostics);
|
|
954
1178
|
const colors = parseColorsMap(profileSection.colors, sourcePath, diagnostics);
|
|
1179
|
+
const kinds = parseKindsMap(profileSection.kinds, sourcePath, diagnostics);
|
|
1180
|
+
const disciplineMode = parseDisciplineMode(profileSection["discipline-mode"], sourcePath, diagnostics);
|
|
955
1181
|
const conventions = parseConventions(profileSection.conventions, sourcePath, diagnostics);
|
|
956
1182
|
if (diagnostics.some((d) => d.severity === "error")) {
|
|
957
1183
|
return { manifest: null, diagnostics };
|
|
@@ -964,6 +1190,10 @@ function parseManifest(rawYaml, sourcePath = "<markspec.yaml>") {
|
|
|
964
1190
|
if (diagnostics.some((d) => d.severity === "error")) {
|
|
965
1191
|
return { manifest: null, diagnostics };
|
|
966
1192
|
}
|
|
1193
|
+
const prose = parseProse(profileSection.prose, sourcePath, diagnostics);
|
|
1194
|
+
if (diagnostics.some((d) => d.severity === "error")) {
|
|
1195
|
+
return { manifest: null, diagnostics };
|
|
1196
|
+
}
|
|
967
1197
|
// PROFILE-SCHEMA-002: emitted on the otherwise-complete manifest so it
|
|
968
1198
|
// doesn't add noise to error-case output.
|
|
969
1199
|
if (rawSchema === undefined) {
|
|
@@ -989,6 +1219,9 @@ function parseManifest(rawYaml, sourcePath = "<markspec.yaml>") {
|
|
|
989
1219
|
colors,
|
|
990
1220
|
types: types,
|
|
991
1221
|
documents: documents,
|
|
1222
|
+
kinds,
|
|
1223
|
+
prose,
|
|
1224
|
+
disciplineMode,
|
|
992
1225
|
};
|
|
993
1226
|
return { manifest, diagnostics };
|
|
994
1227
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/profile/merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/profile/merge.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EAEV,UAAU,EAGV,gBAAgB,EAKhB,YAAY,EASb,MAAM,iBAAiB,CAAC;AAGzB,oDAAoD;AACpD,MAAM,WAAW,WAAW;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,YAAY,GAAG,WAAW,CAiF3D"}
|
package/script/profile/merge.js
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.mergeChain = mergeChain;
|
|
13
|
+
const mod_js_1 = require("../model/mod.js");
|
|
14
|
+
const discipline_mode_js_1 = require("./discipline_mode.js");
|
|
13
15
|
/**
|
|
14
16
|
* Merge all tiers of a chain into one EffectiveProfile. Tiers are processed
|
|
15
17
|
* in root → leaf order; later tiers can add to or tighten earlier tiers'
|
|
@@ -44,13 +46,39 @@ function mergeChain(chain) {
|
|
|
44
46
|
// required is narrower than its shape-scope required, for example.
|
|
45
47
|
// Start from root, fold each subsequent tier.
|
|
46
48
|
let effective = seedFromTier(tiers[0]);
|
|
49
|
+
// ADR-017 Slice 5: LWW accumulator for declared discipline-mode across
|
|
50
|
+
// tiers. Initialized from the seed tier; updated on each subsequent tier
|
|
51
|
+
// that supplies a value. Resolved post-fold via resolveDisciplineMode().
|
|
52
|
+
let declaredMode;
|
|
53
|
+
const seedMode = tiers[0].manifest.disciplineMode;
|
|
54
|
+
if (seedMode !== undefined) {
|
|
55
|
+
declaredMode = {
|
|
56
|
+
value: seedMode,
|
|
57
|
+
origin: tiers[0].manifest.id,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
47
60
|
for (let i = 1; i < tiers.length; i++) {
|
|
48
61
|
effective = foldTier(effective, tiers[i], diagnostics);
|
|
62
|
+
const tierMode = tiers[i].manifest.disciplineMode;
|
|
63
|
+
if (tierMode !== undefined) {
|
|
64
|
+
declaredMode = {
|
|
65
|
+
value: tierMode,
|
|
66
|
+
origin: tiers[i].manifest.id,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
49
69
|
}
|
|
50
70
|
// Validate per-type color references against the FINAL merged colors map.
|
|
51
71
|
// Running this only after all tiers fold avoids false positives when a parent
|
|
52
72
|
// tier references a color that a child tier supplies in its colors: block.
|
|
53
73
|
validateTypeColors(effective, diagnostics, tiers[tiers.length - 1].sourcePath);
|
|
74
|
+
validateTypeDisciplines(effective, diagnostics, tiers[tiers.length - 1].sourcePath);
|
|
75
|
+
// ADR-017 Slice 5: resolve disciplineMode AFTER the full chain has folded
|
|
76
|
+
// so inference sees the final type graph. The accumulator `declaredMode`
|
|
77
|
+
// (set above) carries the LWW-declared value across tiers.
|
|
78
|
+
effective = {
|
|
79
|
+
...effective,
|
|
80
|
+
disciplineMode: (0, discipline_mode_js_1.resolveDisciplineMode)(effective, declaredMode),
|
|
81
|
+
};
|
|
54
82
|
// If any merge error was recorded, drop the effective profile.
|
|
55
83
|
const hasError = diagnostics.some((d) => d.severity === "error");
|
|
56
84
|
return hasError
|
|
@@ -71,6 +99,8 @@ function foldTier(base, tier, diagnostics) {
|
|
|
71
99
|
const attributes = unionAttrMap(base.attributes, m.universalAttributes, origin, diagnostics);
|
|
72
100
|
// Colors map: last-write-wins per key, additive across tiers.
|
|
73
101
|
const colors = unionColorsMap(base.colors, m.colors, origin);
|
|
102
|
+
// Kinds map: additive across tiers, child wins on description.
|
|
103
|
+
const kinds = unionKindsMap(base.kinds, m.kinds, origin);
|
|
74
104
|
// Types — add new types, fold existing ones.
|
|
75
105
|
const types = new Map(base.types);
|
|
76
106
|
for (const [name, td] of m.types) {
|
|
@@ -92,6 +122,7 @@ function foldTier(base, tier, diagnostics) {
|
|
|
92
122
|
description: { value: td.description, origin },
|
|
93
123
|
attrDescriptions: mapFromAttrDescriptions(td.attributes, origin),
|
|
94
124
|
relationDescriptions: mapFromTraceDescriptions(td.traceability, origin),
|
|
125
|
+
discipline: { value: td.discipline, origin },
|
|
95
126
|
};
|
|
96
127
|
types.set(name, { value: eff, origin });
|
|
97
128
|
}
|
|
@@ -112,6 +143,9 @@ function foldTier(base, tier, diagnostics) {
|
|
|
112
143
|
// Overlap handling deferred.
|
|
113
144
|
}
|
|
114
145
|
const frontMatter = unionAttrMap(base.documents.frontMatter, m.documents.frontMatter, origin, diagnostics);
|
|
146
|
+
// Prose lexicons: list-additive across tiers (profile-schema §5.1).
|
|
147
|
+
const capAllow = unionList(base.prose.lexicons["capitalized-allow"], m.prose.lexicons["capitalized-allow"], origin);
|
|
148
|
+
const sentAbbrev = unionList(base.prose.lexicons["sentence-abbrev"], m.prose.lexicons["sentence-abbrev"], origin);
|
|
115
149
|
const result = {
|
|
116
150
|
attributes,
|
|
117
151
|
labels,
|
|
@@ -122,6 +156,14 @@ function foldTier(base, tier, diagnostics) {
|
|
|
122
156
|
types: docTypes,
|
|
123
157
|
frontMatter,
|
|
124
158
|
},
|
|
159
|
+
kinds,
|
|
160
|
+
prose: {
|
|
161
|
+
lexicons: {
|
|
162
|
+
"capitalized-allow": capAllow,
|
|
163
|
+
"sentence-abbrev": sentAbbrev,
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
disciplineMode: { value: "none", origin: "inferred" },
|
|
125
167
|
};
|
|
126
168
|
return result;
|
|
127
169
|
}
|
|
@@ -169,6 +211,30 @@ function validateTypeColors(effective, diagnostics, fallbackFile) {
|
|
|
169
211
|
}
|
|
170
212
|
}
|
|
171
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* After the full chain folds, verify each type's `discipline.value` (when
|
|
216
|
+
* set) names a kind that is in the merged `effective.kinds` map ∪
|
|
217
|
+
* CORE_KINDS. Emits PROFILE-DISCIPLINE-004 for each violation. Runs after
|
|
218
|
+
* the merge because a parent tier's kind must be visible to a child
|
|
219
|
+
* tier's type.
|
|
220
|
+
*/
|
|
221
|
+
function validateTypeDisciplines(effective, diagnostics, fallbackFile) {
|
|
222
|
+
for (const [typeName, entry] of effective.types) {
|
|
223
|
+
const value = entry.value.discipline.value;
|
|
224
|
+
if (value === undefined)
|
|
225
|
+
continue;
|
|
226
|
+
if (mod_js_1.CORE_KINDS.has(value))
|
|
227
|
+
continue;
|
|
228
|
+
if (effective.kinds.has(value))
|
|
229
|
+
continue;
|
|
230
|
+
diagnostics.push({
|
|
231
|
+
code: "PROFILE-DISCIPLINE-004",
|
|
232
|
+
severity: "error",
|
|
233
|
+
message: `type '${typeName}' references unknown discipline kind '${value}' (declare it under profile.kinds: in this profile or a parent)`,
|
|
234
|
+
location: { file: fallbackFile, line: 1, column: 1 },
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
}
|
|
172
238
|
/**
|
|
173
239
|
* Union of two string lists; parent entries first, child entries appended,
|
|
174
240
|
* duplicates dropped. Origin = child tier if anything was added, else parent.
|
|
@@ -323,6 +389,10 @@ function tightenType(existing, child, childOrigin, diagnostics) {
|
|
|
323
389
|
const description = child.description !== undefined
|
|
324
390
|
? { value: child.description, origin: childOrigin }
|
|
325
391
|
: effExisting.description;
|
|
392
|
+
// Discipline: child wins when set; otherwise parent stays.
|
|
393
|
+
const discipline = child.discipline !== undefined
|
|
394
|
+
? { value: child.discipline, origin: childOrigin }
|
|
395
|
+
: effExisting.discipline;
|
|
326
396
|
const attrDescriptions = mergeDescriptionMap(effExisting.attrDescriptions, child.attributes.map((a) => ({ name: a.name, desc: a.description })), childOrigin);
|
|
327
397
|
const relationDescriptions = mergeDescriptionMap(effExisting.relationDescriptions, [...child.traceability.entries()].map(([name, r]) => ({
|
|
328
398
|
name,
|
|
@@ -340,6 +410,7 @@ function tightenType(existing, child, childOrigin, diagnostics) {
|
|
|
340
410
|
description,
|
|
341
411
|
attrDescriptions,
|
|
342
412
|
relationDescriptions,
|
|
413
|
+
discipline,
|
|
343
414
|
};
|
|
344
415
|
const overrides = [
|
|
345
416
|
...(existing.overrides ?? []),
|
|
@@ -461,6 +532,20 @@ function seedFromTier(tier) {
|
|
|
461
532
|
types: mapFromDocTypes(m.documents.types, origin),
|
|
462
533
|
frontMatter: mapFromAttrList(m.documents.frontMatter, origin),
|
|
463
534
|
},
|
|
535
|
+
kinds: mapFromKinds(m.kinds, origin),
|
|
536
|
+
prose: {
|
|
537
|
+
lexicons: {
|
|
538
|
+
"capitalized-allow": {
|
|
539
|
+
value: m.prose.lexicons["capitalized-allow"],
|
|
540
|
+
origin,
|
|
541
|
+
},
|
|
542
|
+
"sentence-abbrev": {
|
|
543
|
+
value: m.prose.lexicons["sentence-abbrev"],
|
|
544
|
+
origin,
|
|
545
|
+
},
|
|
546
|
+
},
|
|
547
|
+
},
|
|
548
|
+
disciplineMode: { value: "none", origin: "inferred" },
|
|
464
549
|
};
|
|
465
550
|
}
|
|
466
551
|
function mapFromColors(colors, origin) {
|
|
@@ -470,6 +555,32 @@ function mapFromColors(colors, origin) {
|
|
|
470
555
|
}
|
|
471
556
|
return out;
|
|
472
557
|
}
|
|
558
|
+
/**
|
|
559
|
+
* Union of `kinds:` maps across tiers. Additive: every tier's kinds are
|
|
560
|
+
* carried. When two tiers declare the same kind, the child wins on
|
|
561
|
+
* description and `overrides` records the displaced parent.
|
|
562
|
+
*/
|
|
563
|
+
function unionKindsMap(parent, childKinds, childOrigin) {
|
|
564
|
+
if (childKinds.size === 0)
|
|
565
|
+
return parent;
|
|
566
|
+
const out = new Map(parent);
|
|
567
|
+
for (const [name, kd] of childKinds) {
|
|
568
|
+
const prior = out.get(name);
|
|
569
|
+
out.set(name, {
|
|
570
|
+
value: kd,
|
|
571
|
+
origin: childOrigin,
|
|
572
|
+
overrides: prior ? [...(prior.overrides ?? []), prior.origin] : undefined,
|
|
573
|
+
});
|
|
574
|
+
}
|
|
575
|
+
return out;
|
|
576
|
+
}
|
|
577
|
+
function mapFromKinds(kinds, origin) {
|
|
578
|
+
const out = new Map();
|
|
579
|
+
for (const [name, kd] of kinds) {
|
|
580
|
+
out.set(name, { value: kd, origin });
|
|
581
|
+
}
|
|
582
|
+
return out;
|
|
583
|
+
}
|
|
473
584
|
function mapFromLabelConcerns(concerns, origin) {
|
|
474
585
|
const out = new Map();
|
|
475
586
|
for (const c of concerns) {
|
|
@@ -607,6 +718,7 @@ function mapFromTypes(types, origin) {
|
|
|
607
718
|
description: { value: td.description, origin },
|
|
608
719
|
attrDescriptions: mapFromAttrDescriptions(td.attributes, origin),
|
|
609
720
|
relationDescriptions: mapFromTraceDescriptions(td.traceability, origin),
|
|
721
|
+
discipline: { value: td.discipline, origin },
|
|
610
722
|
};
|
|
611
723
|
out.set(name, { value: eff, origin });
|
|
612
724
|
}
|
package/script/profile/mod.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export type { LoadProfileForCommandResult } from "./load.js";
|
|
|
17
17
|
export { mergeChain } from "./merge.js";
|
|
18
18
|
export type { MergeResult } from "./merge.js";
|
|
19
19
|
export { resolveEntryColor } from "./colors.js";
|
|
20
|
+
export { buildEffectiveDisciplineRegistry } from "./discipline_registry.js";
|
|
21
|
+
export { inferDisciplineMode, resolveDisciplineMode, } from "./discipline_mode.js";
|
|
20
22
|
export { buildProfileIntrospection } from "./introspect.js";
|
|
21
23
|
export type { AttributeDetail, ConventionDetail, LabelConcernDetail, ProfileElementDetail, ProfileElementKind, ProfileElementRef, ProfileIntrospection, ProfileOverview, ProvenancedDescription, RelationDetail, TypeDetail, } from "./introspect.js";
|
|
22
24
|
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/profile/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/profile/mod.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,YAAY,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE9E,OAAO,EACL,eAAe,EACf,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,qBAAqB,GACtB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACV,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,MAAM,EACN,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAClD,YAAY,EAAE,2BAA2B,EAAE,MAAM,WAAW,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAO9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAE5E,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,UAAU,GACX,MAAM,iBAAiB,CAAC"}
|
package/script/profile/mod.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* resolution, and merging. Consumed by the validator pipeline and the CLI.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.buildProfileIntrospection = exports.resolveEntryColor = exports.mergeChain = exports.loadProfileForCommand = exports.loadChain = exports.ensureCacheGitignored = exports.defaultRunGit = exports.defaultAppendFile = exports.computeCacheLocation = exports.computeCacheKey = exports.resolveLocalSpecifier = exports.resolveGitSpecifier = exports.parseManifest = void 0;
|
|
9
|
+
exports.buildProfileIntrospection = exports.resolveDisciplineMode = exports.inferDisciplineMode = exports.buildEffectiveDisciplineRegistry = exports.resolveEntryColor = exports.mergeChain = exports.loadProfileForCommand = exports.loadChain = exports.ensureCacheGitignored = exports.defaultRunGit = exports.defaultAppendFile = exports.computeCacheLocation = exports.computeCacheKey = exports.resolveLocalSpecifier = exports.resolveGitSpecifier = exports.parseManifest = void 0;
|
|
10
10
|
var manifest_js_1 = require("./manifest.js");
|
|
11
11
|
Object.defineProperty(exports, "parseManifest", { enumerable: true, get: function () { return manifest_js_1.parseManifest; } });
|
|
12
12
|
var resolver_js_1 = require("./resolver.js");
|
|
@@ -30,5 +30,10 @@ Object.defineProperty(exports, "mergeChain", { enumerable: true, get: function (
|
|
|
30
30
|
// core/mod.ts. Consumers use loadChain / loadProfileForCommand instead.
|
|
31
31
|
var colors_js_1 = require("./colors.js");
|
|
32
32
|
Object.defineProperty(exports, "resolveEntryColor", { enumerable: true, get: function () { return colors_js_1.resolveEntryColor; } });
|
|
33
|
+
var discipline_registry_js_1 = require("./discipline_registry.js");
|
|
34
|
+
Object.defineProperty(exports, "buildEffectiveDisciplineRegistry", { enumerable: true, get: function () { return discipline_registry_js_1.buildEffectiveDisciplineRegistry; } });
|
|
35
|
+
var discipline_mode_js_1 = require("./discipline_mode.js");
|
|
36
|
+
Object.defineProperty(exports, "inferDisciplineMode", { enumerable: true, get: function () { return discipline_mode_js_1.inferDisciplineMode; } });
|
|
37
|
+
Object.defineProperty(exports, "resolveDisciplineMode", { enumerable: true, get: function () { return discipline_mode_js_1.resolveDisciplineMode; } });
|
|
33
38
|
var introspect_js_1 = require("./introspect.js");
|
|
34
39
|
Object.defineProperty(exports, "buildProfileIntrospection", { enumerable: true, get: function () { return introspect_js_1.buildProfileIntrospection; } });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/sync/locked_attributes
|
|
3
|
+
*
|
|
4
|
+
* Infers which MarkSpec attributes are upstream-owned (locally read-only)
|
|
5
|
+
* for a single mapping. Reads only per-attribute direction + locked
|
|
6
|
+
* fields — the top-level system direction has already been baked into
|
|
7
|
+
* every per-attribute direction at parse time (see `parseMapping`), so
|
|
8
|
+
* this function does not need to consult it.
|
|
9
|
+
*
|
|
10
|
+
* Locking rule:
|
|
11
|
+
* - Per-attribute direction `outbound` → never locked
|
|
12
|
+
* - Per-attribute `locked: true` → locked
|
|
13
|
+
* - Per-attribute direction `inbound` → locked
|
|
14
|
+
* - Per-attribute direction `bidirectional` without `locked: true` → not locked
|
|
15
|
+
*/
|
|
16
|
+
import type { Mapping } from "./mapping.js";
|
|
17
|
+
/** The set of MarkSpec attribute names locked for this mapping. */
|
|
18
|
+
export declare function inferLockedAttributes(mapping: Mapping): Set<string>;
|
|
19
|
+
//# sourceMappingURL=locked_attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locked_attributes.d.ts","sourceRoot":"","sources":["../../src/sync/locked_attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C,mEAAmE;AACnE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CASnE"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/sync/locked_attributes
|
|
4
|
+
*
|
|
5
|
+
* Infers which MarkSpec attributes are upstream-owned (locally read-only)
|
|
6
|
+
* for a single mapping. Reads only per-attribute direction + locked
|
|
7
|
+
* fields — the top-level system direction has already been baked into
|
|
8
|
+
* every per-attribute direction at parse time (see `parseMapping`), so
|
|
9
|
+
* this function does not need to consult it.
|
|
10
|
+
*
|
|
11
|
+
* Locking rule:
|
|
12
|
+
* - Per-attribute direction `outbound` → never locked
|
|
13
|
+
* - Per-attribute `locked: true` → locked
|
|
14
|
+
* - Per-attribute direction `inbound` → locked
|
|
15
|
+
* - Per-attribute direction `bidirectional` without `locked: true` → not locked
|
|
16
|
+
*/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.inferLockedAttributes = inferLockedAttributes;
|
|
19
|
+
/** The set of MarkSpec attribute names locked for this mapping. */
|
|
20
|
+
function inferLockedAttributes(mapping) {
|
|
21
|
+
const locked = new Set();
|
|
22
|
+
for (const a of mapping.attributes) {
|
|
23
|
+
if (a.direction === "outbound")
|
|
24
|
+
continue;
|
|
25
|
+
if (a.locked || a.direction === "inbound") {
|
|
26
|
+
locked.add(a.markspec);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return locked;
|
|
30
|
+
}
|