@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
package/script/compiler/mod.js
CHANGED
|
@@ -8,10 +8,102 @@
|
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.generateInverses = exports.serializeCompileResult = void 0;
|
|
10
10
|
exports.compile = compile;
|
|
11
|
-
const mod_js_1 = require("../
|
|
12
|
-
const mod_js_2 = require("../
|
|
11
|
+
const mod_js_1 = require("../model/mod.js");
|
|
12
|
+
const mod_js_2 = require("../parser/mod.js");
|
|
13
|
+
const mod_js_3 = require("../validator/mod.js");
|
|
14
|
+
const mod_js_4 = require("../typl/mod.js");
|
|
15
|
+
const discipline_registry_js_1 = require("../profile/discipline_registry.js");
|
|
16
|
+
const constants_js_1 = require("./constants.js");
|
|
17
|
+
const discipline_classifier_js_1 = require("./discipline_classifier.js");
|
|
13
18
|
const inverses_js_1 = require("./inverses.js");
|
|
14
19
|
const link_target_js_1 = require("./link_target.js");
|
|
20
|
+
/**
|
|
21
|
+
* Shape the raw git observations from {@linkcode CompileOptions.gitFile}
|
|
22
|
+
* into an entry's `properties.git`. Enforces the PII gate (contributors
|
|
23
|
+
* dropped unless `withContributors`) and makes the contributor list
|
|
24
|
+
* deterministic (deduplicated + sorted). Returns undefined when there is
|
|
25
|
+
* no git data, so absent history leaves `properties.git` unset rather
|
|
26
|
+
* than emitting an empty object.
|
|
27
|
+
*/
|
|
28
|
+
function resolveGit(raw, withContributors) {
|
|
29
|
+
if (!raw)
|
|
30
|
+
return undefined;
|
|
31
|
+
const git = {};
|
|
32
|
+
if (raw.createdAt)
|
|
33
|
+
git.createdAt = raw.createdAt;
|
|
34
|
+
if (raw.modifiedAt)
|
|
35
|
+
git.modifiedAt = raw.modifiedAt;
|
|
36
|
+
if (raw.revision)
|
|
37
|
+
git.revision = raw.revision;
|
|
38
|
+
if (withContributors && raw.contributors && raw.contributors.length > 0) {
|
|
39
|
+
git.contributors = [...new Set(raw.contributors)].sort();
|
|
40
|
+
}
|
|
41
|
+
return Object.keys(git).length > 0 ? git : undefined;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Project `Entry.source` onto `EntryProperties.source`. Always returns a
|
|
45
|
+
* non-empty object — every entry has a known source category. Markdown
|
|
46
|
+
* entries get `{ type: "markdown" }`; doc-comment entries get the full
|
|
47
|
+
* code-source fan-out (adapter, language, function, rule).
|
|
48
|
+
*/
|
|
49
|
+
function resolveSource(source) {
|
|
50
|
+
if (source.kind === "markdown") {
|
|
51
|
+
return { type: "markdown" };
|
|
52
|
+
}
|
|
53
|
+
if (source.kind === "doc-comment") {
|
|
54
|
+
return {
|
|
55
|
+
type: "code",
|
|
56
|
+
adapter: "tree-sitter",
|
|
57
|
+
language: source.language,
|
|
58
|
+
function: source.function,
|
|
59
|
+
rule: source.rule,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Exhaustiveness check — adding a third EntrySource variant becomes a
|
|
63
|
+
// compile-time error here, forcing a deliberate decision about its
|
|
64
|
+
// properties.source projection rather than silently inheriting the
|
|
65
|
+
// tree-sitter branch's defaults.
|
|
66
|
+
const _exhaustive = source;
|
|
67
|
+
throw new Error(`unhandled EntrySource: ${JSON.stringify(_exhaustive)}`);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Semaphore for bounded concurrency — limits simultaneous file reads to
|
|
71
|
+
* avoid exhausting OS file-descriptor limits on large projects.
|
|
72
|
+
*
|
|
73
|
+
* Private to this module; not exported.
|
|
74
|
+
*/
|
|
75
|
+
class Semaphore {
|
|
76
|
+
constructor(maxConcurrent) {
|
|
77
|
+
Object.defineProperty(this, "maxConcurrent", {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
configurable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
value: maxConcurrent
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(this, "queue", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
configurable: true,
|
|
86
|
+
writable: true,
|
|
87
|
+
value: []
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
async acquire() {
|
|
91
|
+
if (this.maxConcurrent > 0) {
|
|
92
|
+
this.maxConcurrent--;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
await new Promise((resolve) => this.queue.push(resolve));
|
|
96
|
+
}
|
|
97
|
+
release() {
|
|
98
|
+
const next = this.queue.shift();
|
|
99
|
+
if (next) {
|
|
100
|
+
next();
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
this.maxConcurrent++;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
15
107
|
/**
|
|
16
108
|
* Compile MarkSpec files from the given paths into a resolved
|
|
17
109
|
* traceability graph.
|
|
@@ -25,49 +117,79 @@ async function compile(paths, options) {
|
|
|
25
117
|
const allEntries = [];
|
|
26
118
|
const parseDiagnostics = [];
|
|
27
119
|
const documents = new Map();
|
|
28
|
-
// Phase 1: Read and parse all files.
|
|
29
|
-
|
|
30
|
-
|
|
120
|
+
// Phase 1: Read and parse all files with bounded concurrency (16 slots).
|
|
121
|
+
// Using Promise.all avoids sequential I/O latency on large projects while
|
|
122
|
+
// the semaphore prevents exhausting OS file-descriptor limits.
|
|
123
|
+
const sem = new Semaphore(16);
|
|
124
|
+
const fileResults = await Promise.all([...paths].map(async (filePath) => {
|
|
125
|
+
await sem.acquire();
|
|
31
126
|
try {
|
|
32
|
-
content
|
|
127
|
+
let content;
|
|
128
|
+
try {
|
|
129
|
+
content = await read(filePath);
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return {
|
|
133
|
+
filePath,
|
|
134
|
+
entries: [],
|
|
135
|
+
diagnostics: [{
|
|
136
|
+
code: "MSL-E000",
|
|
137
|
+
severity: "error",
|
|
138
|
+
message: `failed to read file: ${filePath}`,
|
|
139
|
+
location: undefined,
|
|
140
|
+
}],
|
|
141
|
+
document: undefined,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
const result = await (0, mod_js_2.parseFile)(content, { file: filePath });
|
|
145
|
+
const stat = options.statFile
|
|
146
|
+
? await options.statFile(filePath)
|
|
147
|
+
: undefined;
|
|
148
|
+
const mtimeStr = stat?.mtime ? stat.mtime.toISOString() : undefined;
|
|
149
|
+
const git = resolveGit(options.gitFile ? await options.gitFile(filePath) : undefined, options.withContributors ?? false);
|
|
150
|
+
const annotatedEntries = result.entries.map((entry) => ({
|
|
151
|
+
...entry,
|
|
152
|
+
properties: {
|
|
153
|
+
...entry.properties,
|
|
154
|
+
file: {
|
|
155
|
+
path: filePath,
|
|
156
|
+
line: entry.location.line,
|
|
157
|
+
column: entry.location.column,
|
|
158
|
+
mtime: mtimeStr,
|
|
159
|
+
},
|
|
160
|
+
...(git ? { git } : {}),
|
|
161
|
+
source: resolveSource(entry.source), // NEW — always set
|
|
162
|
+
},
|
|
163
|
+
}));
|
|
164
|
+
return {
|
|
165
|
+
filePath,
|
|
166
|
+
entries: annotatedEntries,
|
|
167
|
+
diagnostics: [...result.diagnostics],
|
|
168
|
+
document: result.document,
|
|
169
|
+
};
|
|
33
170
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
code: "MSL-E000",
|
|
37
|
-
severity: "error",
|
|
38
|
-
message: `failed to read file: ${filePath}`,
|
|
39
|
-
location: undefined,
|
|
40
|
-
});
|
|
41
|
-
continue;
|
|
171
|
+
finally {
|
|
172
|
+
sem.release();
|
|
42
173
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
...entry.properties,
|
|
52
|
-
file: {
|
|
53
|
-
path: filePath,
|
|
54
|
-
line: entry.location.line,
|
|
55
|
-
column: entry.location.column,
|
|
56
|
-
mtime: mtimeStr,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
}));
|
|
60
|
-
allEntries.push(...annotatedEntries);
|
|
61
|
-
parseDiagnostics.push(...result.diagnostics);
|
|
62
|
-
if (result.document)
|
|
63
|
-
documents.set(filePath, result.document);
|
|
174
|
+
}));
|
|
175
|
+
for (const res of fileResults) {
|
|
176
|
+
if (!res)
|
|
177
|
+
continue;
|
|
178
|
+
allEntries.push(...res.entries);
|
|
179
|
+
parseDiagnostics.push(...res.diagnostics);
|
|
180
|
+
if (res.document)
|
|
181
|
+
documents.set(res.filePath, res.document);
|
|
64
182
|
}
|
|
65
|
-
// Phase 2: Validate all entries.
|
|
66
|
-
|
|
183
|
+
// Phase 2: Validate all entries. When a profile is loaded, suppress the
|
|
184
|
+
// core-only MSL-R010 "unknown attribute" warnings for attributes the profile
|
|
185
|
+
// declares — mirrors runPipeline's Stage 1 so LSP/MCP diagnostics match the
|
|
186
|
+
// `validate` command instead of flooding the editor with false positives.
|
|
187
|
+
const validationResult = (0, mod_js_3.validate)(allEntries);
|
|
188
|
+
const validationDiagnostics = (0, mod_js_3.suppressDeclaredAttrR010)(validationResult.diagnostics, allEntries, options.profile ?? null);
|
|
67
189
|
// Phase 2.5: Classify entries when a profile is loaded.
|
|
68
190
|
let classifiedEntries = allEntries;
|
|
69
191
|
if (options.profile) {
|
|
70
|
-
const stage2 = (0,
|
|
192
|
+
const stage2 = (0, mod_js_3.classifyEntriesStage)(allEntries, options.profile);
|
|
71
193
|
classifiedEntries = stage2.entries;
|
|
72
194
|
parseDiagnostics.push(...stage2.diagnostics);
|
|
73
195
|
}
|
|
@@ -92,18 +214,48 @@ async function compile(paths, options) {
|
|
|
92
214
|
}
|
|
93
215
|
}
|
|
94
216
|
}
|
|
217
|
+
// Phase 4: Classify each entry's discipline per ADR-017 Invariant 1
|
|
218
|
+
// (channels 3 + 4 + default — override and freeze ship in Slice 3).
|
|
219
|
+
// The effective registry is built once per compile() from the active
|
|
220
|
+
// profile chain; null falls back to the core seed.
|
|
221
|
+
{
|
|
222
|
+
const registry = (0, discipline_registry_js_1.buildEffectiveDisciplineRegistry)(options.profile ?? null);
|
|
223
|
+
const classified = [];
|
|
224
|
+
for (const entry of entries.values()) {
|
|
225
|
+
const discipline = (0, discipline_classifier_js_1.classifyDiscipline)(entry, entries, registry);
|
|
226
|
+
classified.push({ ...entry, derivedDiscipline: discipline });
|
|
227
|
+
}
|
|
228
|
+
entries.clear();
|
|
229
|
+
for (const entry of classified) {
|
|
230
|
+
entries.set(entry.displayId, entry);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
95
233
|
const authoredLinks = extractLinks([...entries.values()]);
|
|
96
234
|
const links = [...authoredLinks, ...generatedLinks];
|
|
97
235
|
// MSL-T013: check link targets for draft/retired state.
|
|
98
236
|
const linkTargetDiags = (0, link_target_js_1.checkLinkTargets)(entries, links);
|
|
99
237
|
const forward = buildAdjacency(links, (l) => l.from);
|
|
100
238
|
const reverse = buildAdjacency(links, (l) => l.to);
|
|
239
|
+
// Build the corpus typl registry. validateTypl is also called inside
|
|
240
|
+
// validate() (via validationDiagnostics) for the cross-entry TYPL
|
|
241
|
+
// diagnostics. Here we call it again only to capture the registry — the
|
|
242
|
+
// diagnostics are already included in validationDiagnostics, so we discard
|
|
243
|
+
// them to avoid duplicates in the output.
|
|
244
|
+
const { registry: typeRegistry } = (0, mod_js_4.validateTypl)([...entries.values()]);
|
|
101
245
|
const diagnostics = [
|
|
102
246
|
...parseDiagnostics,
|
|
103
|
-
...
|
|
247
|
+
...validationDiagnostics,
|
|
104
248
|
...linkTargetDiags,
|
|
105
249
|
];
|
|
106
|
-
return {
|
|
250
|
+
return {
|
|
251
|
+
entries,
|
|
252
|
+
links,
|
|
253
|
+
forward,
|
|
254
|
+
reverse,
|
|
255
|
+
documents,
|
|
256
|
+
diagnostics,
|
|
257
|
+
typeRegistry,
|
|
258
|
+
};
|
|
107
259
|
}
|
|
108
260
|
/** Extract traceability links from entry attributes. */
|
|
109
261
|
function extractLinks(entries) {
|
|
@@ -127,45 +279,26 @@ const LOCATOR_BEARING_ATTRS = new Set([
|
|
|
127
279
|
]);
|
|
128
280
|
/** Map an attribute key+value to zero or more links. */
|
|
129
281
|
function extractLinksFromAttribute(from, key, value, location) {
|
|
130
|
-
const kind = ATTR_TO_LINK_KIND[key];
|
|
282
|
+
const kind = constants_js_1.ATTR_TO_LINK_KIND[key];
|
|
131
283
|
if (!kind)
|
|
132
284
|
return [];
|
|
133
285
|
if (LOCATOR_BEARING_ATTRS.has(key)) {
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
286
|
+
// Comma-separated targets, each "ID §section": split the list (these
|
|
287
|
+
// attributes are 0..N), then take the leading ID token of each value,
|
|
288
|
+
// dropping the optional free-text locator.
|
|
289
|
+
return value
|
|
290
|
+
.split(",")
|
|
291
|
+
.map((s) => s.trim().split(/\s/)[0])
|
|
292
|
+
.filter((s) => s.length > 0)
|
|
293
|
+
.map((to) => ({ from, to: (0, mod_js_1.makeDisplayId)(to), kind, location }));
|
|
140
294
|
}
|
|
141
295
|
// Comma-separated targets for id-list attributes.
|
|
142
296
|
return value
|
|
143
297
|
.split(",")
|
|
144
298
|
.map((s) => s.trim())
|
|
145
299
|
.filter((s) => s.length > 0)
|
|
146
|
-
.map((to) => ({ from, to, kind, location }));
|
|
300
|
+
.map((to) => ({ from, to: (0, mod_js_1.makeDisplayId)(to), kind, location }));
|
|
147
301
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Attribute keys that produce traceability links per ADR-002.
|
|
150
|
-
*
|
|
151
|
-
* Spec attributes: Satisfies, Derived-from, References, Allocated-to.
|
|
152
|
-
* Test attributes: Verifies, Tests.
|
|
153
|
-
* Element attributes: Realizes, Depends-on, Part-of, Generated-from.
|
|
154
|
-
* Universal: Supersedes (same-family).
|
|
155
|
-
*/
|
|
156
|
-
const ATTR_TO_LINK_KIND = {
|
|
157
|
-
"Satisfies": "satisfies",
|
|
158
|
-
"Derived-from": "derived-from",
|
|
159
|
-
"References": "references",
|
|
160
|
-
"Allocated-to": "allocated-to",
|
|
161
|
-
"Realizes": "realizes",
|
|
162
|
-
"Verifies": "verifies",
|
|
163
|
-
"Tests": "tests",
|
|
164
|
-
"Depends-on": "depends-on",
|
|
165
|
-
"Part-of": "part-of",
|
|
166
|
-
"Generated-from": "generated-from",
|
|
167
|
-
"Supersedes": "supersedes",
|
|
168
|
-
};
|
|
169
302
|
/** Build an adjacency map from links using a key selector. */
|
|
170
303
|
function buildAdjacency(links, keyFn) {
|
|
171
304
|
const map = new Map();
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { CompileResult } from "./mod.js";
|
|
9
9
|
import type { Diagnostic, Entry, Link } from "../model/mod.js";
|
|
10
|
+
import type { RegistryBinding, RegistryTypedef } from "../typl/mod.js";
|
|
10
11
|
/**
|
|
11
12
|
* JSON-serializable form of {@linkcode Entry}.
|
|
12
13
|
*
|
|
@@ -17,6 +18,18 @@ import type { Diagnostic, Entry, Link } from "../model/mod.js";
|
|
|
17
18
|
export type SerializedEntry = Omit<Entry, "typedAttributes"> & {
|
|
18
19
|
readonly typedAttributes?: Record<string, readonly string[]>;
|
|
19
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Serialized form of the {@linkcode TypeRegistry}.
|
|
23
|
+
*
|
|
24
|
+
* `ReadonlyMap` fields are converted to plain objects so the result is
|
|
25
|
+
* JSON-serializable.
|
|
26
|
+
*/
|
|
27
|
+
export interface SerializedTypeRegistry {
|
|
28
|
+
/** Keyed by $Name (including leading `$`). */
|
|
29
|
+
readonly bindings: Record<string, readonly RegistryBinding[]>;
|
|
30
|
+
/** Keyed by typedef name (no `$`). */
|
|
31
|
+
readonly typedefs: Record<string, readonly RegistryTypedef[]>;
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
34
|
* Serialized form of {@linkcode CompileResult}.
|
|
22
35
|
*
|
|
@@ -34,6 +47,8 @@ export interface SerializedCompileResult {
|
|
|
34
47
|
readonly reverse: Record<string, readonly Link[]>;
|
|
35
48
|
/** Diagnostics from parsing and validation. */
|
|
36
49
|
readonly diagnostics: readonly Diagnostic[];
|
|
50
|
+
/** Corpus-wide typl type registry. */
|
|
51
|
+
readonly typeRegistry: SerializedTypeRegistry;
|
|
37
52
|
}
|
|
38
53
|
/**
|
|
39
54
|
* Convert a {@linkcode CompileResult} to a plain JSON-serializable object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/compiler/schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/compiler/schema.ts"],"names":[],"mappings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AQG;AACH,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,aAAa,GACpB,uBAAuB,CAazB;AAgBD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,eAAe,CAoB5D"}
|
|
@@ -29,6 +29,18 @@ function serializeCompileResult(result) {
|
|
|
29
29
|
forward: Object.fromEntries(result.forward),
|
|
30
30
|
reverse: Object.fromEntries(result.reverse),
|
|
31
31
|
diagnostics: result.diagnostics,
|
|
32
|
+
typeRegistry: serializeTypeRegistry(result.typeRegistry),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Convert the {@linkcode TypeRegistry} Maps to plain objects for
|
|
37
|
+
* JSON serialization. `ReadonlyMap` serializes as `{}` in `JSON.stringify`,
|
|
38
|
+
* so explicit conversion is required.
|
|
39
|
+
*/
|
|
40
|
+
function serializeTypeRegistry(registry) {
|
|
41
|
+
return {
|
|
42
|
+
bindings: Object.fromEntries(registry.bindings),
|
|
43
|
+
typedefs: Object.fromEntries(registry.typedefs),
|
|
32
44
|
};
|
|
33
45
|
}
|
|
34
46
|
/**
|
|
@@ -22,6 +22,11 @@ export declare function readMarkspecYaml(projectRoot: string, readFile: ReadFile
|
|
|
22
22
|
/** The parsed content of a `.markspec.yaml`. */
|
|
23
23
|
export interface MarkspecYaml {
|
|
24
24
|
readonly profiles: readonly ProfileSpecifier[];
|
|
25
|
+
/**
|
|
26
|
+
* Opt out of the bundled default profile when explicitly `false`.
|
|
27
|
+
* `undefined` (key absent) means the default is active.
|
|
28
|
+
*/
|
|
29
|
+
readonly defaultProfile?: boolean;
|
|
25
30
|
}
|
|
26
31
|
/** Result of parsing a `.markspec.yaml` string. */
|
|
27
32
|
export interface ParseMarkspecYamlResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markspec.d.ts","sourceRoot":"","sources":["../../src/config/markspec.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO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f,UAAU,EAAE,MAAM,GACjB,uBAAuB,CA8FzB;AAgFD,sDAAsD;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEzE;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,QAAQ,EACpB,WAAW,EAAE,SAAS,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC,CAiDf"}
|
|
@@ -29,7 +29,7 @@ async function readMarkspecYaml(projectRoot, readFile) {
|
|
|
29
29
|
const content = await readFile(path);
|
|
30
30
|
return content ?? null;
|
|
31
31
|
}
|
|
32
|
-
const ALLOWED_MARKSPEC_YAML_KEYS = new Set(["profiles"]);
|
|
32
|
+
const ALLOWED_MARKSPEC_YAML_KEYS = new Set(["profiles", "default-profile"]);
|
|
33
33
|
/**
|
|
34
34
|
* Parse and validate a `.markspec.yaml` string.
|
|
35
35
|
*
|
|
@@ -97,12 +97,27 @@ function parseMarkspecYaml(rawYaml, sourcePath) {
|
|
|
97
97
|
profiles.push(spec);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
// default-profile: optional boolean opt-out for the bundled default.
|
|
101
|
+
let defaultProfile;
|
|
102
|
+
const rawDefaultProfile = root["default-profile"];
|
|
103
|
+
if (rawDefaultProfile !== undefined) {
|
|
104
|
+
if (typeof rawDefaultProfile !== "boolean") {
|
|
105
|
+
diagnostics.push({
|
|
106
|
+
code: "MARKSPEC-YAML-003",
|
|
107
|
+
severity: "error",
|
|
108
|
+
message: ".markspec.yaml: 'default-profile' must be a boolean",
|
|
109
|
+
location: { file: sourcePath, line: 1, column: 1 },
|
|
110
|
+
});
|
|
111
|
+
return { config: null, diagnostics };
|
|
112
|
+
}
|
|
113
|
+
defaultProfile = rawDefaultProfile;
|
|
114
|
+
}
|
|
100
115
|
// If any specifier failed to parse, treat the whole file as invalid.
|
|
101
116
|
const hasErrors = diagnostics.some((d) => d.severity === "error");
|
|
102
117
|
if (hasErrors) {
|
|
103
118
|
return { config: null, diagnostics };
|
|
104
119
|
}
|
|
105
|
-
return { config: { profiles }, diagnostics };
|
|
120
|
+
return { config: { profiles, defaultProfile }, diagnostics };
|
|
106
121
|
}
|
|
107
122
|
/**
|
|
108
123
|
* Parse a single specifier string into a {@linkcode ProfileSpecifier}.
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
import type { Attribute, Diagnostic } from "../model/mod.js";
|
|
9
9
|
/**
|
|
10
10
|
* Decide whether the EARS keyword at `offset` in `line` is at sentence
|
|
11
|
-
* start (return value true).
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* start (return value true). Delegates to the shared implementation in
|
|
12
|
+
* `core/util/modals.ts`; re-exported here for backward compatibility with
|
|
13
|
+
* existing callers and tests that import from `formatter/mod.ts`.
|
|
14
14
|
*/
|
|
15
15
|
export declare function isSentenceInitial(line: string, offset: number): boolean;
|
|
16
16
|
/**
|
|
@@ -43,6 +43,12 @@ export interface FormatOptions {
|
|
|
43
43
|
readonly file?: string;
|
|
44
44
|
/** ULID generator override (for testing). */
|
|
45
45
|
readonly generateUlid?: () => string;
|
|
46
|
+
/**
|
|
47
|
+
* Override the "today" date used by the Discipline-frozen: stamper.
|
|
48
|
+
* Returned value must be a `YYYY-MM-DD` string in UTC. Default: today.
|
|
49
|
+
* Injectable for deterministic tests.
|
|
50
|
+
*/
|
|
51
|
+
readonly today?: () => string;
|
|
46
52
|
}
|
|
47
53
|
/** Result of a format operation. */
|
|
48
54
|
export interface FormatResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/formatter/mod.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EAGX,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"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