@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
package/script/gates/mod.d.ts
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import type { Diagnostic, EffectiveProfile, Entry } from "../model/mod.js";
|
|
21
21
|
import type { ProseFormatter } from "../formatter/dprint.js";
|
|
22
|
-
import { type LockEdge, type ParseLockfileResult } from "../lock/mod.js";
|
|
22
|
+
import { type LockEdge, type ParseLockfileResult, type ReadFile as LockReadFile } from "../lock/mod.js";
|
|
23
23
|
/**
|
|
24
24
|
* Format-drift gate — the `MSL-F010` (formatter drift) and `MSL-F011`
|
|
25
25
|
* (reference-canonicalization drift) findings.
|
|
@@ -57,12 +57,23 @@ export declare function fmtDriftGate(mdContents: ReadonlyMap<string, string>, en
|
|
|
57
57
|
* re-lock. The gate therefore filters to project-owned entries (`!e.origin`),
|
|
58
58
|
* mirroring `markspec lock`.
|
|
59
59
|
*
|
|
60
|
+
* Also carries the MSL-L212 offline cache-drift case (Task 9): when `cache`
|
|
61
|
+
* is supplied and the lockfile parsed, every snapshot-carrying upstream row
|
|
62
|
+
* is verified against its on-disk cache under `cache.cacheRoot` and any
|
|
63
|
+
* cache-drift diagnostics are appended to the edge-drift result. Offline by
|
|
64
|
+
* design, like the edge-drift check — no network fetch.
|
|
65
|
+
*
|
|
60
66
|
* @param lockParse The parsed `markspec.lock` (already read from disk).
|
|
61
67
|
* @param lockPath Absolute path to `markspec.lock`, used as the diagnostic
|
|
62
68
|
* location so JSON consumers that group by `location.file` keep the finding.
|
|
63
69
|
* @param entries The full parsed entry set; corpus entries are filtered out.
|
|
70
|
+
* @param cache Optional upstream cache-verification inputs. Omitted →
|
|
71
|
+
* backward-compatible with callers that only want the edge-drift case.
|
|
64
72
|
*/
|
|
65
|
-
export declare function lockfileDriftGate(lockParse: ParseLockfileResult, lockPath: string, entries: readonly Entry[]
|
|
73
|
+
export declare function lockfileDriftGate(lockParse: ParseLockfileResult, lockPath: string, entries: readonly Entry[], cache?: {
|
|
74
|
+
readonly cacheRoot: string;
|
|
75
|
+
readonly readFile: LockReadFile;
|
|
76
|
+
}): Promise<Diagnostic[]>;
|
|
66
77
|
/**
|
|
67
78
|
* Prose-lint gate — the advisory `MSL-Q` prose-analysis findings, projected to
|
|
68
79
|
* plain {@linkcode Diagnostic}s.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/gates/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../src/gates/mod.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAGL,KAAK,QAAQ,EACb,KAAK,mBAAmB,EACxB,KAAK,QAAQ,IAAI,YAAY,EAE9B,MAAM,gBAAgB,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACvC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,MAAM,EAAE,SAAS,QAAQ,EAAE,EAC3B,mBAAmB,EAAE,cAAc,GAAG,SAAS,GAC9C,OAAO,CAAC,UAAU,EAAE,CAAC,CAwCvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,mBAAmB,EAC9B,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,KAAK,CAAC,EAAE;IAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAAE,GACtE,OAAO,CAAC,UAAU,EAAE,CAAC,CAuCvB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,OAAO,EAAE,gBAAgB,GAAG,SAAS,GACpC,OAAO,CAAC,UAAU,EAAE,CAAC,CAQvB"}
|
package/script/gates/mod.js
CHANGED
|
@@ -22,11 +22,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
22
22
|
exports.fmtDriftGate = fmtDriftGate;
|
|
23
23
|
exports.lockfileDriftGate = lockfileDriftGate;
|
|
24
24
|
exports.proseLintGate = proseLintGate;
|
|
25
|
-
const mod_js_1 = require("../
|
|
26
|
-
const mod_js_2 = require("../
|
|
27
|
-
const mod_js_3 = require("../
|
|
28
|
-
const mod_js_4 = require("../
|
|
29
|
-
const mod_js_5 = require("../
|
|
25
|
+
const mod_js_1 = require("../model/mod.js");
|
|
26
|
+
const mod_js_2 = require("../formatter/mod.js");
|
|
27
|
+
const mod_js_3 = require("../parser/mod.js");
|
|
28
|
+
const mod_js_4 = require("../refs/mod.js");
|
|
29
|
+
const mod_js_5 = require("../lock/mod.js");
|
|
30
|
+
const mod_js_6 = require("../lint/mod.js");
|
|
30
31
|
/**
|
|
31
32
|
* Format-drift gate — the `MSL-F010` (formatter drift) and `MSL-F011`
|
|
32
33
|
* (reference-canonicalization drift) findings.
|
|
@@ -55,10 +56,11 @@ async function fmtDriftGate(mdContents, entries, ledger, formatMarkdownProse) {
|
|
|
55
56
|
// Building the heal index over the full set (including corpus) would flag an
|
|
56
57
|
// MSL-F011 drift that `fmt` can never fix — a permanently red gate for any
|
|
57
58
|
// consumer using a delivered corpus. Filter to `!e.origin`, mirroring
|
|
58
|
-
// lockfileDriftGate
|
|
59
|
-
|
|
59
|
+
// lockfileDriftGate — deliberately BROADER than the validators'
|
|
60
|
+
// `emittableEntries` (upstream-only, #771); do not "unify" it.
|
|
61
|
+
const refIndex = (0, mod_js_4.buildRefIndex)(entries.filter((e) => !(0, mod_js_1.isCorpusEntry)(e)));
|
|
60
62
|
for (const [filePath, content] of mdContents) {
|
|
61
|
-
const formatted = (0,
|
|
63
|
+
const formatted = (0, mod_js_2.format)(content, {
|
|
62
64
|
file: filePath,
|
|
63
65
|
formatMarkdownProse,
|
|
64
66
|
});
|
|
@@ -70,8 +72,8 @@ async function fmtDriftGate(mdContents, entries, ledger, formatMarkdownProse) {
|
|
|
70
72
|
location: { file: filePath, line: 1, column: 1 },
|
|
71
73
|
});
|
|
72
74
|
}
|
|
73
|
-
const parsed = await (0,
|
|
74
|
-
const refResult = (0,
|
|
75
|
+
const parsed = await (0, mod_js_3.parseFile)(formatted.output, { file: filePath });
|
|
76
|
+
const refResult = (0, mod_js_4.canonicalizeRefs)(formatted.output, parsed.entries, refIndex, ledger);
|
|
75
77
|
if (refResult.changed) {
|
|
76
78
|
diagnostics.push({
|
|
77
79
|
code: "MSL-F011",
|
|
@@ -98,25 +100,51 @@ async function fmtDriftGate(mdContents, entries, ledger, formatMarkdownProse) {
|
|
|
98
100
|
* re-lock. The gate therefore filters to project-owned entries (`!e.origin`),
|
|
99
101
|
* mirroring `markspec lock`.
|
|
100
102
|
*
|
|
103
|
+
* Also carries the MSL-L212 offline cache-drift case (Task 9): when `cache`
|
|
104
|
+
* is supplied and the lockfile parsed, every snapshot-carrying upstream row
|
|
105
|
+
* is verified against its on-disk cache under `cache.cacheRoot` and any
|
|
106
|
+
* cache-drift diagnostics are appended to the edge-drift result. Offline by
|
|
107
|
+
* design, like the edge-drift check — no network fetch.
|
|
108
|
+
*
|
|
101
109
|
* @param lockParse The parsed `markspec.lock` (already read from disk).
|
|
102
110
|
* @param lockPath Absolute path to `markspec.lock`, used as the diagnostic
|
|
103
111
|
* location so JSON consumers that group by `location.file` keep the finding.
|
|
104
112
|
* @param entries The full parsed entry set; corpus entries are filtered out.
|
|
113
|
+
* @param cache Optional upstream cache-verification inputs. Omitted →
|
|
114
|
+
* backward-compatible with callers that only want the edge-drift case.
|
|
105
115
|
*/
|
|
106
|
-
async function lockfileDriftGate(lockParse, lockPath, entries) {
|
|
116
|
+
async function lockfileDriftGate(lockParse, lockPath, entries, cache) {
|
|
107
117
|
if (!lockParse.lockfile) {
|
|
108
118
|
return [...lockParse.diagnostics];
|
|
109
119
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
// `!e.origin` (project-owned only) — deliberately BROADER than the
|
|
121
|
+
// validators' `emittableEntries` partition (upstream-only, #771): the
|
|
122
|
+
// edge ledger records only edges the project authors.
|
|
123
|
+
const projectEntries = entries.filter((e) => !(0, mod_js_1.isCorpusEntry)(e));
|
|
124
|
+
const drift = await (0, mod_js_5.detectOfflineEdgeDrift)(projectEntries, lockParse.lockfile.generatedCache);
|
|
125
|
+
const diagnostics = drift.drifted
|
|
126
|
+
? [{
|
|
127
|
+
code: "MSL-L212",
|
|
128
|
+
severity: "error",
|
|
129
|
+
message: (0, mod_js_5.formatEdgeDriftMessage)(drift.lockedCount, drift.currentCount),
|
|
130
|
+
location: { file: lockPath, line: 1, column: 1 },
|
|
131
|
+
}]
|
|
132
|
+
: [];
|
|
133
|
+
if (cache !== undefined) {
|
|
134
|
+
const cacheDiags = await (0, mod_js_5.verifyUpstreamCache)(lockParse.lockfile.upstreams, cache.cacheRoot, cache.readFile);
|
|
135
|
+
// verifyUpstreamCache is a reusable, lockfile-path-agnostic probe and
|
|
136
|
+
// emits `location: undefined` (see cache_check.ts). Stamp the same
|
|
137
|
+
// lockfile location the sibling edge-drift MSL-L212 above uses, so both
|
|
138
|
+
// findings from the same `markspec.lock` group under one file for a
|
|
139
|
+
// JSON consumer keyed on `location.file`.
|
|
140
|
+
for (const d of cacheDiags) {
|
|
141
|
+
diagnostics.push({
|
|
142
|
+
...d,
|
|
143
|
+
location: { file: lockPath, line: 1, column: 1 },
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return diagnostics;
|
|
120
148
|
}
|
|
121
149
|
/**
|
|
122
150
|
* Prose-lint gate — the advisory `MSL-Q` prose-analysis findings, projected to
|
|
@@ -134,7 +162,7 @@ async function lockfileDriftGate(lockParse, lockPath, entries) {
|
|
|
134
162
|
* file indexing) is not needed here: `check` passes no `glossaryFilePaths`.
|
|
135
163
|
*/
|
|
136
164
|
async function proseLintGate(entries, profile) {
|
|
137
|
-
const lintResult = await (0,
|
|
165
|
+
const lintResult = await (0, mod_js_6.runLint)({ entries, profile });
|
|
138
166
|
return lintResult.diagnostics.map((d) => ({
|
|
139
167
|
code: d.code,
|
|
140
168
|
severity: d.severity,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAgB9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAKT;AAMD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../../src/lint/runner.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAG/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAUjD,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,eAAe,CAAC;AAY/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAgB9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,KAAK,EACZ,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAKT;AAMD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IACpC,6EAA6E;IAC7E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAChD,yEAAyE;IACzE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/C,mDAAmD;IACnD,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAoBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,OAAO,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CA+FvE"}
|
package/script/lint/runner.js
CHANGED
|
@@ -120,10 +120,12 @@ async function runLint(options) {
|
|
|
120
120
|
// Steps 1–9: collect diagnostics keyed by entry. Delivered-corpus entries
|
|
121
121
|
// (`entry.origin`) are excluded from rule execution — a consumer cannot fix
|
|
122
122
|
// upstream prose (ADR-030 §D4) — even though they contribute to the indexes
|
|
123
|
-
// above.
|
|
123
|
+
// above. Deliberately BROADER than the validators' `emittableEntries`
|
|
124
|
+
// partition (upstream-only, #771): profile corpus stays structurally
|
|
125
|
+
// validated but is never prose-linted — do not "unify" this filter.
|
|
124
126
|
const inScopeDiags = new Map();
|
|
125
127
|
for (const entry of entries) {
|
|
126
|
-
if (
|
|
128
|
+
if ((0, mod_js_1.isCorpusEntry)(entry))
|
|
127
129
|
continue;
|
|
128
130
|
if (!isProseScope(entry, profile))
|
|
129
131
|
continue;
|
|
@@ -151,7 +153,7 @@ async function runLint(options) {
|
|
|
151
153
|
for (const entry of entries) {
|
|
152
154
|
if (entry.shape !== "Authored")
|
|
153
155
|
continue;
|
|
154
|
-
if (
|
|
156
|
+
if ((0, mod_js_1.isCorpusEntry)(entry))
|
|
155
157
|
continue;
|
|
156
158
|
hygieneDiags.push(...(0, suppression_js_1.runSuppressionRules)(entry));
|
|
157
159
|
}
|
|
@@ -186,6 +188,6 @@ async function runLint(options) {
|
|
|
186
188
|
// ones). Corpus entries are excluded — counting them would skew band-counts
|
|
187
189
|
// and the mean on prose a consumer cannot act on (ADR-030 §D4). A no-op when
|
|
188
190
|
// no corpus is present.
|
|
189
|
-
const score = (0, score_js_1.computeScoreRollup)(out, entries.filter((e) => !
|
|
191
|
+
const score = (0, score_js_1.computeScoreRollup)(out, entries.filter((e) => !(0, mod_js_1.isCorpusEntry)(e)));
|
|
190
192
|
return { diagnostics: out, score };
|
|
191
193
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/acquire_compile
|
|
3
|
+
*
|
|
4
|
+
* Deterministic in-process compile of an acquired dependency tree
|
|
5
|
+
* (design §4.3). Produces the same `manifest.json` + `compiled.json` layout
|
|
6
|
+
* a published `references:` site serves, so `loadUpstreamCorpus` /
|
|
7
|
+
* `probeCacheSnapshot` read a dependency snapshot identically to a reference
|
|
8
|
+
* snapshot. The output is byte-reproducible from (tree, markspec version):
|
|
9
|
+
* files are compiled in sorted, tree-relative order with no stat/git IO, so
|
|
10
|
+
* `entry.location.file`, `properties.file.path`, and entry ordering are all
|
|
11
|
+
* stable. Pure — every file touch flows through {@linkcode AcquireCompileIO}.
|
|
12
|
+
*/
|
|
13
|
+
import { type ManifestJson } from "../compiler/manifest.js";
|
|
14
|
+
import { type DiscoveryIO } from "../discovery/mod.js";
|
|
15
|
+
export interface AcquireCompileIO {
|
|
16
|
+
/** Config/profile reader — returns text or undefined (core `ReadFile`). */
|
|
17
|
+
readonly readFile: (path: string) => Promise<string | undefined>;
|
|
18
|
+
/** Throwing reader compile() consumes (`(path) => Promise<string>`). */
|
|
19
|
+
readonly readText: (path: string) => Promise<string>;
|
|
20
|
+
/** Discovery seam (`{ readDir, readFile }`) — same as `denoDiscoveryIO()`. */
|
|
21
|
+
readonly discovery: DiscoveryIO;
|
|
22
|
+
}
|
|
23
|
+
export interface CompiledSnapshot {
|
|
24
|
+
readonly manifestJson: ManifestJson;
|
|
25
|
+
readonly compiledBytes: Uint8Array;
|
|
26
|
+
readonly snapshot: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function compileAcquiredTree(treeRoot: string, io: AcquireCompileIO, release: string): Promise<CompiledSnapshot | {
|
|
29
|
+
error: string;
|
|
30
|
+
}>;
|
|
31
|
+
//# sourceMappingURL=acquire_compile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acquire_compile.d.ts","sourceRoot":"","sources":["../../src/lock/acquire_compile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAK3E,OAAO,EAAiB,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGtE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACjE,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACrD,8EAA8E;IAC9E,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CACjC;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,aAAa,EAAE,UAAU,CAAC;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,EAAE,EAAE,gBAAgB,EACpB,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CA0E/C"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/lock/acquire_compile
|
|
4
|
+
*
|
|
5
|
+
* Deterministic in-process compile of an acquired dependency tree
|
|
6
|
+
* (design §4.3). Produces the same `manifest.json` + `compiled.json` layout
|
|
7
|
+
* a published `references:` site serves, so `loadUpstreamCorpus` /
|
|
8
|
+
* `probeCacheSnapshot` read a dependency snapshot identically to a reference
|
|
9
|
+
* snapshot. The output is byte-reproducible from (tree, markspec version):
|
|
10
|
+
* files are compiled in sorted, tree-relative order with no stat/git IO, so
|
|
11
|
+
* `entry.location.file`, `properties.file.path`, and entry ordering are all
|
|
12
|
+
* stable. Pure — every file touch flows through {@linkcode AcquireCompileIO}.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.compileAcquiredTree = compileAcquiredTree;
|
|
16
|
+
const path_1 = require("@std/path");
|
|
17
|
+
const mod_js_1 = require("../compiler/mod.js");
|
|
18
|
+
const manifest_js_1 = require("../compiler/manifest.js");
|
|
19
|
+
const schema_js_1 = require("../compiler/schema.js");
|
|
20
|
+
const mod_js_2 = require("../config/mod.js");
|
|
21
|
+
const markspec_js_1 = require("../config/markspec.js");
|
|
22
|
+
const load_js_1 = require("../profile/load.js");
|
|
23
|
+
const mod_js_3 = require("../discovery/mod.js");
|
|
24
|
+
const hash_js_1 = require("./hash.js");
|
|
25
|
+
async function compileAcquiredTree(treeRoot, io, release) {
|
|
26
|
+
// Memoize by path: loadConfig, loadProfileForCommand, and loadToolConfig
|
|
27
|
+
// each walk + read the same project.yaml/.markspec.yaml, so cache the
|
|
28
|
+
// in-flight promise per path to read each file exactly once per acquired
|
|
29
|
+
// tree. The tree is immutable (just fetched at a fixed sha), so a
|
|
30
|
+
// per-call cache is sound and deterministic.
|
|
31
|
+
const readCache = new Map();
|
|
32
|
+
const readFile = (path) => {
|
|
33
|
+
let pending = readCache.get(path);
|
|
34
|
+
if (pending === undefined) {
|
|
35
|
+
pending = io.readFile(path);
|
|
36
|
+
readCache.set(path, pending);
|
|
37
|
+
}
|
|
38
|
+
return pending;
|
|
39
|
+
};
|
|
40
|
+
const configResult = await (0, mod_js_2.loadConfig)(treeRoot, readFile);
|
|
41
|
+
if (!configResult) {
|
|
42
|
+
return { error: "dependency tree has no discoverable project.yaml" };
|
|
43
|
+
}
|
|
44
|
+
const profileResult = await (0, load_js_1.loadProfileForCommand)(treeRoot, readFile);
|
|
45
|
+
const profile = profileResult.chain?.effective;
|
|
46
|
+
const toolConfig = await (0, markspec_js_1.loadToolConfig)(treeRoot, readFile);
|
|
47
|
+
// Discover → relativize → normalize to POSIX separators → sort. The
|
|
48
|
+
// `\\`→`/` normalization is load-bearing for cross-machine determinism:
|
|
49
|
+
// `relative()` yields OS-native separators, so a Windows host would emit
|
|
50
|
+
// `docs\reqs.md` while POSIX emits `docs/reqs.md`, giving two different
|
|
51
|
+
// `location.file`/`properties.file.path` values → two different snapshot
|
|
52
|
+
// hashes for the same source → spurious MSL-L212 drift between a Windows
|
|
53
|
+
// and a macOS/Linux developer sharing one lockfile. Normalizing before
|
|
54
|
+
// the sort also makes the entry order (hence JSON key order) identical
|
|
55
|
+
// on every platform.
|
|
56
|
+
const abs = [];
|
|
57
|
+
for await (const f of (0, mod_js_3.discoverFiles)(treeRoot, io.discovery, {
|
|
58
|
+
exclude: toolConfig.config.exclude,
|
|
59
|
+
})) {
|
|
60
|
+
abs.push(f);
|
|
61
|
+
}
|
|
62
|
+
const rel = abs
|
|
63
|
+
.map((p) => (0, path_1.relative)(treeRoot, p).replaceAll("\\", "/"))
|
|
64
|
+
.sort();
|
|
65
|
+
// Compile with a root-resolving reader and NO stat/git callbacks →
|
|
66
|
+
// deterministic properties (no mtime, no contributors, relative path).
|
|
67
|
+
const result = await (0, mod_js_1.compile)(rel, {
|
|
68
|
+
readFile: (r) => io.readText((0, path_1.join)(treeRoot, r)),
|
|
69
|
+
profile,
|
|
70
|
+
});
|
|
71
|
+
// `root` is cosmetic here — manifest.json is not hashed (only compiled.json
|
|
72
|
+
// is) and lives in the gitignored cache; pass "." so no temp path leaks.
|
|
73
|
+
const manifestJson = (0, manifest_js_1.buildManifest)(result, configResult.config, ".", profile, release, false);
|
|
74
|
+
// Compact (no whitespace) rather than the CLI's pretty-printed form —
|
|
75
|
+
// this cache file is machine-read only (loadUpstreamCorpus /
|
|
76
|
+
// probeCacheSnapshot JSON.parse it), and compact output keeps
|
|
77
|
+
// `entry.location.file`'s tree-relative path adjacent to its `"file":`
|
|
78
|
+
// key with no formatting-introduced variance to reason about.
|
|
79
|
+
const compiled = (0, schema_js_1.serializeCompileResult)(result);
|
|
80
|
+
const compiledBytes = new TextEncoder().encode(JSON.stringify(compiled));
|
|
81
|
+
return {
|
|
82
|
+
manifestJson,
|
|
83
|
+
compiledBytes,
|
|
84
|
+
snapshot: await (0, hash_js_1.sha256Bytes)(compiledBytes),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/cache_check
|
|
3
|
+
*
|
|
4
|
+
* Offline upstream cache-integrity check — the MSL-L212 cache-drift case
|
|
5
|
+
* (Task 9). For every locked upstream row that carries a `snapshot` hash
|
|
6
|
+
* (a federated registry or git-repository dependency), verify its cache
|
|
7
|
+
* under `<cacheRoot>/<id>/` is still present and hash-intact.
|
|
8
|
+
*
|
|
9
|
+
* Reuses {@linkcode probeCacheSnapshot} — the exact probe
|
|
10
|
+
* `resolveProjectReferences`'s keep/restore flow already uses
|
|
11
|
+
* (`upstream_refs.ts`, Task 5) — so `markspec check` and `markspec lock`
|
|
12
|
+
* never disagree on what "cache intact" means. Rows without a `snapshot`
|
|
13
|
+
* (legacy registry rows predating this field, or upstream kinds that never
|
|
14
|
+
* carry one — reference, profile) are skipped: there is nothing to verify
|
|
15
|
+
* offline.
|
|
16
|
+
*
|
|
17
|
+
* Pure module: file access only via the injected {@linkcode ReadFile}.
|
|
18
|
+
*/
|
|
19
|
+
import type { Diagnostic } from "../model/mod.js";
|
|
20
|
+
import type { Upstream } from "./model.js";
|
|
21
|
+
import type { ReadFile } from "./resolve.js";
|
|
22
|
+
/**
|
|
23
|
+
* Verify every snapshot-carrying upstream row's cache under `cacheRoot`.
|
|
24
|
+
* One `MSL-L212` diagnostic per row whose cache is missing or whose
|
|
25
|
+
* entries-file hash no longer matches the locked `snapshot`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function verifyUpstreamCache(upstreams: readonly Upstream[], cacheRoot: string, readFile: ReadFile): Promise<Diagnostic[]>;
|
|
28
|
+
//# sourceMappingURL=cache_check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache_check.d.ts","sourceRoot":"","sources":["../../src/lock/cache_check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAa7C;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,SAAS,QAAQ,EAAE,EAC9B,SAAS,EAAE,MAAM,EACjB,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,UAAU,EAAE,CAAC,CAevB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/lock/cache_check
|
|
4
|
+
*
|
|
5
|
+
* Offline upstream cache-integrity check — the MSL-L212 cache-drift case
|
|
6
|
+
* (Task 9). For every locked upstream row that carries a `snapshot` hash
|
|
7
|
+
* (a federated registry or git-repository dependency), verify its cache
|
|
8
|
+
* under `<cacheRoot>/<id>/` is still present and hash-intact.
|
|
9
|
+
*
|
|
10
|
+
* Reuses {@linkcode probeCacheSnapshot} — the exact probe
|
|
11
|
+
* `resolveProjectReferences`'s keep/restore flow already uses
|
|
12
|
+
* (`upstream_refs.ts`, Task 5) — so `markspec check` and `markspec lock`
|
|
13
|
+
* never disagree on what "cache intact" means. Rows without a `snapshot`
|
|
14
|
+
* (legacy registry rows predating this field, or upstream kinds that never
|
|
15
|
+
* carry one — reference, profile) are skipped: there is nothing to verify
|
|
16
|
+
* offline.
|
|
17
|
+
*
|
|
18
|
+
* Pure module: file access only via the injected {@linkcode ReadFile}.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.verifyUpstreamCache = verifyUpstreamCache;
|
|
22
|
+
const path_1 = require("@std/path");
|
|
23
|
+
const upstream_refs_js_1 = require("./upstream_refs.js");
|
|
24
|
+
function cacheDriftDiagnostic(id) {
|
|
25
|
+
return {
|
|
26
|
+
code: "MSL-L212",
|
|
27
|
+
severity: "error",
|
|
28
|
+
message: `upstream '${id}' cache snapshot is missing or does not match markspec.lock — run 'markspec lock'`,
|
|
29
|
+
location: undefined,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Verify every snapshot-carrying upstream row's cache under `cacheRoot`.
|
|
34
|
+
* One `MSL-L212` diagnostic per row whose cache is missing or whose
|
|
35
|
+
* entries-file hash no longer matches the locked `snapshot`.
|
|
36
|
+
*/
|
|
37
|
+
async function verifyUpstreamCache(upstreams, cacheRoot, readFile) {
|
|
38
|
+
const diagnostics = [];
|
|
39
|
+
for (const upstream of upstreams) {
|
|
40
|
+
if (upstream.kind !== "registry" && upstream.kind !== "dependency") {
|
|
41
|
+
continue; // references/profiles never carry a cache snapshot
|
|
42
|
+
}
|
|
43
|
+
if (upstream.snapshot === undefined)
|
|
44
|
+
continue; // legacy row — skip
|
|
45
|
+
// join() at construction (#771): a template concat would mix the
|
|
46
|
+
// platform separator with a literal `/` — the Windows drift class
|
|
47
|
+
// that bit slices 2 and 4. Writer and reader must agree byte-for-byte.
|
|
48
|
+
const dir = (0, path_1.join)(cacheRoot, upstream.id);
|
|
49
|
+
const intact = await (0, upstream_refs_js_1.probeCacheSnapshot)(dir, upstream.snapshot, readFile);
|
|
50
|
+
if (!intact)
|
|
51
|
+
diagnostics.push(cacheDriftDiagnostic(upstream.id));
|
|
52
|
+
}
|
|
53
|
+
return diagnostics;
|
|
54
|
+
}
|
package/script/lock/check.d.ts
CHANGED
|
@@ -6,11 +6,18 @@
|
|
|
6
6
|
* category. Pure function — no I/O.
|
|
7
7
|
*
|
|
8
8
|
* Drift categories:
|
|
9
|
-
* - MSL-L202 — upstream in resolved but missing from lockfile
|
|
10
|
-
*
|
|
9
|
+
* - MSL-L202 — upstream in resolved but missing from lockfile (also:
|
|
10
|
+
* a declared reference with no lockfile registry row)
|
|
11
|
+
* - MSL-L203 — upstream in lockfile but missing from resolved (also:
|
|
12
|
+
* a locked registry row no longer declared in project.yaml)
|
|
11
13
|
* - MSL-L210 — hash mismatch (same identity, different bytes)
|
|
12
14
|
* - MSL-L211 — profile resolved-version drift (npm range now resolves a different exact version)
|
|
13
15
|
* - MSL-L212 — canonical edge hash drift (traceability graph changed)
|
|
16
|
+
*
|
|
17
|
+
* Federated registry rows (org `references:`) are checked by pure
|
|
18
|
+
* id-presence against `declaredReferenceIds` — no hash comparison.
|
|
19
|
+
* Content integrity for those rows is the offline cache gate (a later
|
|
20
|
+
* task), not this online-vs-lockfile comparison.
|
|
14
21
|
*/
|
|
15
22
|
import type { Diagnostic } from "../model/mod.js";
|
|
16
23
|
import type { Lockfile } from "./model.js";
|
|
@@ -19,6 +26,10 @@ import type { ResolvedUpstreams } from "./resolve.js";
|
|
|
19
26
|
* Compare locked vs resolved upstreams; return one diagnostic per drift
|
|
20
27
|
* case. An empty result means the lockfile is in sync with the current
|
|
21
28
|
* project state.
|
|
29
|
+
*
|
|
30
|
+
* @param declaredReferenceIds - Upstream ids derived from
|
|
31
|
+
* `config.references` (via `deriveUpstreamId`) — the id-presence
|
|
32
|
+
* comparison set for federated registry rows.
|
|
22
33
|
*/
|
|
23
|
-
export declare function checkDrift(locked: Lockfile, resolved: ResolvedUpstreams): Diagnostic[];
|
|
34
|
+
export declare function checkDrift(locked: Lockfile, resolved: ResolvedUpstreams, declaredReferenceIds: readonly string[]): Diagnostic[];
|
|
24
35
|
//# sourceMappingURL=check.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/lock/check.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/lock/check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EACV,QAAQ,EAIT,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CACxB,MAAM,EAAE,QAAQ,EAChB,QAAQ,EAAE,iBAAiB,EAC3B,oBAAoB,EAAE,SAAS,MAAM,EAAE,GACtC,UAAU,EAAE,CA4Jd"}
|
package/script/lock/check.js
CHANGED
|
@@ -7,20 +7,32 @@
|
|
|
7
7
|
* category. Pure function — no I/O.
|
|
8
8
|
*
|
|
9
9
|
* Drift categories:
|
|
10
|
-
* - MSL-L202 — upstream in resolved but missing from lockfile
|
|
11
|
-
*
|
|
10
|
+
* - MSL-L202 — upstream in resolved but missing from lockfile (also:
|
|
11
|
+
* a declared reference with no lockfile registry row)
|
|
12
|
+
* - MSL-L203 — upstream in lockfile but missing from resolved (also:
|
|
13
|
+
* a locked registry row no longer declared in project.yaml)
|
|
12
14
|
* - MSL-L210 — hash mismatch (same identity, different bytes)
|
|
13
15
|
* - MSL-L211 — profile resolved-version drift (npm range now resolves a different exact version)
|
|
14
16
|
* - MSL-L212 — canonical edge hash drift (traceability graph changed)
|
|
17
|
+
*
|
|
18
|
+
* Federated registry rows (org `references:`) are checked by pure
|
|
19
|
+
* id-presence against `declaredReferenceIds` — no hash comparison.
|
|
20
|
+
* Content integrity for those rows is the offline cache gate (a later
|
|
21
|
+
* task), not this online-vs-lockfile comparison.
|
|
15
22
|
*/
|
|
16
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
24
|
exports.checkDrift = checkDrift;
|
|
25
|
+
const edge_drift_js_1 = require("./edge_drift.js");
|
|
18
26
|
/**
|
|
19
27
|
* Compare locked vs resolved upstreams; return one diagnostic per drift
|
|
20
28
|
* case. An empty result means the lockfile is in sync with the current
|
|
21
29
|
* project state.
|
|
30
|
+
*
|
|
31
|
+
* @param declaredReferenceIds - Upstream ids derived from
|
|
32
|
+
* `config.references` (via `deriveUpstreamId`) — the id-presence
|
|
33
|
+
* comparison set for federated registry rows.
|
|
22
34
|
*/
|
|
23
|
-
function checkDrift(locked, resolved) {
|
|
35
|
+
function checkDrift(locked, resolved, declaredReferenceIds) {
|
|
24
36
|
const diags = [];
|
|
25
37
|
// -------------------------------------------------------------------------
|
|
26
38
|
// References — match by slug.
|
|
@@ -116,13 +128,40 @@ function checkDrift(locked, resolved) {
|
|
|
116
128
|
}
|
|
117
129
|
}
|
|
118
130
|
// -------------------------------------------------------------------------
|
|
131
|
+
// Federated registries — pure id-presence against declared references.
|
|
132
|
+
// No hash comparison: content integrity is the offline cache gate.
|
|
133
|
+
// -------------------------------------------------------------------------
|
|
134
|
+
const lockedRegistries = locked.upstreams.filter((u) => u.kind === "registry");
|
|
135
|
+
const lockedRegistryIds = new Set(lockedRegistries.map((r) => r.id));
|
|
136
|
+
for (const id of declaredReferenceIds) {
|
|
137
|
+
if (!lockedRegistryIds.has(id)) {
|
|
138
|
+
diags.push({
|
|
139
|
+
code: "MSL-L202",
|
|
140
|
+
severity: "error",
|
|
141
|
+
message: `declared reference '${id}' has no lockfile row — run 'markspec lock'`,
|
|
142
|
+
location: undefined,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
const declaredRegistryIds = new Set(declaredReferenceIds);
|
|
147
|
+
for (const row of lockedRegistries) {
|
|
148
|
+
if (!declaredRegistryIds.has(row.id)) {
|
|
149
|
+
diags.push({
|
|
150
|
+
code: "MSL-L203",
|
|
151
|
+
severity: "error",
|
|
152
|
+
message: `locked reference '${row.id}' is no longer declared in project.yaml — run 'markspec lock'`,
|
|
153
|
+
location: undefined,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
// -------------------------------------------------------------------------
|
|
119
158
|
// Canonical edge hash — single comparison, MSL-L212 on mismatch.
|
|
120
159
|
// -------------------------------------------------------------------------
|
|
121
160
|
if (locked.generatedCache.edgesHash !== resolved.canonicalEdgeHash) {
|
|
122
161
|
diags.push({
|
|
123
162
|
code: "MSL-L212",
|
|
124
163
|
severity: "error",
|
|
125
|
-
message:
|
|
164
|
+
message: (0, edge_drift_js_1.formatEdgeDriftMessage)(locked.generatedCache.edgesCount, resolved.canonicalEdgeCount),
|
|
126
165
|
location: undefined,
|
|
127
166
|
});
|
|
128
167
|
}
|
|
@@ -18,6 +18,8 @@ export interface OfflineEdgeDrift {
|
|
|
18
18
|
/** Edge count in the current project graph. */
|
|
19
19
|
readonly currentCount: number;
|
|
20
20
|
}
|
|
21
|
+
/** Build the actionable edge-drift message shared by CLI and core checks. */
|
|
22
|
+
export declare function formatEdgeDriftMessage(lockedCount: number, currentCount: number): string;
|
|
21
23
|
/**
|
|
22
24
|
* Compare the current project graph's canonical edge hash against a
|
|
23
25
|
* lockfile's generated-cache. Offline by design — no upstream resolution.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge_drift.d.ts","sourceRoot":"","sources":["../../src/lock/edge_drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,SAAS,KAAK,EAAE,EAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
1
|
+
{"version":3,"file":"edge_drift.d.ts","sourceRoot":"","sources":["../../src/lock/edge_drift.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAIjD,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,+CAA+C;IAC/C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,6EAA6E;AAC7E,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,GACnB,MAAM,CAER;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC1C,cAAc,EAAE,SAAS,KAAK,EAAE,EAChC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAQ3B"}
|
|
@@ -9,9 +9,14 @@
|
|
|
9
9
|
* can never disagree on what "drift" means.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.formatEdgeDriftMessage = formatEdgeDriftMessage;
|
|
12
13
|
exports.detectOfflineEdgeDrift = detectOfflineEdgeDrift;
|
|
13
14
|
const resolve_js_1 = require("./resolve.js");
|
|
14
15
|
const canonical_edges_js_1 = require("./canonical_edges.js");
|
|
16
|
+
/** Build the actionable edge-drift message shared by CLI and core checks. */
|
|
17
|
+
function formatEdgeDriftMessage(lockedCount, currentCount) {
|
|
18
|
+
return `traceability edges drifted from markspec.lock: locked ${lockedCount} edge(s), current ${currentCount} — run \`markspec lock\` to refresh. (After upgrading MarkSpec this can also fire once because traceability inputs now include source-file doc comments; re-running \`markspec lock\` clears it.)`;
|
|
19
|
+
}
|
|
15
20
|
/**
|
|
16
21
|
* Compare the current project graph's canonical edge hash against a
|
|
17
22
|
* lockfile's generated-cache. Offline by design — no upstream resolution.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/git_intent
|
|
3
|
+
*
|
|
4
|
+
* Pure git-intent resolution for federated dependencies (design §4.3).
|
|
5
|
+
* Parses `git ls-remote --symref` output into a {@linkcode RefList} and
|
|
6
|
+
* resolves a declared version intent (`auto` | `<tag>` | `<branch>` |
|
|
7
|
+
* `<sha>`) to an exact commit + a resolution-kind label. No I/O — the CLI
|
|
8
|
+
* runs git and hands the raw stdout in; unit tests feed fixture strings.
|
|
9
|
+
*/
|
|
10
|
+
export interface GitRef {
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly kind: "tag" | "branch";
|
|
13
|
+
readonly sha: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RefList {
|
|
16
|
+
readonly refs: readonly GitRef[];
|
|
17
|
+
readonly headSha?: string;
|
|
18
|
+
readonly defaultBranch?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface ResolvedIntent {
|
|
21
|
+
readonly sha: string;
|
|
22
|
+
readonly resolved: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Parse `git ls-remote --symref <url>` output. Peeled annotated-tag lines
|
|
26
|
+
* (`refs/tags/x^{}`) override the tag-object sha with the underlying commit
|
|
27
|
+
* — that commit is what a checkout resolves to and what we pin.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseLsRemote(stdout: string): RefList;
|
|
30
|
+
/**
|
|
31
|
+
* Resolve a declared intent to an exact `{ sha, resolved }`.
|
|
32
|
+
*
|
|
33
|
+
* - `auto` → highest valid-semver tag (leading `v` tolerated); if none, the
|
|
34
|
+
* default-branch head.
|
|
35
|
+
* - a name matching a tag → `tag:<name>` (tag wins if a branch shares the name).
|
|
36
|
+
* - a name matching a branch → `branch:<name>`.
|
|
37
|
+
* - a 40-hex string (any case) → normalized to lowercase → `sha:<sha>` (the
|
|
38
|
+
* acquire step validates it). Lowercasing keeps the pin byte-identical
|
|
39
|
+
* regardless of the case a developer typed, so two lockfiles never differ
|
|
40
|
+
* on sha case alone.
|
|
41
|
+
* - otherwise → `{ error }`.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveIntent(intent: string, refs: RefList): ResolvedIntent | {
|
|
44
|
+
error: string;
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=git_intent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git_intent.d.ts","sourceRoot":"","sources":["../../src/lock/git_intent.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,KAAK,GAAG,QAAQ,CAAC;IAChC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAQD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CA0CrD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,OAAO,GACZ,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAiCpC"}
|