@driftsys/markspec 0.10.2 → 0.11.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 +2 -2
- 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 +16 -7
- package/esm/config/markspec.d.ts +38 -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 +20 -0
- package/esm/decl/mod.d.ts.map +1 -0
- package/esm/decl/mod.js +15 -0
- package/esm/decl/resolve.d.ts +104 -0
- package/esm/decl/resolve.d.ts.map +1 -0
- package/esm/decl/resolve.js +66 -0
- package/esm/decl/surfaces.d.ts +118 -0
- package/esm/decl/surfaces.d.ts.map +1 -0
- package/esm/decl/surfaces.js +135 -0
- package/esm/decl/table.d.ts +50 -0
- package/esm/decl/table.d.ts.map +1 -0
- package/esm/decl/table.js +124 -0
- package/esm/gates/mod.d.ts +13 -2
- package/esm/gates/mod.d.ts.map +1 -1
- package/esm/gates/mod.js +38 -11
- package/esm/lint/runner.d.ts.map +1 -1
- package/esm/lint/runner.js +3 -1
- 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 +41 -3
- 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 +10 -3
- package/esm/lock/mod.d.ts.map +1 -1
- package/esm/lock/mod.js +7 -1
- 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 +16 -8
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +15 -5
- package/esm/model/mod.d.ts +93 -28
- package/esm/model/mod.d.ts.map +1 -1
- package/esm/model/mod.js +66 -13
- package/esm/model/profile.d.ts +13 -0
- package/esm/model/profile.d.ts.map +1 -1
- package/esm/parser/directives.d.ts +6 -0
- package/esm/parser/directives.d.ts.map +1 -1
- package/esm/parser/directives.js +17 -0
- package/esm/parser/markdown.d.ts.map +1 -1
- package/esm/parser/markdown.js +16 -51
- 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/reporter/mod.d.ts +11 -0
- package/esm/reporter/mod.d.ts.map +1 -1
- package/esm/reporter/mod.js +19 -8
- 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 +16 -24
- package/esm/typl/bullet.d.ts.map +1 -1
- package/esm/typl/bullet.js +9 -41
- 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/fence.d.ts +12 -21
- package/esm/typl/fence.d.ts.map +1 -1
- package/esm/typl/fence.js +5 -20
- package/esm/typl/grammar.d.ts.map +1 -1
- package/esm/typl/grammar.js +6 -0
- package/esm/typl/inline.d.ts +15 -24
- package/esm/typl/inline.d.ts.map +1 -1
- package/esm/typl/inline.js +6 -44
- 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.d.ts +14 -0
- package/esm/typl/recognize.d.ts.map +1 -0
- package/esm/typl/recognize.js +19 -0
- 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/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.map +1 -1
- package/esm/validator/body_blocks.js +3 -9
- 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.map +1 -1
- package/esm/validator/corpus.js +40 -17
- 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.map +1 -1
- package/esm/validator/mod.js +28 -15
- package/esm/validator/pipeline.d.ts +11 -1
- package/esm/validator/pipeline.d.ts.map +1 -1
- package/esm/validator/pipeline.js +68 -18
- 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/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 +15 -6
- package/script/config/markspec.d.ts +38 -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 +20 -0
- package/script/decl/mod.d.ts.map +1 -0
- package/script/decl/mod.js +26 -0
- package/script/decl/resolve.d.ts +104 -0
- package/script/decl/resolve.d.ts.map +1 -0
- package/script/decl/resolve.js +70 -0
- package/script/decl/surfaces.d.ts +118 -0
- package/script/decl/surfaces.d.ts.map +1 -0
- package/script/decl/surfaces.js +141 -0
- package/script/decl/table.d.ts +50 -0
- package/script/decl/table.d.ts.map +1 -0
- package/script/decl/table.js +127 -0
- package/script/gates/mod.d.ts +13 -2
- package/script/gates/mod.d.ts.map +1 -1
- package/script/gates/mod.js +37 -10
- package/script/lint/runner.d.ts.map +1 -1
- package/script/lint/runner.js +3 -1
- 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 +41 -3
- 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 +10 -3
- package/script/lock/mod.d.ts.map +1 -1
- package/script/lock/mod.js +16 -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 +16 -8
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +40 -7
- package/script/model/mod.d.ts +93 -28
- package/script/model/mod.d.ts.map +1 -1
- package/script/model/mod.js +70 -14
- package/script/model/profile.d.ts +13 -0
- package/script/model/profile.d.ts.map +1 -1
- package/script/parser/directives.d.ts +6 -0
- package/script/parser/directives.d.ts.map +1 -1
- package/script/parser/directives.js +18 -0
- package/script/parser/markdown.d.ts.map +1 -1
- package/script/parser/markdown.js +15 -50
- 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/reporter/mod.d.ts +11 -0
- package/script/reporter/mod.d.ts.map +1 -1
- package/script/reporter/mod.js +18 -7
- 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 +16 -24
- package/script/typl/bullet.d.ts.map +1 -1
- package/script/typl/bullet.js +10 -42
- 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/fence.d.ts +12 -21
- package/script/typl/fence.d.ts.map +1 -1
- package/script/typl/fence.js +5 -20
- package/script/typl/grammar.d.ts.map +1 -1
- package/script/typl/grammar.js +6 -0
- package/script/typl/inline.d.ts +15 -24
- package/script/typl/inline.d.ts.map +1 -1
- package/script/typl/inline.js +6 -44
- 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.d.ts +14 -0
- package/script/typl/recognize.d.ts.map +1 -0
- package/script/typl/recognize.js +22 -0
- 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/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.map +1 -1
- package/script/validator/body_blocks.js +3 -9
- 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.map +1 -1
- package/script/validator/corpus.js +39 -16
- 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.map +1 -1
- package/script/validator/mod.js +27 -14
- package/script/validator/pipeline.d.ts +11 -1
- package/script/validator/pipeline.d.ts.map +1 -1
- package/script/validator/pipeline.js +67 -17
- 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/lock/mod.js
CHANGED
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
* for both `markspec lock` and `markspec compile --frozen`.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.resolveIntent = exports.parseLsRemote = exports.compileAcquiredTree = exports.resolveProjectDependencies = exports.upstreamCacheRoot = exports.resolveProjectReferences = exports.deriveUpstreamId = exports.resolveUpstreams = exports.resolveReferences = exports.resolveProfileChain = exports.resolveBoundEntries = exports.extractEdgeQuads = exports.extractEdgeLedger = exports.verifyUpstreamCache = exports.detectOfflineEdgeDrift = exports.hashCanonicalEdges = exports.canonicalEdgeJson = exports.sha256String = exports.sha256Bytes = exports.checkDrift = exports.isBelowFloor = exports.dependencyPinAssurance = exports.parseLockfile = exports.serializeLockfile = exports.LOCKFILE_SCHEMA_VERSION = void 0;
|
|
11
11
|
var model_js_1 = require("./model.js");
|
|
12
12
|
Object.defineProperty(exports, "LOCKFILE_SCHEMA_VERSION", { enumerable: true, get: function () { return model_js_1.LOCKFILE_SCHEMA_VERSION; } });
|
|
13
13
|
var serializer_js_1 = require("./serializer.js");
|
|
14
14
|
Object.defineProperty(exports, "serializeLockfile", { enumerable: true, get: function () { return serializer_js_1.serializeLockfile; } });
|
|
15
15
|
var parser_js_1 = require("./parser.js");
|
|
16
16
|
Object.defineProperty(exports, "parseLockfile", { enumerable: true, get: function () { return parser_js_1.parseLockfile; } });
|
|
17
|
+
var pin_assurance_js_1 = require("./pin_assurance.js");
|
|
18
|
+
Object.defineProperty(exports, "dependencyPinAssurance", { enumerable: true, get: function () { return pin_assurance_js_1.dependencyPinAssurance; } });
|
|
17
19
|
var compare_js_1 = require("./compare.js");
|
|
18
20
|
Object.defineProperty(exports, "isBelowFloor", { enumerable: true, get: function () { return compare_js_1.isBelowFloor; } });
|
|
19
21
|
var check_js_1 = require("./check.js");
|
|
@@ -26,11 +28,23 @@ Object.defineProperty(exports, "canonicalEdgeJson", { enumerable: true, get: fun
|
|
|
26
28
|
Object.defineProperty(exports, "hashCanonicalEdges", { enumerable: true, get: function () { return canonical_edges_js_1.hashCanonicalEdges; } });
|
|
27
29
|
var edge_drift_js_1 = require("./edge_drift.js");
|
|
28
30
|
Object.defineProperty(exports, "detectOfflineEdgeDrift", { enumerable: true, get: function () { return edge_drift_js_1.detectOfflineEdgeDrift; } });
|
|
31
|
+
var cache_check_js_1 = require("./cache_check.js");
|
|
32
|
+
Object.defineProperty(exports, "verifyUpstreamCache", { enumerable: true, get: function () { return cache_check_js_1.verifyUpstreamCache; } });
|
|
29
33
|
var resolve_js_1 = require("./resolve.js");
|
|
30
34
|
Object.defineProperty(exports, "extractEdgeLedger", { enumerable: true, get: function () { return resolve_js_1.extractEdgeLedger; } });
|
|
31
35
|
Object.defineProperty(exports, "extractEdgeQuads", { enumerable: true, get: function () { return resolve_js_1.extractEdgeQuads; } });
|
|
32
36
|
Object.defineProperty(exports, "resolveBoundEntries", { enumerable: true, get: function () { return resolve_js_1.resolveBoundEntries; } });
|
|
33
37
|
Object.defineProperty(exports, "resolveProfileChain", { enumerable: true, get: function () { return resolve_js_1.resolveProfileChain; } });
|
|
34
38
|
Object.defineProperty(exports, "resolveReferences", { enumerable: true, get: function () { return resolve_js_1.resolveReferences; } });
|
|
35
|
-
Object.defineProperty(exports, "resolveRegistries", { enumerable: true, get: function () { return resolve_js_1.resolveRegistries; } });
|
|
36
39
|
Object.defineProperty(exports, "resolveUpstreams", { enumerable: true, get: function () { return resolve_js_1.resolveUpstreams; } });
|
|
40
|
+
var upstream_refs_js_1 = require("./upstream_refs.js");
|
|
41
|
+
Object.defineProperty(exports, "deriveUpstreamId", { enumerable: true, get: function () { return upstream_refs_js_1.deriveUpstreamId; } });
|
|
42
|
+
Object.defineProperty(exports, "resolveProjectReferences", { enumerable: true, get: function () { return upstream_refs_js_1.resolveProjectReferences; } });
|
|
43
|
+
Object.defineProperty(exports, "upstreamCacheRoot", { enumerable: true, get: function () { return upstream_refs_js_1.upstreamCacheRoot; } });
|
|
44
|
+
var upstream_deps_js_1 = require("./upstream_deps.js");
|
|
45
|
+
Object.defineProperty(exports, "resolveProjectDependencies", { enumerable: true, get: function () { return upstream_deps_js_1.resolveProjectDependencies; } });
|
|
46
|
+
var acquire_compile_js_1 = require("./acquire_compile.js");
|
|
47
|
+
Object.defineProperty(exports, "compileAcquiredTree", { enumerable: true, get: function () { return acquire_compile_js_1.compileAcquiredTree; } });
|
|
48
|
+
var git_intent_js_1 = require("./git_intent.js");
|
|
49
|
+
Object.defineProperty(exports, "parseLsRemote", { enumerable: true, get: function () { return git_intent_js_1.parseLsRemote; } });
|
|
50
|
+
Object.defineProperty(exports, "resolveIntent", { enumerable: true, get: function () { return git_intent_js_1.resolveIntent; } });
|
package/script/lock/model.d.ts
CHANGED
|
@@ -39,9 +39,32 @@ export interface UpstreamRegistry {
|
|
|
39
39
|
readonly api: string;
|
|
40
40
|
readonly resolvedManifestHash: string;
|
|
41
41
|
readonly markspecSchema: number;
|
|
42
|
+
/** Upstream project.version, when published. */
|
|
43
|
+
readonly version?: string;
|
|
44
|
+
/** sha256 of the entries data-file bytes. */
|
|
45
|
+
readonly snapshot?: string;
|
|
46
|
+
/** RFC3339 — when this pin was created/moved. */
|
|
47
|
+
readonly lockedAt?: string;
|
|
48
|
+
}
|
|
49
|
+
/** A resolved federated git-repository upstream dependency. */
|
|
50
|
+
export interface UpstreamDependency {
|
|
51
|
+
readonly kind: "dependency";
|
|
52
|
+
readonly id: string;
|
|
53
|
+
/** Git repository URL (remote or local path). */
|
|
54
|
+
readonly url: string;
|
|
55
|
+
/** `"auto"` | `<tag>` | `<branch>` — the requested resolution intent. */
|
|
56
|
+
readonly intent: string;
|
|
57
|
+
/** `"tag:<t>"` | `"branch:<b>"` | `"sha:<s>"` — what actually resolved. */
|
|
58
|
+
readonly resolved: string;
|
|
59
|
+
/** Exact resolved commit. */
|
|
60
|
+
readonly sha: string;
|
|
61
|
+
/** sha256 of the cached entries data file. */
|
|
62
|
+
readonly snapshot: string;
|
|
63
|
+
/** RFC3339 — when this pin was created/moved. */
|
|
64
|
+
readonly lockedAt: string;
|
|
42
65
|
}
|
|
43
66
|
/** Discriminated union of upstream kinds. */
|
|
44
|
-
export type Upstream = UpstreamReference | UpstreamProfile | UpstreamRegistry;
|
|
67
|
+
export type Upstream = UpstreamReference | UpstreamProfile | UpstreamRegistry | UpstreamDependency;
|
|
45
68
|
/** A locked attribute on a binding — attribute name → upstream value hash. */
|
|
46
69
|
export type LockedAttributes = ReadonlyMap<string, string>;
|
|
47
70
|
/** One External-id binding within a bound entry. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/lock/model.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,6DAA6D;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,6EAA6E;IAC7E,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,qEAAqE;IACrE,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,qCAAqC;AACrC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,QAAQ,CAAC,SAAS,EAAE,MAAM,CA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SAAS,CAAC,EAAE,iBAAiB,CAAC;CACxC;AAED,gCAAgC;AAChC,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,SAAS,QAAQ,EAAE,CAAC;IACxC,QAAQ,CAAC,YAAY,EAAE,SAAS,UAAU,EAAE,CAAC;IAC7C,2DAA2D;IAC3D,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,QAAQ,CAAC,cAAc,EAAE,cAAc,CAAC;CACzC;AAED,uCAAuC;AACvC,eAAO,MAAM,uBAAuB,IAAI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/lock/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAIL,KAAK,QAAQ,EAId,MAAM,YAAY,CAAC;AAUpB,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/lock/parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAIL,KAAK,QAAQ,EAId,MAAM,YAAY,CAAC;AAUpB,4CAA4C;AAC5C,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,SAAS,UAAU,EAAE,CAAC;CAC7C;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAmS/D"}
|
package/script/lock/parser.js
CHANGED
|
@@ -135,12 +135,44 @@ function parseLockfile(toml) {
|
|
|
135
135
|
resolvedManifestHash === undefined || markspecSchemaN === undefined) {
|
|
136
136
|
return diag("MSL-L001", `[[upstream.registry]] entry ${i}: missing required field 'id', 'api', 'resolved-manifest-hash', or 'markspec-schema'`);
|
|
137
137
|
}
|
|
138
|
+
const version = reg.version;
|
|
139
|
+
const snapshot = reg.snapshot;
|
|
140
|
+
const lockedAt = reg["locked-at"];
|
|
138
141
|
upstreams.push({
|
|
139
142
|
kind: "registry",
|
|
140
143
|
id,
|
|
141
144
|
api,
|
|
142
145
|
resolvedManifestHash,
|
|
143
146
|
markspecSchema: markspecSchemaN,
|
|
147
|
+
...(version !== undefined ? { version } : {}),
|
|
148
|
+
...(snapshot !== undefined ? { snapshot } : {}),
|
|
149
|
+
...(lockedAt !== undefined ? { lockedAt } : {}),
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
const deps = upstreamRoot.dependency ?? [];
|
|
153
|
+
for (let i = 0; i < deps.length; i++) {
|
|
154
|
+
const dep = deps[i];
|
|
155
|
+
const id = requireString(dep, "id");
|
|
156
|
+
const url = requireString(dep, "url");
|
|
157
|
+
const intent = requireString(dep, "intent");
|
|
158
|
+
const resolved = requireString(dep, "resolved");
|
|
159
|
+
const sha = requireString(dep, "sha");
|
|
160
|
+
const snapshot = requireString(dep, "snapshot");
|
|
161
|
+
const lockedAt = requireString(dep, "locked-at");
|
|
162
|
+
if (id === undefined || url === undefined || intent === undefined ||
|
|
163
|
+
resolved === undefined || sha === undefined ||
|
|
164
|
+
snapshot === undefined || lockedAt === undefined) {
|
|
165
|
+
return diag("MSL-L001", `[[upstream.dependency]] entry ${i}: missing required field 'id', 'url', 'intent', 'resolved', 'sha', 'snapshot', or 'locked-at'`);
|
|
166
|
+
}
|
|
167
|
+
upstreams.push({
|
|
168
|
+
kind: "dependency",
|
|
169
|
+
id,
|
|
170
|
+
url,
|
|
171
|
+
intent,
|
|
172
|
+
resolved,
|
|
173
|
+
sha,
|
|
174
|
+
snapshot,
|
|
175
|
+
lockedAt,
|
|
144
176
|
});
|
|
145
177
|
}
|
|
146
178
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/pin_assurance
|
|
3
|
+
*
|
|
4
|
+
* Release-assurance advisory for federated dependencies (design §4.4). Every
|
|
5
|
+
* `[[upstream.dependency]]` pin that resolved to a branch or bare sha (rather
|
|
6
|
+
* than a tag) is an "unreleased" pin. Below `check --strict` this is a gentle
|
|
7
|
+
* project-level advisory; `check --strict` promotes the warning to an error,
|
|
8
|
+
* making it the release gate — you cannot release against a dependency that
|
|
9
|
+
* never baselined. Pure.
|
|
10
|
+
*/
|
|
11
|
+
import type { Diagnostic } from "../model/mod.js";
|
|
12
|
+
import type { Lockfile } from "./model.js";
|
|
13
|
+
/**
|
|
14
|
+
* Emit one `MSL-L215` warning per `[[upstream.dependency]]` row whose
|
|
15
|
+
* `resolved` value is not a tag pin (`branch:*` or `sha:*`). Returns an
|
|
16
|
+
* empty array for an all-tag lockfile or an undefined lockfile (no
|
|
17
|
+
* `markspec.lock` present).
|
|
18
|
+
*/
|
|
19
|
+
export declare function dependencyPinAssurance(lockfile: Lockfile | undefined): Diagnostic[];
|
|
20
|
+
//# sourceMappingURL=pin_assurance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pin_assurance.d.ts","sourceRoot":"","sources":["../../src/lock/pin_assurance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAC7B,UAAU,EAAE,CAiBd"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/lock/pin_assurance
|
|
4
|
+
*
|
|
5
|
+
* Release-assurance advisory for federated dependencies (design §4.4). Every
|
|
6
|
+
* `[[upstream.dependency]]` pin that resolved to a branch or bare sha (rather
|
|
7
|
+
* than a tag) is an "unreleased" pin. Below `check --strict` this is a gentle
|
|
8
|
+
* project-level advisory; `check --strict` promotes the warning to an error,
|
|
9
|
+
* making it the release gate — you cannot release against a dependency that
|
|
10
|
+
* never baselined. Pure.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.dependencyPinAssurance = dependencyPinAssurance;
|
|
14
|
+
/**
|
|
15
|
+
* Emit one `MSL-L215` warning per `[[upstream.dependency]]` row whose
|
|
16
|
+
* `resolved` value is not a tag pin (`branch:*` or `sha:*`). Returns an
|
|
17
|
+
* empty array for an all-tag lockfile or an undefined lockfile (no
|
|
18
|
+
* `markspec.lock` present).
|
|
19
|
+
*/
|
|
20
|
+
function dependencyPinAssurance(lockfile) {
|
|
21
|
+
if (!lockfile)
|
|
22
|
+
return [];
|
|
23
|
+
const out = [];
|
|
24
|
+
for (const u of lockfile.upstreams) {
|
|
25
|
+
if (u.kind !== "dependency")
|
|
26
|
+
continue;
|
|
27
|
+
if (u.resolved.startsWith("tag:"))
|
|
28
|
+
continue;
|
|
29
|
+
out.push({
|
|
30
|
+
code: "MSL-L215",
|
|
31
|
+
severity: "warning",
|
|
32
|
+
message: `dependency '${u.id}' is pinned to an unreleased state (${u.resolved} @ ${u.sha.slice(0, 12)}); release builds (check --strict) require a tagged pin — ask the upstream to cut a tag, then run 'markspec lock --update=${u.id}'`,
|
|
33
|
+
location: undefined,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return out;
|
|
37
|
+
}
|
package/script/lock/resolve.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { Diagnostic, Entry, ProfileChain, ProjectConfig } from "../model/mod.js";
|
|
13
13
|
import type { Mapping } from "../sync/mod.js";
|
|
14
|
-
import type { BoundEntry, LockEdge, UpstreamProfile, UpstreamReference
|
|
14
|
+
import type { BoundEntry, LockEdge, UpstreamProfile, UpstreamReference } from "./model.js";
|
|
15
15
|
import { type EdgeQuad } from "./canonical_edges.js";
|
|
16
16
|
/**
|
|
17
17
|
* Callback to fetch a URL. Returns the bytes on success, or an
|
|
@@ -57,11 +57,6 @@ export interface ResolvedProfile {
|
|
|
57
57
|
readonly upstream: UpstreamProfile;
|
|
58
58
|
readonly diagnostics: readonly Diagnostic[];
|
|
59
59
|
}
|
|
60
|
-
/** A federated registry that resolved. */
|
|
61
|
-
export interface ResolvedRegistry {
|
|
62
|
-
readonly upstream: UpstreamRegistry;
|
|
63
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
64
|
-
}
|
|
65
60
|
/** A bound entry's locked-attribute snapshot. */
|
|
66
61
|
export interface ResolvedBoundEntry {
|
|
67
62
|
readonly boundEntry: BoundEntry;
|
|
@@ -71,7 +66,6 @@ export interface ResolvedBoundEntry {
|
|
|
71
66
|
export interface ResolvedUpstreams {
|
|
72
67
|
readonly references: readonly ResolvedReference[];
|
|
73
68
|
readonly profiles: readonly ResolvedProfile[];
|
|
74
|
-
readonly registries: readonly ResolvedRegistry[];
|
|
75
69
|
readonly boundEntries: readonly ResolvedBoundEntry[];
|
|
76
70
|
/** sha256:* of the canonical edge serialization. */
|
|
77
71
|
readonly canonicalEdgeHash: string;
|
|
@@ -117,11 +111,14 @@ export declare function extractEdgeQuads(entries: readonly Entry[]): EdgeQuad[];
|
|
|
117
111
|
export declare function extractEdgeLedger(entries: readonly Entry[], byDisplayId: ReadonlyMap<string, Entry>, byId: ReadonlyMap<string, Entry>): LockEdge[];
|
|
118
112
|
/**
|
|
119
113
|
* Resolve every upstream the lockfile needs: References, profile chain
|
|
120
|
-
* tiers,
|
|
121
|
-
*
|
|
122
|
-
*
|
|
114
|
+
* tiers, and bound entries. Computes the canonical edge hash from the
|
|
115
|
+
* same entry set. Returns the aggregate `ResolvedUpstreams` payload
|
|
116
|
+
* ready for {@link serializeLockfile}. Federated registry rows (org
|
|
117
|
+
* `references:`) are resolved separately by
|
|
118
|
+
* {@linkcode resolveProjectReferences} in `upstream_refs.ts` — the CLI
|
|
119
|
+
* composes both into the final lockfile's `upstreams` list.
|
|
123
120
|
*
|
|
124
|
-
* The
|
|
121
|
+
* The sub-resolvers run sequentially (not concurrently) because
|
|
125
122
|
* (a) the callbacks they share — `fetchUrl`, `readFile` — may themselves
|
|
126
123
|
* serialize work, and (b) the diagnostics output is easier to reason
|
|
127
124
|
* about with a deterministic order. Wrap inside `Promise.all` only when
|
|
@@ -139,12 +136,6 @@ export declare function resolveUpstreams(opts: ResolveUpstreamsOptions): Promise
|
|
|
139
136
|
* the previous tier's id. The root tier has `extends: undefined`.
|
|
140
137
|
*/
|
|
141
138
|
export declare function resolveProfileChain(chain: ProfileChain | readonly never[], readFile: ReadFile): Promise<ResolvedProfile[]>;
|
|
142
|
-
/**
|
|
143
|
-
* Resolve federated parent registries (and the fallback, when not already
|
|
144
|
-
* listed). Each URL's `<url>/manifest` is fetched; the body is parsed
|
|
145
|
-
* loosely for `markspec-schema` (defaults to 1 on parse failure).
|
|
146
|
-
*/
|
|
147
|
-
export declare function resolveRegistries(config: ProjectConfig, fetchUrl: FetchUrl): Promise<ResolvedRegistry[]>;
|
|
148
139
|
/**
|
|
149
140
|
* Resolve every entry carrying `External-id:` attributes into a
|
|
150
141
|
* `ResolvedBoundEntry`. For each External-id, look up the mapping by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../src/lock/resolve.ts"],"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,EAAE,QAAQ,GACjB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAoD9B;AAMD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,QAAQ,EAAE,CAqBtE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,WAAW,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,EACvC,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,GAC/B,QAAQ,EAAE,CAgBZ;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAwC5B;AAmCD;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,YAAY,GAAG,SAAS,KAAK,EAAE,EACtC,QAAQ,EAAE,QAAQ,GACjB,OAAO,CAAC,eAAe,EAAE,CAAC,CAkC5B;AAMD;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,SAAS,KAAK,EAAE,EACzB,QAAQ,EAAE,SAAS,OAAO,EAAE,GAC3B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAuD/B"}
|
package/script/lock/resolve.js
CHANGED
|
@@ -16,7 +16,6 @@ exports.extractEdgeQuads = extractEdgeQuads;
|
|
|
16
16
|
exports.extractEdgeLedger = extractEdgeLedger;
|
|
17
17
|
exports.resolveUpstreams = resolveUpstreams;
|
|
18
18
|
exports.resolveProfileChain = resolveProfileChain;
|
|
19
|
-
exports.resolveRegistries = resolveRegistries;
|
|
20
19
|
exports.resolveBoundEntries = resolveBoundEntries;
|
|
21
20
|
const mod_js_1 = require("../model/mod.js");
|
|
22
21
|
const locked_attributes_js_1 = require("../sync/locked_attributes.js");
|
|
@@ -179,11 +178,14 @@ function extractEdgeLedger(entries, byDisplayId, byId) {
|
|
|
179
178
|
}
|
|
180
179
|
/**
|
|
181
180
|
* Resolve every upstream the lockfile needs: References, profile chain
|
|
182
|
-
* tiers,
|
|
183
|
-
*
|
|
184
|
-
*
|
|
181
|
+
* tiers, and bound entries. Computes the canonical edge hash from the
|
|
182
|
+
* same entry set. Returns the aggregate `ResolvedUpstreams` payload
|
|
183
|
+
* ready for {@link serializeLockfile}. Federated registry rows (org
|
|
184
|
+
* `references:`) are resolved separately by
|
|
185
|
+
* {@linkcode resolveProjectReferences} in `upstream_refs.ts` — the CLI
|
|
186
|
+
* composes both into the final lockfile's `upstreams` list.
|
|
185
187
|
*
|
|
186
|
-
* The
|
|
188
|
+
* The sub-resolvers run sequentially (not concurrently) because
|
|
187
189
|
* (a) the callbacks they share — `fetchUrl`, `readFile` — may themselves
|
|
188
190
|
* serialize work, and (b) the diagnostics output is easier to reason
|
|
189
191
|
* about with a deterministic order. Wrap inside `Promise.all` only when
|
|
@@ -194,7 +196,6 @@ async function resolveUpstreams(opts) {
|
|
|
194
196
|
const lockedAt = now.toISOString();
|
|
195
197
|
const refResults = await resolveReferences(opts.entries, opts.fetchUrl);
|
|
196
198
|
const profResults = await resolveProfileChain(opts.profileChain, opts.readFile);
|
|
197
|
-
const regResults = await resolveRegistries(opts.config, opts.fetchUrl);
|
|
198
199
|
const boundResults = await resolveBoundEntries(opts.entries, opts.mappings);
|
|
199
200
|
const edges = extractEdgeQuads(opts.entries);
|
|
200
201
|
const canonicalEdgeHash = await (0, canonical_edges_js_1.hashCanonicalEdges)(edges);
|
|
@@ -212,13 +213,11 @@ async function resolveUpstreams(opts) {
|
|
|
212
213
|
const diagnostics = [
|
|
213
214
|
...refResults.flatMap((r) => r.diagnostics),
|
|
214
215
|
...profResults.flatMap((r) => r.diagnostics),
|
|
215
|
-
...regResults.flatMap((r) => r.diagnostics),
|
|
216
216
|
...boundResults.flatMap((r) => r.diagnostics),
|
|
217
217
|
];
|
|
218
218
|
return {
|
|
219
219
|
references: refResults,
|
|
220
220
|
profiles: profResults,
|
|
221
|
-
registries: regResults,
|
|
222
221
|
boundEntries: boundResults,
|
|
223
222
|
canonicalEdgeHash,
|
|
224
223
|
canonicalEdgeCount: edges.length,
|
|
@@ -305,66 +304,6 @@ async function resolveProfileChain(chain, readFile) {
|
|
|
305
304
|
return out;
|
|
306
305
|
}
|
|
307
306
|
// ---------------------------------------------------------------------------
|
|
308
|
-
// Registry resolution (Task 16)
|
|
309
|
-
// ---------------------------------------------------------------------------
|
|
310
|
-
/**
|
|
311
|
-
* Resolve federated parent registries (and the fallback, when not already
|
|
312
|
-
* listed). Each URL's `<url>/manifest` is fetched; the body is parsed
|
|
313
|
-
* loosely for `markspec-schema` (defaults to 1 on parse failure).
|
|
314
|
-
*/
|
|
315
|
-
async function resolveRegistries(config, fetchUrl) {
|
|
316
|
-
const urls = [...config.parents];
|
|
317
|
-
if (config.parentFallback && !urls.includes(config.parentFallback)) {
|
|
318
|
-
urls.push(config.parentFallback);
|
|
319
|
-
}
|
|
320
|
-
const out = [];
|
|
321
|
-
for (const url of urls) {
|
|
322
|
-
const manifestUrl = url.endsWith("/")
|
|
323
|
-
? `${url}manifest`
|
|
324
|
-
: `${url}/manifest`;
|
|
325
|
-
const fetched = await fetchUrl(manifestUrl);
|
|
326
|
-
if (fetched instanceof Uint8Array) {
|
|
327
|
-
const hash = await (0, hash_js_1.sha256Bytes)(fetched);
|
|
328
|
-
let markspecSchema = 1;
|
|
329
|
-
try {
|
|
330
|
-
const parsed = JSON.parse(new TextDecoder().decode(fetched));
|
|
331
|
-
if (typeof parsed["markspec-schema"] === "number") {
|
|
332
|
-
markspecSchema = parsed["markspec-schema"];
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
catch { /* leave default */ }
|
|
336
|
-
out.push({
|
|
337
|
-
upstream: {
|
|
338
|
-
kind: "registry",
|
|
339
|
-
id: `urn:markspec:registry:${url}`,
|
|
340
|
-
api: url,
|
|
341
|
-
resolvedManifestHash: hash,
|
|
342
|
-
markspecSchema,
|
|
343
|
-
},
|
|
344
|
-
diagnostics: [],
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
out.push({
|
|
349
|
-
upstream: {
|
|
350
|
-
kind: "registry",
|
|
351
|
-
id: `urn:markspec:registry:${url}`,
|
|
352
|
-
api: url,
|
|
353
|
-
resolvedManifestHash: "sha256:0",
|
|
354
|
-
markspecSchema: 1,
|
|
355
|
-
},
|
|
356
|
-
diagnostics: [{
|
|
357
|
-
code: "MSL-L101",
|
|
358
|
-
severity: "warning",
|
|
359
|
-
message: `Failed to fetch registry manifest from ${manifestUrl}: ${fetched.error}`,
|
|
360
|
-
location: undefined,
|
|
361
|
-
}],
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
return out;
|
|
366
|
-
}
|
|
367
|
-
// ---------------------------------------------------------------------------
|
|
368
307
|
// Bound-entry resolution (Task 17)
|
|
369
308
|
// ---------------------------------------------------------------------------
|
|
370
309
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/lock/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAEV,QAAQ,
|
|
1
|
+
{"version":3,"file":"serializer.d.ts","sourceRoot":"","sources":["../../src/lock/serializer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAEV,QAAQ,EAKT,MAAM,YAAY,CAAC;AAOpB,8DAA8D;AAC9D,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,QAAQ,GAAG,MAAM,CA+HtD"}
|
|
@@ -69,6 +69,29 @@ function serializeLockfile(lf) {
|
|
|
69
69
|
parts.push(`api = ${tomlString(r.api)}\n`);
|
|
70
70
|
parts.push(`resolved-manifest-hash = ${tomlString(r.resolvedManifestHash)}\n`);
|
|
71
71
|
parts.push(`markspec-schema = ${r.markspecSchema}\n`);
|
|
72
|
+
if (r.version !== undefined) {
|
|
73
|
+
parts.push(`version = ${tomlString(r.version)}\n`);
|
|
74
|
+
}
|
|
75
|
+
if (r.snapshot !== undefined) {
|
|
76
|
+
parts.push(`snapshot = ${tomlString(r.snapshot)}\n`);
|
|
77
|
+
}
|
|
78
|
+
if (r.lockedAt !== undefined) {
|
|
79
|
+
parts.push(`locked-at = ${tomlString(r.lockedAt)}\n`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const deps = lf.upstreams
|
|
83
|
+
.filter((u) => u.kind === "dependency")
|
|
84
|
+
.slice()
|
|
85
|
+
.sort((a, b) => a.id.localeCompare(b.id));
|
|
86
|
+
for (const d of deps) {
|
|
87
|
+
parts.push("\n[[upstream.dependency]]\n");
|
|
88
|
+
parts.push(`id = ${tomlString(d.id)}\n`);
|
|
89
|
+
parts.push(`url = ${tomlString(d.url)}\n`);
|
|
90
|
+
parts.push(`intent = ${tomlString(d.intent)}\n`);
|
|
91
|
+
parts.push(`resolved = ${tomlString(d.resolved)}\n`);
|
|
92
|
+
parts.push(`sha = ${tomlString(d.sha)}\n`);
|
|
93
|
+
parts.push(`snapshot = ${tomlString(d.snapshot)}\n`);
|
|
94
|
+
parts.push(`locked-at = ${tomlString(d.lockedAt)}\n`);
|
|
72
95
|
}
|
|
73
96
|
const bounds = lf.boundEntries.slice().sort((a, b) => a.displayId.localeCompare(b.displayId));
|
|
74
97
|
for (const be of bounds) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/upstream_common
|
|
3
|
+
*
|
|
4
|
+
* Primitives shared by the two lock-mediated upstream acquirers —
|
|
5
|
+
* `upstream_refs.ts` (published `references:` snapshots) and
|
|
6
|
+
* `upstream_deps.ts` (git `dependencies:` trees). Both emit the same
|
|
7
|
+
* MSL-L213 "could not be locked" warning (differing only by the noun) and
|
|
8
|
+
* write a `[path, bytes][]` cache batch with identical error handling, so
|
|
9
|
+
* the primitive lives here once rather than duplicated in each module.
|
|
10
|
+
*/
|
|
11
|
+
import type { Diagnostic } from "../model/mod.js";
|
|
12
|
+
/** The two upstream kinds, used only to word the shared MSL-L213 message. */
|
|
13
|
+
export type UpstreamNoun = "reference" | "dependency";
|
|
14
|
+
/**
|
|
15
|
+
* Warn-and-write diagnostic (design §4.2, decision 1): one upstream could
|
|
16
|
+
* not be locked. Identical shape for both kinds — `noun` selects the word.
|
|
17
|
+
*/
|
|
18
|
+
export declare function upstreamNotLockable(noun: UpstreamNoun, id: string, detail: string): Diagnostic;
|
|
19
|
+
/**
|
|
20
|
+
* Write a batch of `[absolutePath, bytes]` cache files via the injected
|
|
21
|
+
* `writeFile` (which creates parent directories). Returns an MSL-L213
|
|
22
|
+
* warning naming the clean `id` (never the raw path) on the first failure,
|
|
23
|
+
* or `undefined` when every write succeeds. Shared by both acquirers' cache
|
|
24
|
+
* writers so a cache-write-failure message is worded identically.
|
|
25
|
+
*/
|
|
26
|
+
export declare function writeCacheFiles(writes: ReadonlyArray<readonly [string, Uint8Array]>, noun: UpstreamNoun, id: string, writeFile: (path: string, bytes: Uint8Array) => Promise<{
|
|
27
|
+
error?: string;
|
|
28
|
+
}>): Promise<Diagnostic | undefined>;
|
|
29
|
+
//# sourceMappingURL=upstream_common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"upstream_common.d.ts","sourceRoot":"","sources":["../../src/lock/upstream_common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,6EAA6E;AAC7E,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,YAAY,CAAC;AAEtD;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,GACb,UAAU,CAOZ;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,EACpD,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAC1E,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAYjC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module core/lock/upstream_common
|
|
4
|
+
*
|
|
5
|
+
* Primitives shared by the two lock-mediated upstream acquirers —
|
|
6
|
+
* `upstream_refs.ts` (published `references:` snapshots) and
|
|
7
|
+
* `upstream_deps.ts` (git `dependencies:` trees). Both emit the same
|
|
8
|
+
* MSL-L213 "could not be locked" warning (differing only by the noun) and
|
|
9
|
+
* write a `[path, bytes][]` cache batch with identical error handling, so
|
|
10
|
+
* the primitive lives here once rather than duplicated in each module.
|
|
11
|
+
*/
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.upstreamNotLockable = upstreamNotLockable;
|
|
14
|
+
exports.writeCacheFiles = writeCacheFiles;
|
|
15
|
+
/**
|
|
16
|
+
* Warn-and-write diagnostic (design §4.2, decision 1): one upstream could
|
|
17
|
+
* not be locked. Identical shape for both kinds — `noun` selects the word.
|
|
18
|
+
*/
|
|
19
|
+
function upstreamNotLockable(noun, id, detail) {
|
|
20
|
+
return {
|
|
21
|
+
code: "MSL-L213",
|
|
22
|
+
severity: "warning",
|
|
23
|
+
message: `upstream ${noun} '${id}' could not be locked: ${detail}`,
|
|
24
|
+
location: undefined,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Write a batch of `[absolutePath, bytes]` cache files via the injected
|
|
29
|
+
* `writeFile` (which creates parent directories). Returns an MSL-L213
|
|
30
|
+
* warning naming the clean `id` (never the raw path) on the first failure,
|
|
31
|
+
* or `undefined` when every write succeeds. Shared by both acquirers' cache
|
|
32
|
+
* writers so a cache-write-failure message is worded identically.
|
|
33
|
+
*/
|
|
34
|
+
async function writeCacheFiles(writes, noun, id, writeFile) {
|
|
35
|
+
for (const [path, bytes] of writes) {
|
|
36
|
+
const res = await writeFile(path, bytes);
|
|
37
|
+
if (res.error !== undefined) {
|
|
38
|
+
return upstreamNotLockable(noun, id, `cache write of '${path}' failed (${res.error})`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module core/lock/upstream_deps
|
|
3
|
+
*
|
|
4
|
+
* Lock-mediated acquisition of org-manifest `dependencies:` git repositories
|
|
5
|
+
* (design §4.3), the sibling of `upstream_refs.ts`. Unlike a `references:`
|
|
6
|
+
* published site (fetched as ready JSON), a dependency is a git tree we
|
|
7
|
+
* resolve, acquire at one sha, and compile in-process into the same cache
|
|
8
|
+
* layout. Three flows: first-lock (resolve intent → acquire → compile → pin),
|
|
9
|
+
* keep/restore (pin exists → verify cache offline, re-acquire the *pinned* sha
|
|
10
|
+
* only to repopulate), update (`--update` → re-resolve + move the pin).
|
|
11
|
+
*
|
|
12
|
+
* Warn-and-write policy (design §4.2, decision 1): an unreachable dependency
|
|
13
|
+
* yields a warning and the resolvable pins still lock. Pure — git, fs, and
|
|
14
|
+
* temp-dir access flow through {@linkcode UpstreamDepsIO}.
|
|
15
|
+
*/
|
|
16
|
+
import type { Diagnostic, ProjectRef } from "../model/mod.js";
|
|
17
|
+
import type { UpstreamDependency } from "./model.js";
|
|
18
|
+
import type { ReadFile } from "./resolve.js";
|
|
19
|
+
import { type RefList } from "./git_intent.js";
|
|
20
|
+
import type { CompiledSnapshot } from "./acquire_compile.js";
|
|
21
|
+
export interface GitIO {
|
|
22
|
+
lsRemote(url: string): Promise<RefList | {
|
|
23
|
+
error: string;
|
|
24
|
+
}>;
|
|
25
|
+
acquireTree(url: string, sha: string, destDir: string): Promise<{
|
|
26
|
+
error?: string;
|
|
27
|
+
}>;
|
|
28
|
+
}
|
|
29
|
+
export interface UpstreamDepsIO {
|
|
30
|
+
readonly git: GitIO;
|
|
31
|
+
readonly compileTree: (treeRoot: string) => Promise<CompiledSnapshot | {
|
|
32
|
+
error: string;
|
|
33
|
+
}>;
|
|
34
|
+
readonly readFile: ReadFile;
|
|
35
|
+
readonly writeFile: (path: string, bytes: Uint8Array) => Promise<{
|
|
36
|
+
error?: string;
|
|
37
|
+
}>;
|
|
38
|
+
readonly makeTempDir: () => Promise<string>;
|
|
39
|
+
readonly removeDir: (path: string) => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
export interface ResolveProjectDependenciesOptions {
|
|
42
|
+
readonly dependencies: readonly ProjectRef[];
|
|
43
|
+
readonly existing: readonly UpstreamDependency[];
|
|
44
|
+
readonly cacheRoot: string;
|
|
45
|
+
readonly update: boolean | string;
|
|
46
|
+
readonly io: UpstreamDepsIO;
|
|
47
|
+
readonly lockedAt: string;
|
|
48
|
+
/**
|
|
49
|
+
* Upstream ids already claimed by declared `references:` entries. A
|
|
50
|
+
* dependency whose derived id collides with one is skipped with an
|
|
51
|
+
* MSL-L216 warning (warn-and-write) — the reference snapshot owns that
|
|
52
|
+
* cache namespace, and two rows under one id would clobber each other's
|
|
53
|
+
* cache and double-map the corpus. Defaults to empty (no cross-kind
|
|
54
|
+
* dedup) for callers that resolve dependencies in isolation.
|
|
55
|
+
*/
|
|
56
|
+
readonly reservedIds?: ReadonlySet<string>;
|
|
57
|
+
}
|
|
58
|
+
export interface ResolveProjectDependenciesResult {
|
|
59
|
+
readonly dependencies: UpstreamDependency[];
|
|
60
|
+
readonly diagnostics: Diagnostic[];
|
|
61
|
+
}
|
|
62
|
+
export declare function resolveProjectDependencies(opts: ResolveProjectDependenciesOptions): Promise<ResolveProjectDependenciesResult>;
|
|
63
|
+
//# sourceMapp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