@driftsys/markspec 0.10.3 → 0.12.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 +11 -2
- package/esm/ast/normalize.d.ts +4 -5
- package/esm/ast/normalize.d.ts.map +1 -1
- package/esm/ast/normalize.js +6 -37
- package/esm/collect/mod.d.ts +29 -9
- package/esm/collect/mod.d.ts.map +1 -1
- package/esm/collect/mod.js +36 -10
- package/esm/compiler/deserialize.d.ts +49 -0
- package/esm/compiler/deserialize.d.ts.map +1 -0
- package/esm/compiler/deserialize.js +139 -0
- package/esm/compiler/manifest.d.ts +3 -0
- package/esm/compiler/manifest.d.ts.map +1 -1
- package/esm/compiler/manifest.js +9 -3
- package/esm/compiler/mod.d.ts.map +1 -1
- package/esm/compiler/mod.js +18 -13
- package/esm/config/markspec.d.ts +40 -1
- package/esm/config/markspec.d.ts.map +1 -1
- package/esm/config/markspec.js +127 -2
- package/esm/config/mod.d.ts.map +1 -1
- package/esm/config/mod.js +143 -147
- package/esm/decl/duplicates.d.ts +29 -0
- package/esm/decl/duplicates.d.ts.map +1 -0
- package/esm/decl/duplicates.js +28 -0
- package/esm/decl/mod.d.ts +4 -2
- package/esm/decl/mod.d.ts.map +1 -1
- package/esm/decl/mod.js +2 -1
- package/esm/decl/surfaces.d.ts +29 -7
- package/esm/decl/surfaces.d.ts.map +1 -1
- package/esm/decl/surfaces.js +31 -18
- package/esm/discovery/mod.d.ts +24 -8
- package/esm/discovery/mod.d.ts.map +1 -1
- package/esm/discovery/mod.js +57 -21
- package/esm/discovery/projects.d.ts +109 -0
- package/esm/discovery/projects.d.ts.map +1 -0
- package/esm/discovery/projects.js +232 -0
- package/esm/formatter/entry_body.d.ts +86 -0
- package/esm/formatter/entry_body.d.ts.map +1 -0
- package/esm/formatter/entry_body.js +287 -0
- package/esm/formatter/mod.d.ts +13 -9
- package/esm/formatter/mod.d.ts.map +1 -1
- package/esm/formatter/mod.js +126 -50
- package/esm/gates/mod.d.ts +13 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +41 -13
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +7 -5
- package/esm/lock/acquire_compile.d.ts +31 -0
- package/esm/lock/acquire_compile.d.ts.map +1 -0
- package/esm/lock/acquire_compile.js +83 -0
- package/esm/lock/cache_check.d.ts +28 -0
- package/esm/lock/cache_check.d.ts.map +1 -0
- package/esm/lock/cache_check.js +51 -0
- package/esm/lock/check.d.ts +14 -3
- package/esm/lock/check.d.ts.map +1 -1
- package/esm/lock/check.js +43 -4
- package/esm/lock/edge_drift.d.ts +2 -0
- package/esm/lock/edge_drift.d.ts.map +1 -1
- package/esm/lock/edge_drift.js +4 -0
- package/esm/lock/git_intent.d.ts +46 -0
- package/esm/lock/git_intent.d.ts.map +1 -0
- package/esm/lock/git_intent.js +111 -0
- package/esm/lock/mod.d.ts +11 -4
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +8 -2
- package/esm/lock/model.d.ts +24 -1
- package/esm/lock/model.d.ts.map +1 -1
- package/esm/lock/parser.d.ts.map +1 -1
- package/esm/lock/parser.js +32 -0
- package/esm/lock/pin_assurance.d.ts +20 -0
- package/esm/lock/pin_assurance.d.ts.map +1 -0
- package/esm/lock/pin_assurance.js +34 -0
- package/esm/lock/resolve.d.ts +8 -17
- package/esm/lock/resolve.d.ts.map +1 -1
- package/esm/lock/resolve.js +7 -67
- package/esm/lock/serializer.d.ts.map +1 -1
- package/esm/lock/serializer.js +23 -0
- package/esm/lock/upstream_common.d.ts +29 -0
- package/esm/lock/upstream_common.d.ts.map +1 -0
- package/esm/lock/upstream_common.js +38 -0
- package/esm/lock/upstream_deps.d.ts +63 -0
- package/esm/lock/upstream_deps.d.ts.map +1 -0
- package/esm/lock/upstream_deps.js +172 -0
- package/esm/lock/upstream_refs.d.ts +69 -0
- package/esm/lock/upstream_refs.d.ts.map +1 -0
- package/esm/lock/upstream_refs.js +238 -0
- package/esm/mod.d.ts +23 -11
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +20 -8
- package/esm/model/mod.d.ts +114 -28
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +76 -13
- package/esm/model/profile.d.ts +13 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/code_regions.d.ts +29 -0
- package/esm/parser/code_regions.d.ts.map +1 -0
- package/esm/parser/code_regions.js +38 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +110 -91
- package/esm/parser/mod.d.ts.map +1 -1
- package/esm/parser/mod.js +7 -1
- package/esm/parser/translate.d.ts.map +1 -1
- package/esm/parser/translate.js +5 -0
- package/esm/profile/manifest.d.ts.map +1 -1
- package/esm/profile/manifest.js +20 -3
- package/esm/profile/merge.js +7 -0
- package/esm/refs/mod.d.ts.map +1 -1
- package/esm/refs/mod.js +8 -19
- package/esm/reporter/mod.d.ts +11 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +20 -9
- package/esm/typl/assemble.d.ts +53 -0
- package/esm/typl/assemble.d.ts.map +1 -0
- package/esm/typl/assemble.js +238 -0
- package/esm/typl/ast.d.ts +7 -1
- package/esm/typl/ast.d.ts.map +1 -1
- package/esm/typl/ast.js +3 -0
- package/esm/typl/bullet.d.ts +9 -7
- package/esm/typl/bullet.d.ts.map +1 -1
- package/esm/typl/bullet.js +6 -4
- package/esm/typl/citations.d.ts +27 -0
- package/esm/typl/citations.d.ts.map +1 -0
- package/esm/typl/citations.js +16 -0
- package/esm/typl/diagnostics.d.ts +2 -2
- package/esm/typl/diagnostics.d.ts.map +1 -1
- package/esm/typl/diagnostics.js +18 -0
- package/esm/typl/grammar.d.ts.map +1 -1
- package/esm/typl/grammar.js +6 -0
- package/esm/typl/lexer.d.ts.map +1 -1
- package/esm/typl/lexer.js +25 -4
- package/esm/typl/mod.d.ts +8 -2
- package/esm/typl/mod.d.ts.map +1 -1
- package/esm/typl/mod.js +5 -1
- package/esm/typl/recognize.js +2 -2
- package/esm/typl/registry.d.ts +1 -1
- package/esm/typl/resolve.d.ts +31 -0
- package/esm/typl/resolve.d.ts.map +1 -0
- package/esm/typl/resolve.js +27 -0
- package/esm/typl/table.d.ts +52 -0
- package/esm/typl/table.d.ts.map +1 -0
- package/esm/typl/table.js +69 -0
- package/esm/typl/validator.d.ts +24 -5
- package/esm/typl/validator.d.ts.map +1 -1
- package/esm/typl/validator.js +55 -75
- package/esm/upstream/mod.d.ts +45 -0
- package/esm/upstream/mod.d.ts.map +1 -0
- package/esm/upstream/mod.js +98 -0
- package/esm/upstream/project.d.ts +33 -0
- package/esm/upstream/project.d.ts.map +1 -0
- package/esm/upstream/project.js +38 -0
- package/esm/upstream/refs.d.ts +23 -0
- package/esm/upstream/refs.d.ts.map +1 -0
- package/esm/upstream/refs.js +71 -0
- package/esm/util/fence.d.ts +20 -29
- package/esm/util/fence.d.ts.map +1 -1
- package/esm/util/fence.js +42 -50
- package/esm/util/modals.d.ts +6 -0
- package/esm/util/modals.d.ts.map +1 -1
- package/esm/util/modals.js +37 -0
- package/esm/util/paths.d.ts +14 -0
- package/esm/util/paths.d.ts.map +1 -0
- package/esm/util/paths.js +22 -0
- package/esm/uxil/assemble.d.ts +38 -0
- package/esm/uxil/assemble.d.ts.map +1 -0
- package/esm/uxil/assemble.js +268 -0
- package/esm/uxil/ast.d.ts +63 -0
- package/esm/uxil/ast.d.ts.map +1 -0
- package/esm/uxil/ast.js +9 -0
- package/esm/uxil/citations.d.ts +27 -0
- package/esm/uxil/citations.d.ts.map +1 -0
- package/esm/uxil/citations.js +25 -0
- package/esm/uxil/diagnostics.d.ts +39 -0
- package/esm/uxil/diagnostics.d.ts.map +1 -0
- package/esm/uxil/diagnostics.js +135 -0
- package/esm/uxil/grammar.d.ts +72 -0
- package/esm/uxil/grammar.d.ts.map +1 -0
- package/esm/uxil/grammar.js +505 -0
- package/esm/uxil/lexer.d.ts +23 -0
- package/esm/uxil/lexer.d.ts.map +1 -0
- package/esm/uxil/lexer.js +58 -0
- package/esm/uxil/mod.d.ts +32 -0
- package/esm/uxil/mod.d.ts.map +1 -0
- package/esm/uxil/mod.js +11 -0
- package/esm/uxil/projection.d.ts +40 -0
- package/esm/uxil/projection.d.ts.map +1 -0
- package/esm/uxil/projection.js +41 -0
- package/esm/uxil/recognize.d.ts +16 -0
- package/esm/uxil/recognize.d.ts.map +1 -0
- package/esm/uxil/recognize.js +28 -0
- package/esm/uxil/registry.d.ts +37 -0
- package/esm/uxil/registry.d.ts.map +1 -0
- package/esm/uxil/registry.js +29 -0
- package/esm/uxil/surfaces.d.ts +36 -0
- package/esm/uxil/surfaces.d.ts.map +1 -0
- package/esm/uxil/surfaces.js +34 -0
- package/esm/uxil/validator.d.ts +36 -0
- package/esm/uxil/validator.d.ts.map +1 -0
- package/esm/uxil/validator.js +139 -0
- package/esm/uxil/vocab.d.ts +33 -0
- package/esm/uxil/vocab.d.ts.map +1 -0
- package/esm/uxil/vocab.js +36 -0
- package/esm/validator/body_blocks.d.ts +2 -1
- package/esm/validator/body_blocks.d.ts.map +1 -1
- package/esm/validator/body_blocks.js +80 -2
- package/esm/validator/caption_convention.d.ts +2 -1
- package/esm/validator/caption_convention.d.ts.map +1 -1
- package/esm/validator/caption_convention.js +2 -1
- package/esm/validator/corpus.d.ts +6 -0
- package/esm/validator/corpus.d.ts.map +1 -1
- package/esm/validator/corpus.js +55 -20
- package/esm/validator/discipline.d.ts +6 -4
- package/esm/validator/discipline.d.ts.map +1 -1
- package/esm/validator/discipline.js +6 -4
- package/esm/validator/mod.d.ts +1 -1
- package/esm/validator/mod.d.ts.map +1 -1
- package/esm/validator/mod.js +29 -16
- package/esm/validator/pipeline.d.ts +11 -1
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +76 -23
- package/esm/validator/trace_types.d.ts +9 -2
- package/esm/validator/trace_types.d.ts.map +1 -1
- package/esm/validator/trace_types.js +21 -5
- package/esm/validator/traceability.d.ts +15 -3
- package/esm/validator/traceability.d.ts.map +1 -1
- package/esm/validator/traceability.js +39 -4
- package/esm/validator/types.d.ts.map +1 -1
- package/esm/validator/types.js +11 -1
- package/esm/validator/uxil_family.d.ts +43 -0
- package/esm/validator/uxil_family.d.ts.map +1 -0
- package/esm/validator/uxil_family.js +52 -0
- package/package.json +1 -1
- package/script/ast/normalize.d.ts +4 -5
- package/script/ast/normalize.d.ts.map +1 -1
- package/script/ast/normalize.js +5 -36
- package/script/collect/mod.d.ts +29 -9
- package/script/collect/mod.d.ts.map +1 -1
- package/script/collect/mod.js +38 -10
- package/script/compiler/deserialize.d.ts +49 -0
- package/script/compiler/deserialize.d.ts.map +1 -0
- package/script/compiler/deserialize.js +144 -0
- package/script/compiler/manifest.d.ts +3 -0
- package/script/compiler/manifest.d.ts.map +1 -1
- package/script/compiler/manifest.js +10 -3
- package/script/compiler/mod.d.ts.map +1 -1
- package/script/compiler/mod.js +16 -11
- package/script/config/markspec.d.ts +40 -1
- package/script/config/markspec.d.ts.map +1 -1
- package/script/config/markspec.js +129 -3
- package/script/config/mod.d.ts.map +1 -1
- package/script/config/mod.js +143 -147
- package/script/decl/duplicates.d.ts +29 -0
- package/script/decl/duplicates.d.ts.map +1 -0
- package/script/decl/duplicates.js +31 -0
- package/script/decl/mod.d.ts +4 -2
- package/script/decl/mod.d.ts.map +1 -1
- package/script/decl/mod.js +4 -2
- package/script/decl/surfaces.d.ts +29 -7
- package/script/decl/surfaces.d.ts.map +1 -1
- package/script/decl/surfaces.js +32 -19
- package/script/discovery/mod.d.ts +24 -8
- package/script/discovery/mod.d.ts.map +1 -1
- package/script/discovery/mod.js +56 -20
- package/script/discovery/projects.d.ts +109 -0
- package/script/discovery/projects.d.ts.map +1 -0
- package/script/discovery/projects.js +240 -0
- package/script/formatter/entry_body.d.ts +86 -0
- package/script/formatter/entry_body.d.ts.map +1 -0
- package/script/formatter/entry_body.js +292 -0
- package/script/formatter/mod.d.ts +13 -9
- package/script/formatter/mod.d.ts.map +1 -1
- package/script/formatter/mod.js +124 -48
- package/script/gates/mod.d.ts +13 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +50 -22
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +6 -4
- package/script/lock/acquire_compile.d.ts +31 -0
- package/script/lock/acquire_compile.d.ts.map +1 -0
- package/script/lock/acquire_compile.js +86 -0
- package/script/lock/cache_check.d.ts +28 -0
- package/script/lock/cache_check.d.ts.map +1 -0
- package/script/lock/cache_check.js +54 -0
- package/script/lock/check.d.ts +14 -3
- package/script/lock/check.d.ts.map +1 -1
- package/script/lock/check.js +43 -4
- package/script/lock/edge_drift.d.ts +2 -0
- package/script/lock/edge_drift.d.ts.map +1 -1
- package/script/lock/edge_drift.js +5 -0
- package/script/lock/git_intent.d.ts +46 -0
- package/script/lock/git_intent.d.ts.map +1 -0
- package/script/lock/git_intent.js +115 -0
- package/script/lock/mod.d.ts +11 -4
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +17 -2
- package/script/lock/model.d.ts +24 -1
- package/script/lock/model.d.ts.map +1 -1
- package/script/lock/parser.d.ts.map +1 -1
- package/script/lock/parser.js +32 -0
- package/script/lock/pin_assurance.d.ts +20 -0
- package/script/lock/pin_assurance.d.ts.map +1 -0
- package/script/lock/pin_assurance.js +37 -0
- package/script/lock/resolve.d.ts +8 -17
- package/script/lock/resolve.d.ts.map +1 -1
- package/script/lock/resolve.js +7 -68
- package/script/lock/serializer.d.ts.map +1 -1
- package/script/lock/serializer.js +23 -0
- package/script/lock/upstream_common.d.ts +29 -0
- package/script/lock/upstream_common.d.ts.map +1 -0
- package/script/lock/upstream_common.js +42 -0
- package/script/lock/upstream_deps.d.ts +63 -0
- package/script/lock/upstream_deps.d.ts.map +1 -0
- package/script/lock/upstream_deps.js +175 -0
- package/script/lock/upstream_refs.d.ts +69 -0
- package/script/lock/upstream_refs.d.ts.map +1 -0
- package/script/lock/upstream_refs.js +244 -0
- package/script/mod.d.ts +23 -11
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +55 -7
- package/script/model/mod.d.ts +114 -28
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +81 -14
- package/script/model/profile.d.ts +13 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/code_regions.d.ts +29 -0
- package/script/parser/code_regions.d.ts.map +1 -0
- package/script/parser/code_regions.js +41 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +108 -89
- package/script/parser/mod.d.ts.map +1 -1
- package/script/parser/mod.js +7 -1
- package/script/parser/translate.d.ts.map +1 -1
- package/script/parser/translate.js +5 -0
- package/script/profile/manifest.d.ts.map +1 -1
- package/script/profile/manifest.js +20 -3
- package/script/profile/merge.js +7 -0
- package/script/refs/mod.d.ts.map +1 -1
- package/script/refs/mod.js +7 -18
- package/script/reporter/mod.d.ts +11 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +19 -8
- package/script/typl/assemble.d.ts +53 -0
- package/script/typl/assemble.d.ts.map +1 -0
- package/script/typl/assemble.js +241 -0
- package/script/typl/ast.d.ts +7 -1
- package/script/typl/ast.d.ts.map +1 -1
- package/script/typl/ast.js +3 -0
- package/script/typl/bullet.d.ts +9 -7
- package/script/typl/bullet.d.ts.map +1 -1
- package/script/typl/bullet.js +6 -4
- package/script/typl/citations.d.ts +27 -0
- package/script/typl/citations.d.ts.map +1 -0
- package/script/typl/citations.js +20 -0
- package/script/typl/diagnostics.d.ts +2 -2
- package/script/typl/diagnostics.d.ts.map +1 -1
- package/script/typl/diagnostics.js +18 -0
- package/script/typl/grammar.d.ts.map +1 -1
- package/script/typl/grammar.js +6 -0
- package/script/typl/lexer.d.ts.map +1 -1
- package/script/typl/lexer.js +25 -4
- package/script/typl/mod.d.ts +8 -2
- package/script/typl/mod.d.ts.map +1 -1
- package/script/typl/mod.js +14 -2
- package/script/typl/recognize.js +2 -2
- package/script/typl/registry.d.ts +1 -1
- package/script/typl/resolve.d.ts +31 -0
- package/script/typl/resolve.d.ts.map +1 -0
- package/script/typl/resolve.js +33 -0
- package/script/typl/table.d.ts +52 -0
- package/script/typl/table.d.ts.map +1 -0
- package/script/typl/table.js +75 -0
- package/script/typl/validator.d.ts +24 -5
- package/script/typl/validator.d.ts.map +1 -1
- package/script/typl/validator.js +55 -75
- package/script/upstream/mod.d.ts +45 -0
- package/script/upstream/mod.d.ts.map +1 -0
- package/script/upstream/mod.js +101 -0
- package/script/upstream/project.d.ts +33 -0
- package/script/upstream/project.d.ts.map +1 -0
- package/script/upstream/project.js +41 -0
- package/script/upstream/refs.d.ts +23 -0
- package/script/upstream/refs.d.ts.map +1 -0
- package/script/upstream/refs.js +74 -0
- package/script/util/fence.d.ts +20 -29
- package/script/util/fence.d.ts.map +1 -1
- package/script/util/fence.js +47 -54
- package/script/util/modals.d.ts +6 -0
- package/script/util/modals.d.ts.map +1 -1
- package/script/util/modals.js +38 -0
- package/script/util/paths.d.ts +14 -0
- package/script/util/paths.d.ts.map +1 -0
- package/script/util/paths.js +25 -0
- package/script/uxil/assemble.d.ts +38 -0
- package/script/uxil/assemble.d.ts.map +1 -0
- package/script/uxil/assemble.js +272 -0
- package/script/uxil/ast.d.ts +63 -0
- package/script/uxil/ast.d.ts.map +1 -0
- package/script/uxil/ast.js +10 -0
- package/script/uxil/citations.d.ts +27 -0
- package/script/uxil/citations.d.ts.map +1 -0
- package/script/uxil/citations.js +29 -0
- package/script/uxil/diagnostics.d.ts +39 -0
- package/script/uxil/diagnostics.d.ts.map +1 -0
- package/script/uxil/diagnostics.js +140 -0
- package/script/uxil/grammar.d.ts +72 -0
- package/script/uxil/grammar.d.ts.map +1 -0
- package/script/uxil/grammar.js +511 -0
- package/script/uxil/lexer.d.ts +23 -0
- package/script/uxil/lexer.d.ts.map +1 -0
- package/script/uxil/lexer.js +61 -0
- package/script/uxil/mod.d.ts +32 -0
- package/script/uxil/mod.d.ts.map +1 -0
- package/script/uxil/mod.js +37 -0
- package/script/uxil/projection.d.ts +40 -0
- package/script/uxil/projection.d.ts.map +1 -0
- package/script/uxil/projection.js +44 -0
- package/script/uxil/recognize.d.ts +16 -0
- package/script/uxil/recognize.d.ts.map +1 -0
- package/script/uxil/recognize.js +31 -0
- package/script/uxil/registry.d.ts +37 -0
- package/script/uxil/registry.d.ts.map +1 -0
- package/script/uxil/registry.js +32 -0
- package/script/uxil/surfaces.d.ts +36 -0
- package/script/uxil/surfaces.d.ts.map +1 -0
- package/script/uxil/surfaces.js +39 -0
- package/script/uxil/validator.d.ts +36 -0
- package/script/uxil/validator.d.ts.map +1 -0
- package/script/uxil/validator.js +142 -0
- package/script/uxil/vocab.d.ts +33 -0
- package/script/uxil/vocab.d.ts.map +1 -0
- package/script/uxil/vocab.js +41 -0
- package/script/validator/body_blocks.d.ts +2 -1
- package/script/validator/body_blocks.d.ts.map +1 -1
- package/script/validator/body_blocks.js +80 -2
- package/script/validator/caption_convention.d.ts +2 -1
- package/script/validator/caption_convention.d.ts.map +1 -1
- package/script/validator/caption_convention.js +2 -1
- package/script/validator/corpus.d.ts +6 -0
- package/script/validator/corpus.d.ts.map +1 -1
- package/script/validator/corpus.js +55 -19
- package/script/validator/discipline.d.ts +6 -4
- package/script/validator/discipline.d.ts.map +1 -1
- package/script/validator/discipline.js +6 -4
- package/script/validator/mod.d.ts +1 -1
- package/script/validator/mod.d.ts.map +1 -1
- package/script/validator/mod.js +29 -15
- package/script/validator/pipeline.d.ts +11 -1
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +75 -22
- package/script/validator/trace_types.d.ts +9 -2
- package/script/validator/trace_types.d.ts.map +1 -1
- package/script/validator/trace_types.js +20 -4
- package/script/validator/traceability.d.ts +15 -3
- package/script/validator/traceability.d.ts.map +1 -1
- package/script/validator/traceability.js +38 -3
- package/script/validator/types.d.ts.map +1 -1
- package/script/validator/types.js +10 -0
- package/script/validator/uxil_family.d.ts +43 -0
- package/script/validator/uxil_family.d.ts.map +1 -0
- package/script/validator/uxil_family.js +56 -0
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Unresolved targets are intentionally not flagged here — that is the
|
|
12
12
|
* job of MSL-R080 / MSL-T012 / MSL-T005 in other passes.
|
|
13
13
|
*/
|
|
14
|
-
import { CORE_RELATIONS, CORE_TYPE_HIERARCHY } from "../model/mod.js";
|
|
14
|
+
import { CORE_RELATIONS, CORE_TYPE_HIERARCHY, isUpstreamEntry, } from "../model/mod.js";
|
|
15
15
|
import { resolvedCoreType } from "./type_resolution.js";
|
|
16
16
|
const TRACE_RULES = CORE_RELATIONS
|
|
17
17
|
.filter((r) => r.targetTypes)
|
|
@@ -83,19 +83,26 @@ function isTargetTypeCompatible(targetType, allowedTypes) {
|
|
|
83
83
|
*
|
|
84
84
|
* Unresolved targets are silently skipped — they're caught elsewhere
|
|
85
85
|
* (MSL-R080 / MSL-T012 / MSL-T005). Targets without a resolvable core
|
|
86
|
-
* type are also skipped (no compat call to make).
|
|
86
|
+
* type are also skipped (no compat call to make). Upstream TARGETS are
|
|
87
|
+
* exempt from the MSL-R083 type-compat checks (#771) — their type comes
|
|
88
|
+
* from a foreign vocabulary, the target-side twin of #765's MSL-L004 fix.
|
|
89
|
+
*
|
|
90
|
+
* @param emittable The #771 emit partition — trace rules are never
|
|
91
|
+
* checked FROM an upstream entry.
|
|
92
|
+
* @param all The full entry set (upstream included) — resolution maps
|
|
93
|
+
* index it so links TO an upstream entry keep resolving.
|
|
87
94
|
*/
|
|
88
|
-
export function validateTraceTargetTypes(
|
|
95
|
+
export function validateTraceTargetTypes(emittable, all) {
|
|
89
96
|
const byDisplayId = new Map();
|
|
90
97
|
const byId = new Map();
|
|
91
|
-
for (const e of
|
|
98
|
+
for (const e of all) {
|
|
92
99
|
if (!byDisplayId.has(e.displayId))
|
|
93
100
|
byDisplayId.set(e.displayId, e);
|
|
94
101
|
if (e.id && !byId.has(e.id))
|
|
95
102
|
byId.set(e.id, e);
|
|
96
103
|
}
|
|
97
104
|
const diagnostics = [];
|
|
98
|
-
for (const entry of
|
|
105
|
+
for (const entry of emittable) {
|
|
99
106
|
// MSL-R084: Supersedes target must be the same shape as the source.
|
|
100
107
|
for (const attr of entry.rawAttributes) {
|
|
101
108
|
if (attr.key !== "Supersedes")
|
|
@@ -123,6 +130,11 @@ export function validateTraceTargetTypes(entries) {
|
|
|
123
130
|
const resolved = byId.get(target) ?? byDisplayId.get(target);
|
|
124
131
|
if (!resolved)
|
|
125
132
|
continue;
|
|
133
|
+
// Target-side exemption (#771, matching #765's MSL-L004 fix): an
|
|
134
|
+
// upstream target's type comes from a foreign vocabulary — never
|
|
135
|
+
// judge core-type compatibility against it.
|
|
136
|
+
if (isUpstreamEntry(resolved))
|
|
137
|
+
continue;
|
|
126
138
|
const targetType = resolvedCoreType(resolved);
|
|
127
139
|
if (!targetType)
|
|
128
140
|
continue;
|
|
@@ -158,6 +170,10 @@ export function validateTraceTargetTypes(entries) {
|
|
|
158
170
|
const resolved = byId.get(target) ?? byDisplayId.get(target);
|
|
159
171
|
if (!resolved)
|
|
160
172
|
continue;
|
|
173
|
+
// Target-side exemption (#771) — same rationale as the
|
|
174
|
+
// TRACE_RULES loop above.
|
|
175
|
+
if (isUpstreamEntry(resolved))
|
|
176
|
+
continue;
|
|
161
177
|
const targetType = resolvedCoreType(resolved);
|
|
162
178
|
if (!targetType)
|
|
163
179
|
continue;
|
|
@@ -8,8 +8,13 @@
|
|
|
8
8
|
* attributes:
|
|
9
9
|
* - Required (MSL-L001)
|
|
10
10
|
* - Cardinality bounds (MSL-L002 upper / MSL-L003 lower)
|
|
11
|
-
* - Target match against the rule's target matchers (MSL-L004
|
|
12
|
-
*
|
|
11
|
+
* - Target match against the rule's target matchers (MSL-L004; skipped
|
|
12
|
+
* when the resolved target is an upstream entry — its `type` comes from
|
|
13
|
+
* the upstream's own profile, a vocabulary the consumer never
|
|
14
|
+
* re-classifies against, federated upstream slice 4)
|
|
15
|
+
* - Target existence (MSL-L006, warning; scheme-qualified URIs exempt) —
|
|
16
|
+
* or MSL-T014 (warning) instead of MSL-L006 when the caller declares a
|
|
17
|
+
* non-empty upstream set (federated upstream, slice 4)
|
|
13
18
|
*
|
|
14
19
|
* Referenced entries are skipped entirely — the profile manifest parser
|
|
15
20
|
* rejects `referenced.traceability` at load time, so referenced entries
|
|
@@ -45,6 +50,13 @@ export declare function matchesAnyTarget(target: Entry, matchers: readonly Targe
|
|
|
45
50
|
* @param graph - Index keyed by entry.id (ULID) for target lookup
|
|
46
51
|
* @param byDisplayId - Index keyed by entry.displayId for target lookup
|
|
47
52
|
* (issue #593 — display-ID targets). Defaults to empty.
|
|
53
|
+
* @param declaredUpstreamIds - Upstream ids the downstream project declares
|
|
54
|
+
* via `project.yaml` `dependencies:`/`references:`
|
|
55
|
+
* (federated upstream, slice 4). When non-empty, an
|
|
56
|
+
* otherwise-unresolved trace target fires MSL-T014
|
|
57
|
+
* (warning), naming the searched upstream set, instead
|
|
58
|
+
* of the generic MSL-L006. Defaults to empty — MSL-L006
|
|
59
|
+
* unchanged.
|
|
48
60
|
*/
|
|
49
|
-
export declare function validateTraceabilityForEntry(entry: Entry, profile: EffectiveProfile, graph: ReadonlyMap<string, Entry>, byDisplayId?: ReadonlyMap<string, Entry
|
|
61
|
+
export declare function validateTraceabilityForEntry(entry: Entry, profile: EffectiveProfile, graph: ReadonlyMap<string, Entry>, byDisplayId?: ReadonlyMap<string, Entry>, declaredUpstreamIds?: readonly string[]): Diagnostic[];
|
|
50
62
|
//# sourceMappingURL=traceability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../src/validator/traceability.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"traceability.d.ts","sourceRoot":"","sources":["../../src/validator/traceability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,KAAK,EAEV,KAAK,aAAa,EAClB,KAAK,SAAS,EAEf,MAAM,iBAAiB,CAAC;AAEzB;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAehC;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,KAAK,EACb,QAAQ,EAAE,SAAS,aAAa,EAAE,GACjC,OAAO,CAST;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EACjC,WAAW,GAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAa,EACnD,mBAAmB,GAAE,SAAS,MAAM,EAAO,GAC1C,UAAU,EAAE,CA+Gd"}
|
|
@@ -8,14 +8,19 @@
|
|
|
8
8
|
* attributes:
|
|
9
9
|
* - Required (MSL-L001)
|
|
10
10
|
* - Cardinality bounds (MSL-L002 upper / MSL-L003 lower)
|
|
11
|
-
* - Target match against the rule's target matchers (MSL-L004
|
|
12
|
-
*
|
|
11
|
+
* - Target match against the rule's target matchers (MSL-L004; skipped
|
|
12
|
+
* when the resolved target is an upstream entry — its `type` comes from
|
|
13
|
+
* the upstream's own profile, a vocabulary the consumer never
|
|
14
|
+
* re-classifies against, federated upstream slice 4)
|
|
15
|
+
* - Target existence (MSL-L006, warning; scheme-qualified URIs exempt) —
|
|
16
|
+
* or MSL-T014 (warning) instead of MSL-L006 when the caller declares a
|
|
17
|
+
* non-empty upstream set (federated upstream, slice 4)
|
|
13
18
|
*
|
|
14
19
|
* Referenced entries are skipped entirely — the profile manifest parser
|
|
15
20
|
* rejects `referenced.traceability` at load time, so referenced entries
|
|
16
21
|
* never have declared outgoing links.
|
|
17
22
|
*/
|
|
18
|
-
import { URI_SCHEME_RE, } from "../model/mod.js";
|
|
23
|
+
import { isUpstreamEntry, URI_SCHEME_RE, } from "../model/mod.js";
|
|
19
24
|
/**
|
|
20
25
|
* Effective trace rules for an entry: type-scope rules only.
|
|
21
26
|
* Type-scope rules are applied only when the entry is classified.
|
|
@@ -71,8 +76,15 @@ export function matchesAnyTarget(target, matchers) {
|
|
|
71
76
|
* @param graph - Index keyed by entry.id (ULID) for target lookup
|
|
72
77
|
* @param byDisplayId - Index keyed by entry.displayId for target lookup
|
|
73
78
|
* (issue #593 — display-ID targets). Defaults to empty.
|
|
79
|
+
* @param declaredUpstreamIds - Upstream ids the downstream project declares
|
|
80
|
+
* via `project.yaml` `dependencies:`/`references:`
|
|
81
|
+
* (federated upstream, slice 4). When non-empty, an
|
|
82
|
+
* otherwise-unresolved trace target fires MSL-T014
|
|
83
|
+
* (warning), naming the searched upstream set, instead
|
|
84
|
+
* of the generic MSL-L006. Defaults to empty — MSL-L006
|
|
85
|
+
* unchanged.
|
|
74
86
|
*/
|
|
75
|
-
export function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new Map()) {
|
|
87
|
+
export function validateTraceabilityForEntry(entry, profile, graph, byDisplayId = new Map(), declaredUpstreamIds = []) {
|
|
76
88
|
const diagnostics = [];
|
|
77
89
|
if (entry.shape !== "Authored")
|
|
78
90
|
return diagnostics;
|
|
@@ -122,6 +134,20 @@ export function validateTraceabilityForEntry(entry, profile, graph, byDisplayId
|
|
|
122
134
|
// graph targets, so they are not "broken references".
|
|
123
135
|
if (URI_SCHEME_RE.test(v))
|
|
124
136
|
continue;
|
|
137
|
+
// Federated upstream (slice 4): when the project declares an
|
|
138
|
+
// upstream set, an unresolved target replaces MSL-L006 with
|
|
139
|
+
// MSL-T014, naming the searched set — the same target fires
|
|
140
|
+
// exactly one of the two codes, never both.
|
|
141
|
+
if (declaredUpstreamIds.length > 0) {
|
|
142
|
+
diagnostics.push({
|
|
143
|
+
code: "MSL-T014",
|
|
144
|
+
severity: "warning",
|
|
145
|
+
message: `${entry.displayId}: link '${linkName}' target '${v}' not ` +
|
|
146
|
+
`found in project or upstreams: ${declaredUpstreamIds.join(", ")}`,
|
|
147
|
+
location: entry.location,
|
|
148
|
+
});
|
|
149
|
+
continue;
|
|
150
|
+
}
|
|
125
151
|
diagnostics.push({
|
|
126
152
|
code: "MSL-L006",
|
|
127
153
|
severity: "warning",
|
|
@@ -131,6 +157,15 @@ export function validateTraceabilityForEntry(entry, profile, graph, byDisplayId
|
|
|
131
157
|
});
|
|
132
158
|
continue;
|
|
133
159
|
}
|
|
160
|
+
// Federated upstream (slice 4): an upstream target's `type` is
|
|
161
|
+
// classified by the upstream's OWN profile — a foreign vocabulary the
|
|
162
|
+
// consumer's profile cannot map (design §4.5/D6: the consumer never
|
|
163
|
+
// re-classifies). The link still resolves (no L006/T014 — handled
|
|
164
|
+
// above); only the consumer's own target-type enforcement is skipped
|
|
165
|
+
// for this target. A project-authored target with a mismatched type
|
|
166
|
+
// still fires MSL-L004 below.
|
|
167
|
+
if (isUpstreamEntry(target))
|
|
168
|
+
continue;
|
|
134
169
|
if (!matchesAnyTarget(target, rule.target)) {
|
|
135
170
|
diagnostics.push({
|
|
136
171
|
code: "MSL-L004",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validator/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAEhB,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAwBzB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAWvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAiBvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CAwBvB;AAED,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAiEhB;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GACxB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/validator/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,UAAU,EACV,gBAAgB,EAEhB,KAAK,EAEN,MAAM,iBAAiB,CAAC;AAwBzB;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAWvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,KAAK,GACX,SAAS,UAAU,EAAE,CAiBvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CAwBvB;AAED,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,gBAAgB,GACxB,cAAc,CAiEhB;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GACxB,mBAAmB,CAkCrB"}
|
package/esm/validator/types.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* `Type:` trailer attribute or by display-ID pattern matching. Un-classified
|
|
8
8
|
* entries in a strict profile (types declared) produce MSL-T003.
|
|
9
9
|
*/
|
|
10
|
-
import { CORE_TYPES } from "../model/mod.js";
|
|
10
|
+
import { CORE_TYPES, isUpstreamEntry } from "../model/mod.js";
|
|
11
11
|
import { tryCompileDisplayIdPattern } from "./pattern.js";
|
|
12
12
|
import { explicitType, resolvedCoreType, resolvedCoreTypeWithProvenance, } from "./type_resolution.js";
|
|
13
13
|
/**
|
|
@@ -213,6 +213,16 @@ export function classifyEntriesStage(entries, profile) {
|
|
|
213
213
|
const diagnostics = [];
|
|
214
214
|
const out = [];
|
|
215
215
|
for (const entry of entries) {
|
|
216
|
+
// Deliberately NOT the #771 emittableEntries partition: this stage is
|
|
217
|
+
// a TRANSFORM, not an emit loop — upstream entries must pass through
|
|
218
|
+
// into the output (they stay in finalEntries as resolution targets,
|
|
219
|
+
// in original order for first-entry-wins ties), and their `type`
|
|
220
|
+
// comes from their OWN compile (design §4.5/D6) — the consumer never
|
|
221
|
+
// re-classifies. No MSL-T001..T004 emit, no type overwrite.
|
|
222
|
+
if (isUpstreamEntry(entry)) {
|
|
223
|
+
out.push(entry);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
216
226
|
const classified = classifyEntry(entry, profile);
|
|
217
227
|
diagnostics.push(...classified.diagnostics);
|
|
218
228
|
if (classified.type !== undefined) {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module validator/uxil_family
|
|
3
|
+
*
|
|
4
|
+
* The UXIL-0xx diagnostics family orchestrator (S9 #727). Bridges S8's
|
|
5
|
+
* uxil compiler into the profile-aware validation surfaces (`runPipeline`
|
|
6
|
+
* → `markspec check`; LSP `WorkspaceIndex.validateAll`).
|
|
7
|
+
*
|
|
8
|
+
* Gate: a profile type carrying `declares: ux-surface` (ADR-009: the
|
|
9
|
+
* mechanism is core, the designation is profile policy). With no
|
|
10
|
+
* designation anywhere in the chain the family is fully inert — uxil-
|
|
11
|
+
* looking code spans stay opaque (epic S1's Tier-1 guarantee), so a
|
|
12
|
+
* `.gitignore`-style prose bullet can never draw a diagnostic.
|
|
13
|
+
*
|
|
14
|
+
* With a designation:
|
|
15
|
+
* - entries of a declaring type run the full S8 validation (structure,
|
|
16
|
+
* vocabulary, corpus registry);
|
|
17
|
+
* - `ux:` citations are validated from EVERY non-upstream entry —
|
|
18
|
+
* journeys, tests, and specs cite surfaces from any type;
|
|
19
|
+
* - an unambiguous root declaration (`ux:… : kind` span) in a
|
|
20
|
+
* non-declaring entry is UXIL-023. Element/child bullets (`/`-led,
|
|
21
|
+
* `.`-led) in non-declaring entries stay opaque — they are ambiguous
|
|
22
|
+
* with ordinary prose code spans, deliberately.
|
|
23
|
+
*
|
|
24
|
+
* Upstream entries are uxil-inert (the #771 `emittableEntries` partition,
|
|
25
|
+
* mirroring validateTypl). Entries are gated by `entry.type` when the
|
|
26
|
+
* pipeline's Stage 2 already classified them, else by `classifyEntry` —
|
|
27
|
+
* so the LSP path (which never runs Stage 2) gates identically; the
|
|
28
|
+
* classification diagnostics are deliberately dropped here (the pipeline
|
|
29
|
+
* owns emitting those).
|
|
30
|
+
*/
|
|
31
|
+
import type { Diagnostic, EffectiveProfile, Entry } from "../model/mod.js";
|
|
32
|
+
/**
|
|
33
|
+
* Names of the profile types designated as uxil declaring entry types
|
|
34
|
+
* (`declares: ux-surface`). Empty when `profile` is `null` or no tier
|
|
35
|
+
* designates one — the family's inertness gate.
|
|
36
|
+
*/
|
|
37
|
+
export declare function uxilDeclaringTypes(profile: EffectiveProfile | null): ReadonlySet<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Run the UXIL-0xx family over `entries`. Returns file-anchored core
|
|
40
|
+
* diagnostics; `[]` when the gate is closed (see module doc).
|
|
41
|
+
*/
|
|
42
|
+
export declare function validateUxilFamily(entries: readonly Entry[], profile: EffectiveProfile | null): readonly Diagnostic[];
|
|
43
|
+
//# sourceMappingURL=uxil_family.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uxil_family.d.ts","sourceRoot":"","sources":["../../src/validator/uxil_family.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAS3E;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,WAAW,CAAC,MAAM,CAAC,CAOrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAC/B,SAAS,UAAU,EAAE,CA8BvB"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { emittableEntries } from "../model/mod.js";
|
|
2
|
+
import { extractUxRootSpans, uxilDiagnosticAt, validateUxil, } from "../uxil/mod.js";
|
|
3
|
+
import { classifyEntry } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* Names of the profile types designated as uxil declaring entry types
|
|
6
|
+
* (`declares: ux-surface`). Empty when `profile` is `null` or no tier
|
|
7
|
+
* designates one — the family's inertness gate.
|
|
8
|
+
*/
|
|
9
|
+
export function uxilDeclaringTypes(profile) {
|
|
10
|
+
const out = new Set();
|
|
11
|
+
if (profile === null)
|
|
12
|
+
return out;
|
|
13
|
+
for (const [name, td] of profile.types) {
|
|
14
|
+
if (td.value.declares?.value === "ux-surface")
|
|
15
|
+
out.add(name);
|
|
16
|
+
}
|
|
17
|
+
return out;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Run the UXIL-0xx family over `entries`. Returns file-anchored core
|
|
21
|
+
* diagnostics; `[]` when the gate is closed (see module doc).
|
|
22
|
+
*/
|
|
23
|
+
export function validateUxilFamily(entries, profile) {
|
|
24
|
+
const declaring = uxilDeclaringTypes(profile);
|
|
25
|
+
if (declaring.size === 0)
|
|
26
|
+
return [];
|
|
27
|
+
const local = emittableEntries(entries);
|
|
28
|
+
const declaringEntries = [];
|
|
29
|
+
const otherEntries = [];
|
|
30
|
+
const typeOf = new Map();
|
|
31
|
+
for (const e of local) {
|
|
32
|
+
const type = e.type ?? classifyEntry(e, profile).type;
|
|
33
|
+
typeOf.set(e, type);
|
|
34
|
+
if (type !== undefined && declaring.has(type))
|
|
35
|
+
declaringEntries.push(e);
|
|
36
|
+
else
|
|
37
|
+
otherEntries.push(e);
|
|
38
|
+
}
|
|
39
|
+
const diagnostics = [];
|
|
40
|
+
// UXIL-023 — an unambiguous root declaration outside a declaring type.
|
|
41
|
+
for (const e of otherEntries) {
|
|
42
|
+
for (const span of extractUxRootSpans(e.bodyTokens)) {
|
|
43
|
+
diagnostics.push(uxilDiagnosticAt("UXIL-023", {
|
|
44
|
+
entry: e.displayId,
|
|
45
|
+
type: typeOf.get(e) ?? "unclassified",
|
|
46
|
+
}, span.location));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
const result = validateUxil(declaringEntries, { citationEntries: local });
|
|
50
|
+
diagnostics.push(...result.diagnostics);
|
|
51
|
+
return diagnostics;
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -14,11 +14,10 @@
|
|
|
14
14
|
* - EARS (`When`, `While`, `Where`, `Unless`) — lowercased
|
|
15
15
|
* mid-sentence, capitalisation preserved when sentence-initial.
|
|
16
16
|
*
|
|
17
|
-
* The shared `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* `core/util/` is the base level that both modules can import from.
|
|
17
|
+
* The shared `normalizeProseModals` helper is imported from
|
|
18
|
+
* `core/util/modals.ts`. Importing it from `formatter/mod.ts` would create
|
|
19
|
+
* a cycle because `formatter/` already depends on `ast/`.
|
|
20
|
+
* The helper uses only the standalone remark code-region parser.
|
|
22
21
|
*
|
|
23
22
|
* Invariants (HARD — never weaken):
|
|
24
23
|
* - Pure: no `Deno.*`, no I/O.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/ast/normalize.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../src/ast/normalize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAGH,OAAO,KAAK,EAEV,SAAS,EASV,MAAM,YAAY,CAAC;AA+GpB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,SAAS,EAAE,GAC3B,SAAS,EAAE,CAEb"}
|
package/script/ast/normalize.js
CHANGED
|
@@ -15,11 +15,10 @@
|
|
|
15
15
|
* - EARS (`When`, `While`, `Where`, `Unless`) — lowercased
|
|
16
16
|
* mid-sentence, capitalisation preserved when sentence-initial.
|
|
17
17
|
*
|
|
18
|
-
* The shared `
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* `core/util/` is the base level that both modules can import from.
|
|
18
|
+
* The shared `normalizeProseModals` helper is imported from
|
|
19
|
+
* `core/util/modals.ts`. Importing it from `formatter/mod.ts` would create
|
|
20
|
+
* a cycle because `formatter/` already depends on `ast/`.
|
|
21
|
+
* The helper uses only the standalone remark code-region parser.
|
|
23
22
|
*
|
|
24
23
|
* Invariants (HARD — never weaken):
|
|
25
24
|
* - Pure: no `Deno.*`, no I/O.
|
|
@@ -36,38 +35,8 @@
|
|
|
36
35
|
*/
|
|
37
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
37
|
exports.normalizeBodyAst = normalizeBodyAst;
|
|
39
|
-
const fence_js_1 = require("../util/fence.js");
|
|
40
38
|
const modals_js_1 = require("../util/modals.js");
|
|
41
39
|
// ---------------------------------------------------------------------------
|
|
42
|
-
// §3.4.1 string helper — uses shared RFC2119_MODAL_RE, EARS_KEYWORD_RE,
|
|
43
|
-
// and isSentenceInitial from core/util/modals.ts (D11 consolidation).
|
|
44
|
-
// ---------------------------------------------------------------------------
|
|
45
|
-
/**
|
|
46
|
-
* Apply the §3.4.1 modal-keyword case rule to a prose string.
|
|
47
|
-
*
|
|
48
|
-
* Faithful port of `normalizeModalKeywords` (`core/formatter/mod.ts`):
|
|
49
|
-
* fenced-code lines are skipped (verbatim, §5.1), and lines indented by
|
|
50
|
-
* four or more spaces (or a tab) are skipped (conservatively captures
|
|
51
|
-
* indented code blocks / attribute trailers — not prose). On every other
|
|
52
|
-
* line, RFC 2119 keywords are lowercased unconditionally and EARS
|
|
53
|
-
* keywords are lowercased unless sentence-initial.
|
|
54
|
-
*
|
|
55
|
-
* Pure and total: never throws; a string with no modal keyword is
|
|
56
|
-
* returned unchanged.
|
|
57
|
-
*/
|
|
58
|
-
function normalizeModalsInText(text) {
|
|
59
|
-
const lines = text.split("\n");
|
|
60
|
-
(0, fence_js_1.walkProseLines)(text, (line, i) => {
|
|
61
|
-
// Indented-code / attribute-trailer lines aren't prose either.
|
|
62
|
-
if (/^( {4}|\t)/.test(line))
|
|
63
|
-
return;
|
|
64
|
-
let normalized = line.replace(modals_js_1.RFC2119_MODAL_RE, (m) => m.toLowerCase());
|
|
65
|
-
normalized = normalized.replace(modals_js_1.EARS_KEYWORD_RE, (m, _g1, offset) => (0, modals_js_1.isSentenceInitial)(normalized, offset) ? m : m.toLowerCase());
|
|
66
|
-
lines[i] = normalized;
|
|
67
|
-
});
|
|
68
|
-
return lines.join("\n");
|
|
69
|
-
}
|
|
70
|
-
// ---------------------------------------------------------------------------
|
|
71
40
|
// InlineContent normalisation
|
|
72
41
|
// ---------------------------------------------------------------------------
|
|
73
42
|
/**
|
|
@@ -78,7 +47,7 @@ function normalizeModalsInText(text) {
|
|
|
78
47
|
* returned UNCHANGED (makes the no-op case allocation-free).
|
|
79
48
|
*/
|
|
80
49
|
function normalizeInline(content) {
|
|
81
|
-
const normalizedText =
|
|
50
|
+
const normalizedText = (0, modals_js_1.normalizeProseModals)(content.text);
|
|
82
51
|
if (normalizedText === content.text)
|
|
83
52
|
return content;
|
|
84
53
|
return { text: normalizedText };
|
package/script/collect/mod.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module core/collect
|
|
3
3
|
*
|
|
4
|
-
* Project-entry collection: discover
|
|
5
|
-
*
|
|
4
|
+
* Project-entry collection: discover the MarkSpec-relevant files of one
|
|
5
|
+
* project (a root, minus the projects nested below it) and parse them into
|
|
6
|
+
* a flat `Entry[]`. The single source of truth for
|
|
6
7
|
* "the set of entries whose trace edges the lockfile pins" — shared by
|
|
7
8
|
* `markspec lock` (the pinner) and its checkers (`compile`, `fmt`, `doctor`)
|
|
8
9
|
* so they cannot disagree on which files count. Previously each of those
|
|
@@ -12,23 +13,42 @@
|
|
|
12
13
|
*/
|
|
13
14
|
import type { Entry } from "../model/mod.js";
|
|
14
15
|
import { type DiscoveryIO } from "../discovery/mod.js";
|
|
16
|
+
/** A discovered project file could not be read. */
|
|
17
|
+
export declare class UnreadableProjectFileError extends Error {
|
|
18
|
+
readonly file: string;
|
|
19
|
+
constructor(file: string);
|
|
20
|
+
}
|
|
15
21
|
/** Options for {@linkcode collectProjectEntries}. */
|
|
16
22
|
export interface CollectOptions {
|
|
17
|
-
/** Gitignore-syntax patterns (e.g.
|
|
18
|
-
* `root`. Applied after
|
|
23
|
+
/** Gitignore-syntax patterns (e.g. `.markspec.yaml` `exclude:`), anchored at
|
|
24
|
+
* `root`. Applied after built-in build-output skips and all `.gitignore`
|
|
25
|
+
* rules at every directory level. Hidden directories are always skipped.
|
|
26
|
+
* Defaults to none. */
|
|
19
27
|
readonly exclude?: readonly string[];
|
|
28
|
+
/** An enclosing project root whose `.gitignore` files, from it down to
|
|
29
|
+
* `root`, also apply (`discoverFiles` option of the same name). Pass the
|
|
30
|
+
* outermost project root above a nested project, so the nested project
|
|
31
|
+
* pins the files a bare `check` from any folder walks. */
|
|
32
|
+
readonly inheritGitignoreFrom?: string;
|
|
33
|
+
/** Roots of the projects nested below `root`. Their files belong to those
|
|
34
|
+
* projects and are skipped: each `markspec.lock` pins only the entries
|
|
35
|
+
* of its own project. Defaults to none. */
|
|
36
|
+
readonly nestedRoots?: readonly string[];
|
|
20
37
|
}
|
|
21
38
|
/**
|
|
22
39
|
* Walk `root` via {@linkcode discoverFiles} — relying on its default
|
|
23
40
|
* extension set (`RELEVANT_EXTENSIONS`), the parity point every caller
|
|
24
|
-
* depends on — and parse each discovered file
|
|
25
|
-
* entry list.
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
41
|
+
* depends on — and parse each discovered file of the project at `root`,
|
|
42
|
+
* returning the flattened entry list. Files below `opts.nestedRoots` are
|
|
43
|
+
* skipped, and `opts.inheritGitignoreFrom` adds the `.gitignore` files of
|
|
44
|
+
* an enclosing project. An unreadable discovered file aborts collection.
|
|
45
|
+
* Parse diagnostics are not surfaced here: this collector exists to give
|
|
46
|
+
* the lockfile pinner and its checkers one definition of the file set;
|
|
47
|
+
* callers that need diagnostics re-parse.
|
|
29
48
|
*
|
|
30
49
|
* @param io Injected filesystem surface (keeps `core/` Node-compatible; CLI
|
|
31
50
|
* entry points pass a Deno-backed implementation).
|
|
51
|
+
* @throws {UnreadableProjectFileError} If a discovered project file cannot be read.
|
|
32
52
|
*/
|
|
33
53
|
export declare function collectProjectEntries(root: string, io: DiscoveryIO, opts?: CollectOptions): Promise<Entry[]>;
|
|
34
54
|
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/collect/mod.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/collect/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAItE,mDAAmD;AACnD,qBAAa,0BAA2B,SAAQ,KAAK;IACvC,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAZ,IAAI,EAAE,MAAM;CAIlC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B;;;2BAGuB;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC;;;8DAG0D;IAC1D,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC;;+CAE2C;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,WAAW,EACf,IAAI,GAAE,cAAmB,GACxB,OAAO,CAAC,KAAK,EAAE,CAAC,CAkBlB"}
|
package/script/collect/mod.js
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @module core/collect
|
|
4
4
|
*
|
|
5
|
-
* Project-entry collection: discover
|
|
6
|
-
*
|
|
5
|
+
* Project-entry collection: discover the MarkSpec-relevant files of one
|
|
6
|
+
* project (a root, minus the projects nested below it) and parse them into
|
|
7
|
+
* a flat `Entry[]`. The single source of truth for
|
|
7
8
|
* "the set of entries whose trace edges the lockfile pins" — shared by
|
|
8
9
|
* `markspec lock` (the pinner) and its checkers (`compile`, `fmt`, `doctor`)
|
|
9
10
|
* so they cannot disagree on which files count. Previously each of those
|
|
@@ -12,27 +13,54 @@
|
|
|
12
13
|
* by hand or the lockfile edge-hash comparison would drift spuriously.
|
|
13
14
|
*/
|
|
14
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.UnreadableProjectFileError = void 0;
|
|
15
17
|
exports.collectProjectEntries = collectProjectEntries;
|
|
18
|
+
const path_1 = require("@std/path");
|
|
16
19
|
const mod_js_1 = require("../discovery/mod.js");
|
|
20
|
+
const projects_js_1 = require("../discovery/projects.js");
|
|
17
21
|
const mod_js_2 = require("../parser/mod.js");
|
|
22
|
+
/** A discovered project file could not be read. */
|
|
23
|
+
class UnreadableProjectFileError extends Error {
|
|
24
|
+
constructor(file) {
|
|
25
|
+
super(`Cannot read discovered project file: ${file}`);
|
|
26
|
+
Object.defineProperty(this, "file", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true,
|
|
29
|
+
writable: true,
|
|
30
|
+
value: file
|
|
31
|
+
});
|
|
32
|
+
this.name = "UnreadableProjectFileError";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.UnreadableProjectFileError = UnreadableProjectFileError;
|
|
18
36
|
/**
|
|
19
37
|
* Walk `root` via {@linkcode discoverFiles} — relying on its default
|
|
20
38
|
* extension set (`RELEVANT_EXTENSIONS`), the parity point every caller
|
|
21
|
-
* depends on — and parse each discovered file
|
|
22
|
-
* entry list.
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
39
|
+
* depends on — and parse each discovered file of the project at `root`,
|
|
40
|
+
* returning the flattened entry list. Files below `opts.nestedRoots` are
|
|
41
|
+
* skipped, and `opts.inheritGitignoreFrom` adds the `.gitignore` files of
|
|
42
|
+
* an enclosing project. An unreadable discovered file aborts collection.
|
|
43
|
+
* Parse diagnostics are not surfaced here: this collector exists to give
|
|
44
|
+
* the lockfile pinner and its checkers one definition of the file set;
|
|
45
|
+
* callers that need diagnostics re-parse.
|
|
26
46
|
*
|
|
27
47
|
* @param io Injected filesystem surface (keeps `core/` Node-compatible; CLI
|
|
28
48
|
* entry points pass a Deno-backed implementation).
|
|
49
|
+
* @throws {UnreadableProjectFileError} If a discovered project file cannot be read.
|
|
29
50
|
*/
|
|
30
51
|
async function collectProjectEntries(root, io, opts = {}) {
|
|
31
52
|
const out = [];
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
53
|
+
const roots = [root, ...opts.nestedRoots ?? []];
|
|
54
|
+
for await (const file of (0, mod_js_1.discoverFiles)(root, io, {
|
|
55
|
+
exclude: opts.exclude,
|
|
56
|
+
inheritGitignoreFrom: opts.inheritGitignoreFrom,
|
|
57
|
+
})) {
|
|
58
|
+
if ((0, projects_js_1.nearestRoot)((0, path_1.dirname)(file), roots) !== root)
|
|
35
59
|
continue;
|
|
60
|
+
const content = await io.readFile(file);
|
|
61
|
+
if (content === undefined) {
|
|
62
|
+
throw new UnreadableProjectFileError(file);
|
|
63
|
+
}
|
|
36
64
|
const result = await (0, mod_js_2.parseFile)(content, { file });
|
|
37
65
|
out.push(...result.entries);
|
|
38
66
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module compiler/deserialize
|
|
3
|
+
*
|
|
4
|
+
* Hydration of compiled-JSON snapshots back into core {@linkcode Entry}
|
|
5
|
+
* values — the inverse of `./schema.ts`. Consumed by the upstream corpus
|
|
6
|
+
* loader (`core/upstream/`): a dependency's or reference's published
|
|
7
|
+
* compile output is deserialized here before joining the consumer's graph.
|
|
8
|
+
*
|
|
9
|
+
* Pure module: no I/O, no Deno APIs.
|
|
10
|
+
*/
|
|
11
|
+
import type { Diagnostic, Entry } from "../model/mod.js";
|
|
12
|
+
import type { SerializedEntry } from "./schema.js";
|
|
13
|
+
/**
|
|
14
|
+
* Rebuild an {@linkcode Entry} from its serialized wire form. Inverse of
|
|
15
|
+
* `serializeEntry`: restores `typedAttributes` from a plain record to a
|
|
16
|
+
* `Map` (absent → empty). All other fields — including `origin` — pass
|
|
17
|
+
* through verbatim.
|
|
18
|
+
*
|
|
19
|
+
* `type` and `id` are re-keyed explicitly (rather than left to the
|
|
20
|
+
* `...rest` spread) to restore field-presence parity with a freshly
|
|
21
|
+
* parsed {@linkcode Entry}: the parser always includes both as own
|
|
22
|
+
* properties (`type` is `undefined` when no profile classified the
|
|
23
|
+
* entry; `id` is `undefined` on Reference-shaped entries with no `Id:`
|
|
24
|
+
* trailer), but `JSON.stringify` drops `undefined`-valued keys
|
|
25
|
+
* entirely, so the wire form loses the keys when it round-trips
|
|
26
|
+
* through `JSON.parse`. Without this, `deserializeEntry(wire)` would
|
|
27
|
+
* be missing those keys while the original entry still carries them
|
|
28
|
+
* (with value `undefined`), breaking the deep-equality round-trip
|
|
29
|
+
* contract.
|
|
30
|
+
*/
|
|
31
|
+
export declare function deserializeEntry(s: SerializedEntry): Entry;
|
|
32
|
+
/** Result of {@linkcode extractSerializedEntries}. */
|
|
33
|
+
export interface ExtractedEntries {
|
|
34
|
+
readonly entries: SerializedEntry[];
|
|
35
|
+
readonly diagnostics: Diagnostic[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Reject a snapshot whose schema versions don't match this build — a
|
|
39
|
+
* skewed snapshot must never silently misparse. Returns the diagnostic to
|
|
40
|
+
* publish, or `undefined` when the snapshot is compatible.
|
|
41
|
+
*/
|
|
42
|
+
export declare function checkSnapshotSchema(manifest: unknown, manifestPath: string): Diagnostic | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Follow the manifest's `entries` block and return the raw serialized
|
|
45
|
+
* entries. `readSnapshotFile` resolves a path relative to the snapshot
|
|
46
|
+
* directory (injected — this module does no I/O).
|
|
47
|
+
*/
|
|
48
|
+
export declare function extractSerializedEntries(manifest: unknown, readSnapshotFile: (relPath: string) => string | undefined, manifestPath: string): ExtractedEntries;
|
|
49
|
+
//# sourceMappingURL=deserialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deserialize.d.ts","sourceRoot":"","sources":["../../src/compiler/deserialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,eAAe,GAAG,KAAK,CAQ1D;AAED,sDAAsD;AACtD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,OAAO,EAAE,eAAe,EAAE,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,UAAU,EAAE,CAAC;CACpC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,MAAM,GACnB,UAAU,GAAG,SAAS,CAwBxB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,OAAO,EACjB,gBAAgB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,EACzD,YAAY,EAAE,MAAM,GACnB,gBAAgB,CAsDlB"}
|