@sourcey/catalog-verifier 1.0.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/CHANGELOG.md +3 -0
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/SBOM.cdx.json +177 -0
- package/SECURITY.md +8 -0
- package/SOURCEY-CLOSURE.json +1559 -0
- package/SOURCEY-DISTRIBUTION.json +24 -0
- package/SOURCEY-LICENSE-POLICY.json +5 -0
- package/SOURCEY-TOOLCHAIN.json +8 -0
- package/SUPPORT.md +5 -0
- package/THIRD_PARTY_NOTICES.json +69 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.d.ts +548 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.js +159 -0
- package/dist/contracts/agent-readiness/src/declaration-acquisition.js.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.d.ts +48 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.js +42 -0
- package/dist/contracts/agent-readiness/src/declaration-reference.js.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration.d.ts +1357 -0
- package/dist/contracts/agent-readiness/src/declaration.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/declaration.js +659 -0
- package/dist/contracts/agent-readiness/src/declaration.js.map +1 -0
- package/dist/contracts/agent-readiness/src/evidence.d.ts +146 -0
- package/dist/contracts/agent-readiness/src/evidence.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/evidence.js +154 -0
- package/dist/contracts/agent-readiness/src/evidence.js.map +1 -0
- package/dist/contracts/agent-readiness/src/index.d.ts +6487 -0
- package/dist/contracts/agent-readiness/src/index.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/index.js +1487 -0
- package/dist/contracts/agent-readiness/src/index.js.map +1 -0
- package/dist/contracts/agent-readiness/src/interaction.d.ts +26 -0
- package/dist/contracts/agent-readiness/src/interaction.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/interaction.js +24 -0
- package/dist/contracts/agent-readiness/src/interaction.js.map +1 -0
- package/dist/contracts/agent-readiness/src/method-pack.d.ts +391 -0
- package/dist/contracts/agent-readiness/src/method-pack.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/method-pack.js +181 -0
- package/dist/contracts/agent-readiness/src/method-pack.js.map +1 -0
- package/dist/contracts/agent-readiness/src/shared.d.ts +119 -0
- package/dist/contracts/agent-readiness/src/shared.d.ts.map +1 -0
- package/dist/contracts/agent-readiness/src/shared.js +144 -0
- package/dist/contracts/agent-readiness/src/shared.js.map +1 -0
- package/dist/contracts/api/src/index.d.ts +48463 -0
- package/dist/contracts/api/src/index.d.ts.map +1 -0
- package/dist/contracts/api/src/index.js +1150 -0
- package/dist/contracts/api/src/index.js.map +1 -0
- package/dist/contracts/artifact/src/index.d.ts +1467 -0
- package/dist/contracts/artifact/src/index.d.ts.map +1 -0
- package/dist/contracts/artifact/src/index.js +325 -0
- package/dist/contracts/artifact/src/index.js.map +1 -0
- package/dist/contracts/assets/src/index.d.ts +1397 -0
- package/dist/contracts/assets/src/index.d.ts.map +1 -0
- package/dist/contracts/assets/src/index.js +560 -0
- package/dist/contracts/assets/src/index.js.map +1 -0
- package/dist/contracts/authoring/src/index.d.ts +1084 -0
- package/dist/contracts/authoring/src/index.d.ts.map +1 -0
- package/dist/contracts/authoring/src/index.js +211 -0
- package/dist/contracts/authoring/src/index.js.map +1 -0
- package/dist/contracts/authority/src/index.d.ts +135 -0
- package/dist/contracts/authority/src/index.d.ts.map +1 -0
- package/dist/contracts/authority/src/index.js +130 -0
- package/dist/contracts/authority/src/index.js.map +1 -0
- package/dist/contracts/billing/src/index.d.ts +587 -0
- package/dist/contracts/billing/src/index.d.ts.map +1 -0
- package/dist/contracts/billing/src/index.js +322 -0
- package/dist/contracts/billing/src/index.js.map +1 -0
- package/dist/contracts/catalog-verifier/src/index.d.ts +390 -0
- package/dist/contracts/catalog-verifier/src/index.d.ts.map +1 -0
- package/dist/contracts/catalog-verifier/src/index.js +222 -0
- package/dist/contracts/catalog-verifier/src/index.js.map +1 -0
- package/dist/contracts/commercial-work/src/index.d.ts +835 -0
- package/dist/contracts/commercial-work/src/index.d.ts.map +1 -0
- package/dist/contracts/commercial-work/src/index.js +510 -0
- package/dist/contracts/commercial-work/src/index.js.map +1 -0
- package/dist/contracts/events/src/index.d.ts +700 -0
- package/dist/contracts/events/src/index.d.ts.map +1 -0
- package/dist/contracts/events/src/index.js +553 -0
- package/dist/contracts/events/src/index.js.map +1 -0
- package/dist/contracts/evidence/src/index.d.ts +487 -0
- package/dist/contracts/evidence/src/index.d.ts.map +1 -0
- package/dist/contracts/evidence/src/index.js +342 -0
- package/dist/contracts/evidence/src/index.js.map +1 -0
- package/dist/contracts/feed/src/index.d.ts +159 -0
- package/dist/contracts/feed/src/index.d.ts.map +1 -0
- package/dist/contracts/feed/src/index.js +79 -0
- package/dist/contracts/feed/src/index.js.map +1 -0
- package/dist/contracts/funded-work/src/index.d.ts +64 -0
- package/dist/contracts/funded-work/src/index.d.ts.map +1 -0
- package/dist/contracts/funded-work/src/index.js +67 -0
- package/dist/contracts/funded-work/src/index.js.map +1 -0
- package/dist/contracts/observations/src/index.d.ts +134 -0
- package/dist/contracts/observations/src/index.d.ts.map +1 -0
- package/dist/contracts/observations/src/index.js +112 -0
- package/dist/contracts/observations/src/index.js.map +1 -0
- package/dist/contracts/policies/src/index.d.ts +151 -0
- package/dist/contracts/policies/src/index.d.ts.map +1 -0
- package/dist/contracts/policies/src/index.js +121 -0
- package/dist/contracts/policies/src/index.js.map +1 -0
- package/dist/contracts/publication/src/index.d.ts +4066 -0
- package/dist/contracts/publication/src/index.d.ts.map +1 -0
- package/dist/contracts/publication/src/index.js +535 -0
- package/dist/contracts/publication/src/index.js.map +1 -0
- package/dist/contracts/release/src/index.d.ts +2032 -0
- package/dist/contracts/release/src/index.d.ts.map +1 -0
- package/dist/contracts/release/src/index.js +252 -0
- package/dist/contracts/release/src/index.js.map +1 -0
- package/dist/contracts/revisions/src/index.d.ts +1405 -0
- package/dist/contracts/revisions/src/index.d.ts.map +1 -0
- package/dist/contracts/revisions/src/index.js +493 -0
- package/dist/contracts/revisions/src/index.js.map +1 -0
- package/dist/contracts/routes/src/index.d.ts +103 -0
- package/dist/contracts/routes/src/index.d.ts.map +1 -0
- package/dist/contracts/routes/src/index.js +163 -0
- package/dist/contracts/routes/src/index.js.map +1 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.d.ts +2 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.d.ts.map +1 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.js +56 -0
- package/dist/contracts/routes/src/public-route-allocations.generated.js.map +1 -0
- package/dist/contracts/standards/src/index.d.ts +1482 -0
- package/dist/contracts/standards/src/index.d.ts.map +1 -0
- package/dist/contracts/standards/src/index.js +626 -0
- package/dist/contracts/standards/src/index.js.map +1 -0
- package/dist/contracts/taxonomy/src/index.d.ts +7 -0
- package/dist/contracts/taxonomy/src/index.d.ts.map +1 -0
- package/dist/contracts/taxonomy/src/index.js +25 -0
- package/dist/contracts/taxonomy/src/index.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.d.ts +20 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.js +604 -0
- package/dist/modules/agent-readiness-policy/src/current-policy-metrics.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.d.ts +249 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.js +470 -0
- package/dist/modules/agent-readiness-policy/src/current-policy.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/grading.d.ts +39 -0
- package/dist/modules/agent-readiness-policy/src/grading.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/grading.js +40 -0
- package/dist/modules/agent-readiness-policy/src/grading.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/impact.d.ts +103 -0
- package/dist/modules/agent-readiness-policy/src/impact.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/impact.js +249 -0
- package/dist/modules/agent-readiness-policy/src/impact.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/index.d.ts +811 -0
- package/dist/modules/agent-readiness-policy/src/index.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/index.js +499 -0
- package/dist/modules/agent-readiness-policy/src/index.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.d.ts +12 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.js +65 -0
- package/dist/modules/agent-readiness-policy/src/offer-relations.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.d.ts +4 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.js +59 -0
- package/dist/modules/agent-readiness-policy/src/policy-validation.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.d.ts +3 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.js +12 -0
- package/dist/modules/agent-readiness-policy/src/projection-lineage.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/revision.d.ts +4 -0
- package/dist/modules/agent-readiness-policy/src/revision.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/revision.js +46 -0
- package/dist/modules/agent-readiness-policy/src/revision.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.d.ts +7 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.js +13 -0
- package/dist/modules/agent-readiness-policy/src/standard-mapping.js.map +1 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.d.ts +36 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.d.ts.map +1 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.js +214 -0
- package/dist/modules/agent-readiness-policy/src/surface-selection.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/admission.d.ts +35 -0
- package/dist/modules/agent-readiness-repository/src/admission.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/admission.js +56 -0
- package/dist/modules/agent-readiness-repository/src/admission.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/change.d.ts +62 -0
- package/dist/modules/agent-readiness-repository/src/change.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/change.js +218 -0
- package/dist/modules/agent-readiness-repository/src/change.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.d.ts +29 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.js +126 -0
- package/dist/modules/agent-readiness-repository/src/declaration-blob.js.map +1 -0
- package/dist/modules/agent-readiness-repository/src/index.d.ts +102 -0
- package/dist/modules/agent-readiness-repository/src/index.d.ts.map +1 -0
- package/dist/modules/agent-readiness-repository/src/index.js +208 -0
- package/dist/modules/agent-readiness-repository/src/index.js.map +1 -0
- package/dist/modules/artifact/src/agent-readiness-closure.d.ts +24 -0
- package/dist/modules/artifact/src/agent-readiness-closure.d.ts.map +1 -0
- package/dist/modules/artifact/src/agent-readiness-closure.js +98 -0
- package/dist/modules/artifact/src/agent-readiness-closure.js.map +1 -0
- package/dist/modules/artifact/src/asset-closure.d.ts +12 -0
- package/dist/modules/artifact/src/asset-closure.d.ts.map +1 -0
- package/dist/modules/artifact/src/asset-closure.js +40 -0
- package/dist/modules/artifact/src/asset-closure.js.map +1 -0
- package/dist/modules/artifact/src/authoring-closure.d.ts +4 -0
- package/dist/modules/artifact/src/authoring-closure.d.ts.map +1 -0
- package/dist/modules/artifact/src/authoring-closure.js +19 -0
- package/dist/modules/artifact/src/authoring-closure.js.map +1 -0
- package/dist/modules/artifact/src/index.d.ts +46 -0
- package/dist/modules/artifact/src/index.d.ts.map +1 -0
- package/dist/modules/artifact/src/index.js +563 -0
- package/dist/modules/artifact/src/index.js.map +1 -0
- package/dist/modules/artifact/src/trust-history.d.ts +3 -0
- package/dist/modules/artifact/src/trust-history.d.ts.map +1 -0
- package/dist/modules/artifact/src/trust-history.js +134 -0
- package/dist/modules/artifact/src/trust-history.js.map +1 -0
- package/dist/modules/assets/src/authority-bundle.d.ts +36 -0
- package/dist/modules/assets/src/authority-bundle.d.ts.map +1 -0
- package/dist/modules/assets/src/authority-bundle.js +206 -0
- package/dist/modules/assets/src/authority-bundle.js.map +1 -0
- package/dist/modules/assets/src/delta.d.ts +18 -0
- package/dist/modules/assets/src/delta.d.ts.map +1 -0
- package/dist/modules/assets/src/delta.js +183 -0
- package/dist/modules/assets/src/delta.js.map +1 -0
- package/dist/modules/assets/src/disposition.d.ts +3 -0
- package/dist/modules/assets/src/disposition.d.ts.map +1 -0
- package/dist/modules/assets/src/disposition.js +30 -0
- package/dist/modules/assets/src/disposition.js.map +1 -0
- package/dist/modules/assets/src/index.d.ts +25 -0
- package/dist/modules/assets/src/index.d.ts.map +1 -0
- package/dist/modules/assets/src/index.js +234 -0
- package/dist/modules/assets/src/index.js.map +1 -0
- package/dist/modules/assets/src/ingestion.d.ts +69 -0
- package/dist/modules/assets/src/ingestion.d.ts.map +1 -0
- package/dist/modules/assets/src/ingestion.js +169 -0
- package/dist/modules/assets/src/ingestion.js.map +1 -0
- package/dist/modules/authority/src/index.d.ts +47 -0
- package/dist/modules/authority/src/index.d.ts.map +1 -0
- package/dist/modules/authority/src/index.js +349 -0
- package/dist/modules/authority/src/index.js.map +1 -0
- package/dist/modules/authority-state/src/index.d.ts +43 -0
- package/dist/modules/authority-state/src/index.d.ts.map +1 -0
- package/dist/modules/authority-state/src/index.js +194 -0
- package/dist/modules/authority-state/src/index.js.map +1 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.d.ts +424 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.js +369 -0
- package/dist/modules/catalog-admission/src/admission-conflicts.js.map +1 -0
- package/dist/modules/catalog-admission/src/index.d.ts +248 -0
- package/dist/modules/catalog-admission/src/index.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/index.js +601 -0
- package/dist/modules/catalog-admission/src/index.js.map +1 -0
- package/dist/modules/catalog-admission/src/machine-admission.d.ts +1273 -0
- package/dist/modules/catalog-admission/src/machine-admission.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/machine-admission.js +529 -0
- package/dist/modules/catalog-admission/src/machine-admission.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-assets.d.ts +5 -0
- package/dist/modules/catalog-admission/src/publication-assets.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-assets.js +26 -0
- package/dist/modules/catalog-admission/src/publication-assets.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.d.ts +96 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.js +177 -0
- package/dist/modules/catalog-admission/src/publication-dependencies.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-entities.d.ts +9 -0
- package/dist/modules/catalog-admission/src/publication-entities.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-entities.js +48 -0
- package/dist/modules/catalog-admission/src/publication-entities.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.d.ts +42 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.js +163 -0
- package/dist/modules/catalog-admission/src/publication-recomposition.js.map +1 -0
- package/dist/modules/catalog-admission/src/publication.d.ts +92 -0
- package/dist/modules/catalog-admission/src/publication.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/publication.js +605 -0
- package/dist/modules/catalog-admission/src/publication.js.map +1 -0
- package/dist/modules/catalog-admission/src/submission.d.ts +47 -0
- package/dist/modules/catalog-admission/src/submission.d.ts.map +1 -0
- package/dist/modules/catalog-admission/src/submission.js +289 -0
- package/dist/modules/catalog-admission/src/submission.js.map +1 -0
- package/dist/modules/catalog-authoring-validation/src/index.d.ts +46 -0
- package/dist/modules/catalog-authoring-validation/src/index.d.ts.map +1 -0
- package/dist/modules/catalog-authoring-validation/src/index.js +98 -0
- package/dist/modules/catalog-authoring-validation/src/index.js.map +1 -0
- package/dist/modules/catalog-model/src/index.d.ts +26 -0
- package/dist/modules/catalog-model/src/index.d.ts.map +1 -0
- package/dist/modules/catalog-model/src/index.js +80 -0
- package/dist/modules/catalog-model/src/index.js.map +1 -0
- package/dist/modules/cli/src/index.d.ts +10 -0
- package/dist/modules/cli/src/index.d.ts.map +1 -0
- package/dist/modules/cli/src/index.js +31 -0
- package/dist/modules/cli/src/index.js.map +1 -0
- package/dist/modules/compiler/src/index.d.ts +23 -0
- package/dist/modules/compiler/src/index.d.ts.map +1 -0
- package/dist/modules/compiler/src/index.js +75 -0
- package/dist/modules/compiler/src/index.js.map +1 -0
- package/dist/modules/evidence-operations/src/dependency-versions.d.ts +2 -0
- package/dist/modules/evidence-operations/src/dependency-versions.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/dependency-versions.js +17 -0
- package/dist/modules/evidence-operations/src/dependency-versions.js.map +1 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.d.ts +111 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.js +309 -0
- package/dist/modules/evidence-operations/src/evidence-normalization.js.map +1 -0
- package/dist/modules/evidence-operations/src/proof-graph.d.ts +22 -0
- package/dist/modules/evidence-operations/src/proof-graph.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/proof-graph.js +188 -0
- package/dist/modules/evidence-operations/src/proof-graph.js.map +1 -0
- package/dist/modules/evidence-operations/src/source-authority.d.ts +31 -0
- package/dist/modules/evidence-operations/src/source-authority.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/source-authority.js +60 -0
- package/dist/modules/evidence-operations/src/source-authority.js.map +1 -0
- package/dist/modules/evidence-operations/src/submission-verifier.d.ts +318 -0
- package/dist/modules/evidence-operations/src/submission-verifier.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/submission-verifier.js +392 -0
- package/dist/modules/evidence-operations/src/submission-verifier.js.map +1 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.d.ts +3 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.d.ts.map +1 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.js +7 -0
- package/dist/modules/evidence-operations/src/url-canonicalization.js.map +1 -0
- package/dist/modules/primitives/src/index.d.ts +40 -0
- package/dist/modules/primitives/src/index.d.ts.map +1 -0
- package/dist/modules/primitives/src/index.js +154 -0
- package/dist/modules/primitives/src/index.js.map +1 -0
- package/dist/modules/provenance/src/evidence-bindings.d.ts +10 -0
- package/dist/modules/provenance/src/evidence-bindings.d.ts.map +1 -0
- package/dist/modules/provenance/src/evidence-bindings.js +49 -0
- package/dist/modules/provenance/src/evidence-bindings.js.map +1 -0
- package/dist/modules/provenance/src/evidence-coverage.d.ts +35 -0
- package/dist/modules/provenance/src/evidence-coverage.d.ts.map +1 -0
- package/dist/modules/provenance/src/evidence-coverage.js +131 -0
- package/dist/modules/provenance/src/evidence-coverage.js.map +1 -0
- package/dist/modules/provenance/src/index.d.ts +68 -0
- package/dist/modules/provenance/src/index.d.ts.map +1 -0
- package/dist/modules/provenance/src/index.js +536 -0
- package/dist/modules/provenance/src/index.js.map +1 -0
- package/dist/modules/provenance/src/material-claims.d.ts +381 -0
- package/dist/modules/provenance/src/material-claims.d.ts.map +1 -0
- package/dist/modules/provenance/src/material-claims.js +375 -0
- package/dist/modules/provenance/src/material-claims.js.map +1 -0
- package/dist/modules/provenance/src/prospective-evidence.d.ts +6 -0
- package/dist/modules/provenance/src/prospective-evidence.d.ts.map +1 -0
- package/dist/modules/provenance/src/prospective-evidence.js +61 -0
- package/dist/modules/provenance/src/prospective-evidence.js.map +1 -0
- package/dist/modules/release/src/asset-delta-verifier.d.ts +12 -0
- package/dist/modules/release/src/asset-delta-verifier.d.ts.map +1 -0
- package/dist/modules/release/src/asset-delta-verifier.js +82 -0
- package/dist/modules/release/src/asset-delta-verifier.js.map +1 -0
- package/dist/modules/release/src/changes.d.ts +23 -0
- package/dist/modules/release/src/changes.d.ts.map +1 -0
- package/dist/modules/release/src/changes.js +389 -0
- package/dist/modules/release/src/changes.js.map +1 -0
- package/dist/modules/release/src/identity.d.ts +17 -0
- package/dist/modules/release/src/identity.d.ts.map +1 -0
- package/dist/modules/release/src/identity.js +433 -0
- package/dist/modules/release/src/identity.js.map +1 -0
- package/dist/modules/release/src/inputs.d.ts +89 -0
- package/dist/modules/release/src/inputs.d.ts.map +1 -0
- package/dist/modules/release/src/inputs.js +514 -0
- package/dist/modules/release/src/inputs.js.map +1 -0
- package/dist/modules/release/src/publication-inputs.d.ts +9 -0
- package/dist/modules/release/src/publication-inputs.d.ts.map +1 -0
- package/dist/modules/release/src/publication-inputs.js +67 -0
- package/dist/modules/release/src/publication-inputs.js.map +1 -0
- package/dist/modules/release/src/release-directory-files.d.ts +7 -0
- package/dist/modules/release/src/release-directory-files.d.ts.map +1 -0
- package/dist/modules/release/src/release-directory-files.js +49 -0
- package/dist/modules/release/src/release-directory-files.js.map +1 -0
- package/dist/modules/release/src/release-revision-parser.d.ts +5 -0
- package/dist/modules/release/src/release-revision-parser.d.ts.map +1 -0
- package/dist/modules/release/src/release-revision-parser.js +19 -0
- package/dist/modules/release/src/release-revision-parser.js.map +1 -0
- package/dist/modules/release/src/transition.d.ts +36 -0
- package/dist/modules/release/src/transition.d.ts.map +1 -0
- package/dist/modules/release/src/transition.js +263 -0
- package/dist/modules/release/src/transition.js.map +1 -0
- package/dist/modules/release/src/verification-policies.d.ts +278 -0
- package/dist/modules/release/src/verification-policies.d.ts.map +1 -0
- package/dist/modules/release/src/verification-policies.js +38 -0
- package/dist/modules/release/src/verification-policies.js.map +1 -0
- package/dist/modules/release/src/verification-transitions.d.ts +14 -0
- package/dist/modules/release/src/verification-transitions.d.ts.map +1 -0
- package/dist/modules/release/src/verification-transitions.js +26 -0
- package/dist/modules/release/src/verification-transitions.js.map +1 -0
- package/dist/modules/release/src/verifier.d.ts +41 -0
- package/dist/modules/release/src/verifier.d.ts.map +1 -0
- package/dist/modules/release/src/verifier.js +577 -0
- package/dist/modules/release/src/verifier.js.map +1 -0
- package/dist/modules/standard-adapter-runtime/src/index.d.ts +16 -0
- package/dist/modules/standard-adapter-runtime/src/index.d.ts.map +1 -0
- package/dist/modules/standard-adapter-runtime/src/index.js +43 -0
- package/dist/modules/standard-adapter-runtime/src/index.js.map +1 -0
- package/dist/modules/standard-evidence/src/index.d.ts +33 -0
- package/dist/modules/standard-evidence/src/index.d.ts.map +1 -0
- package/dist/modules/standard-evidence/src/index.js +149 -0
- package/dist/modules/standard-evidence/src/index.js.map +1 -0
- package/dist/packages/catalog-verifier/src/application.d.ts +89 -0
- package/dist/packages/catalog-verifier/src/application.d.ts.map +1 -0
- package/dist/packages/catalog-verifier/src/application.js +363 -0
- package/dist/packages/catalog-verifier/src/application.js.map +1 -0
- package/dist/packages/catalog-verifier/src/index.d.ts +7 -0
- package/dist/packages/catalog-verifier/src/index.d.ts.map +1 -0
- package/dist/packages/catalog-verifier/src/index.js +7 -0
- package/dist/packages/catalog-verifier/src/index.js.map +1 -0
- package/dist/packages/catalog-verifier/src/program.d.ts +4 -0
- package/dist/packages/catalog-verifier/src/program.d.ts.map +1 -0
- package/dist/packages/catalog-verifier/src/program.js +203 -0
- package/dist/packages/catalog-verifier/src/program.js.map +1 -0
- package/package.json +63 -0
- package/sourcey-catalog-verify.js +7 -0
- package/taxonomy.json +29 -0
|
@@ -0,0 +1,605 @@
|
|
|
1
|
+
import { catalogPublicationChangeSetCoreSchema, catalogPublicationChangeSetSchema, catalogPublicationCurrentStateCoreSchema, catalogPublicationCurrentStateSchema, catalogPublicationProposalCoreSchema, catalogPublicationProposalSchema, publicationIngressReceiptCoreSchema, publicationIngressReceiptSchema, publicationPolicyReferenceSchema, } from "../../../contracts/publication/src/index.js";
|
|
2
|
+
import { compileEntity } from "../../catalog-model/src/index.js";
|
|
3
|
+
import { canonicalJson, compareCanonicalStrings, digest, } from "../../primitives/src/index.js";
|
|
4
|
+
import { catalogPublicationAssetBindingKey as assetBindingKey, catalogPublicationAssetBindingMap as assetBindingMap, normalizeCatalogPublicationAssetProposals as normalizeAssetProposals, } from "./publication-assets.js";
|
|
5
|
+
import { CatalogPublicationImpactIndex, dependencyKeysForChanges, orderedUnique, requiredAuthoritiesForChanges, } from "./publication-dependencies.js";
|
|
6
|
+
import { catalogPublicationEntityMap as entityMap, catalogPublicationTargetAuthoring as publicationCandidateState, } from "./publication-entities.js";
|
|
7
|
+
export * from "./publication-dependencies.js";
|
|
8
|
+
export * from "./publication-entities.js";
|
|
9
|
+
export * from "./publication-recomposition.js";
|
|
10
|
+
export function verifyCatalogPublicationCurrentState(input) {
|
|
11
|
+
const state = catalogPublicationCurrentStateSchema.parse(input);
|
|
12
|
+
const targetEntityIds = orderedUnique(state.target_entity_ids);
|
|
13
|
+
const entities = [...entityMap(state.current_entities).values()].sort((left, right) => compareCanonicalStrings(left.entity.entity_id, right.entity.entity_id));
|
|
14
|
+
const assets = [...assetBindingMap(state.current_asset_bindings).values()].sort((left, right) => compareCanonicalStrings(assetBindingKey(left.entity_id, left.role), assetBindingKey(right.entity_id, right.role)));
|
|
15
|
+
if (canonicalJson(state.target_entity_ids) !== canonicalJson(targetEntityIds) ||
|
|
16
|
+
canonicalJson(state.current_entities) !== canonicalJson(entities) ||
|
|
17
|
+
canonicalJson(state.current_asset_bindings) !== canonicalJson(assets) ||
|
|
18
|
+
entities.some(({ entity: { entity_id: entityId } }) => !targetEntityIds.includes(entityId))) {
|
|
19
|
+
throw new Error("Catalog publication current state is not a canonical targeted slice.");
|
|
20
|
+
}
|
|
21
|
+
const { state_digest: stateDigest, ...core } = state;
|
|
22
|
+
if (digest(catalogPublicationCurrentStateCoreSchema.parse(core)) !== stateDigest) {
|
|
23
|
+
throw new Error("Catalog publication current-state digest does not match its canonical input.");
|
|
24
|
+
}
|
|
25
|
+
return state;
|
|
26
|
+
}
|
|
27
|
+
export function buildCatalogPublicationProposal(input) {
|
|
28
|
+
const current = entityMap(input.currentEntities);
|
|
29
|
+
const candidates = [...entityMap(input.candidateEntities).values()].sort((left, right) => compareCanonicalStrings(left.entity.entity_id, right.entity.entity_id));
|
|
30
|
+
const currentAssets = assetBindingMap(input.currentAssetBindings ?? []);
|
|
31
|
+
const candidateAssets = normalizeAssetProposals(input.candidateAssetProposals ?? []);
|
|
32
|
+
const removals = orderedUnique(input.removeEntityIds ?? []);
|
|
33
|
+
const authorityProposals = normalizeAuthorityProposals([
|
|
34
|
+
...(input.authorityProposals ?? []),
|
|
35
|
+
...candidateAssets.map((proposal) => ({
|
|
36
|
+
purpose: "catalog-identity",
|
|
37
|
+
proposal_digest: proposal.proposal_digest,
|
|
38
|
+
})),
|
|
39
|
+
]);
|
|
40
|
+
const candidateIds = new Set(candidates.map(({ entity: { entity_id: entityId } }) => entityId));
|
|
41
|
+
const overlap = removals.filter((entityId) => candidateIds.has(entityId));
|
|
42
|
+
if (overlap.length > 0) {
|
|
43
|
+
throw new Error(`Catalog proposal cannot update and remove the same Entity: ${overlap.join(", ")}.`);
|
|
44
|
+
}
|
|
45
|
+
const assetEntityIds = candidateAssets.map(({ entity_id: entityId }) => entityId);
|
|
46
|
+
const removalAssets = [...currentAssets.values()].filter((binding) => removals.includes(binding.entity_id));
|
|
47
|
+
const removalsWithoutIcon = removals.filter((entityId) => removalAssets.filter((binding) => binding.entity_id === entityId && binding.role === "icon")
|
|
48
|
+
.length !== 1);
|
|
49
|
+
if (removalsWithoutIcon.length > 0) {
|
|
50
|
+
throw new Error(`Removed Catalog Entities require one exact current icon binding: ${removalsWithoutIcon.join(", ")}.`);
|
|
51
|
+
}
|
|
52
|
+
const candidateIconEntityIds = new Set(candidateAssets
|
|
53
|
+
.filter(({ role }) => role === "icon")
|
|
54
|
+
.map(({ entity_id: entityId }) => entityId));
|
|
55
|
+
const addedWithoutIcon = candidates
|
|
56
|
+
.filter(({ entity: { entity_id: entityId } }) => !current.has(entityId))
|
|
57
|
+
.map(({ entity: { entity_id: entityId } }) => entityId)
|
|
58
|
+
.filter((entityId) => !candidateIconEntityIds.has(entityId));
|
|
59
|
+
if (addedWithoutIcon.length > 0) {
|
|
60
|
+
throw new Error(`New Catalog Entities require an admitted icon proposal: ${addedWithoutIcon.join(", ")}.`);
|
|
61
|
+
}
|
|
62
|
+
const assetRemovalOverlap = removals.filter((entityId) => assetEntityIds.includes(entityId));
|
|
63
|
+
if (assetRemovalOverlap.length > 0) {
|
|
64
|
+
throw new Error(`Catalog proposal cannot bind an icon while removing its Entity: ${assetRemovalOverlap.join(", ")}.`);
|
|
65
|
+
}
|
|
66
|
+
for (const proposal of candidateAssets) {
|
|
67
|
+
if (proposal.base_release_id !== input.liveParentReleaseId) {
|
|
68
|
+
throw new Error(`Entity asset proposal ${proposal.proposal_digest} targets another release.`);
|
|
69
|
+
}
|
|
70
|
+
if (!current.has(proposal.entity_id) && !candidateIds.has(proposal.entity_id)) {
|
|
71
|
+
throw new Error(`Entity asset proposal targets unknown Entity ${proposal.entity_id}.`);
|
|
72
|
+
}
|
|
73
|
+
const currentBinding = currentAssets.get(assetBindingKey(proposal.entity_id, proposal.role));
|
|
74
|
+
if ((currentBinding?.binding_event_id ?? null) !== proposal.expected_current_binding_event_id) {
|
|
75
|
+
throw new Error(`Entity asset proposal for ${proposal.entity_id} has a stale current binding.`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const targetIds = orderedUnique([...candidateIds, ...removals, ...assetEntityIds]);
|
|
79
|
+
const core = catalogPublicationProposalCoreSchema.parse({
|
|
80
|
+
live_parent_release_id: input.liveParentReleaseId,
|
|
81
|
+
candidate_entities: candidates,
|
|
82
|
+
candidate_assets: candidateAssets,
|
|
83
|
+
remove_entity_ids: removals,
|
|
84
|
+
expected_current_entities: targetIds.map((entityId) => ({
|
|
85
|
+
entity_id: entityId,
|
|
86
|
+
snapshot_digest: current.has(entityId) ? digest(current.get(entityId)) : null,
|
|
87
|
+
})),
|
|
88
|
+
expected_current_asset_bindings: [
|
|
89
|
+
...candidateAssets.map((proposal) => {
|
|
90
|
+
const currentBinding = currentAssets.get(assetBindingKey(proposal.entity_id, proposal.role));
|
|
91
|
+
return {
|
|
92
|
+
entity_id: proposal.entity_id,
|
|
93
|
+
role: proposal.role,
|
|
94
|
+
binding_event_id: currentBinding?.binding_event_id ?? null,
|
|
95
|
+
binding_digest: currentBinding ? digest(currentBinding) : null,
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
98
|
+
...removalAssets.map((binding) => ({
|
|
99
|
+
entity_id: binding.entity_id,
|
|
100
|
+
role: binding.role,
|
|
101
|
+
binding_event_id: binding.binding_event_id,
|
|
102
|
+
binding_digest: digest(binding),
|
|
103
|
+
})),
|
|
104
|
+
].sort((left, right) => compareCanonicalStrings(assetBindingKey(left.entity_id, left.role), assetBindingKey(right.entity_id, right.role))),
|
|
105
|
+
authority_proposals: authorityProposals,
|
|
106
|
+
target_policies: normalizePolicies(input.targetPolicies),
|
|
107
|
+
target_contract_authority_digest: input.targetContractAuthorityDigest,
|
|
108
|
+
});
|
|
109
|
+
return verifyCatalogPublicationProposal({ ...core, proposal_digest: digest(core) });
|
|
110
|
+
}
|
|
111
|
+
export function verifyCatalogPublicationProposal(input) {
|
|
112
|
+
const proposal = catalogPublicationProposalSchema.parse(input);
|
|
113
|
+
const normalizedCandidates = [...entityMap(proposal.candidate_entities).values()].sort((left, right) => compareCanonicalStrings(left.entity.entity_id, right.entity.entity_id));
|
|
114
|
+
const candidateAssets = normalizeAssetProposals(proposal.candidate_assets);
|
|
115
|
+
const removals = orderedUnique(proposal.remove_entity_ids);
|
|
116
|
+
const expected = [...proposal.expected_current_entities].sort((left, right) => compareCanonicalStrings(left.entity_id, right.entity_id));
|
|
117
|
+
const expectedAssets = [...proposal.expected_current_asset_bindings].sort((left, right) => compareCanonicalStrings(assetBindingKey(left.entity_id, left.role), assetBindingKey(right.entity_id, right.role)));
|
|
118
|
+
const authorityProposals = normalizeAuthorityProposals(proposal.authority_proposals);
|
|
119
|
+
const policies = normalizePolicies(proposal.target_policies);
|
|
120
|
+
if (canonicalJson(proposal.candidate_entities) !== canonicalJson(normalizedCandidates) ||
|
|
121
|
+
canonicalJson(proposal.candidate_assets) !== canonicalJson(candidateAssets) ||
|
|
122
|
+
canonicalJson(proposal.remove_entity_ids) !== canonicalJson(removals) ||
|
|
123
|
+
canonicalJson(proposal.expected_current_entities) !== canonicalJson(expected) ||
|
|
124
|
+
canonicalJson(proposal.expected_current_asset_bindings) !== canonicalJson(expectedAssets) ||
|
|
125
|
+
canonicalJson(proposal.authority_proposals) !== canonicalJson(authorityProposals) ||
|
|
126
|
+
canonicalJson(proposal.target_policies) !== canonicalJson(policies)) {
|
|
127
|
+
throw new Error("Catalog publication proposal collections are not canonically ordered.");
|
|
128
|
+
}
|
|
129
|
+
const candidateIds = normalizedCandidates.map(({ entity: { entity_id: entityId } }) => entityId);
|
|
130
|
+
if (removals.some((entityId) => candidateIds.includes(entityId))) {
|
|
131
|
+
throw new Error("Catalog publication proposal cannot update and remove the same Entity.");
|
|
132
|
+
}
|
|
133
|
+
const assetEntityIds = candidateAssets.map(({ entity_id: entityId }) => entityId);
|
|
134
|
+
if (removals.some((entityId) => assetEntityIds.includes(entityId))) {
|
|
135
|
+
throw new Error("Catalog publication proposal cannot bind an icon while removing its Entity.");
|
|
136
|
+
}
|
|
137
|
+
if (candidateAssets.some((asset) => asset.base_release_id !== proposal.live_parent_release_id)) {
|
|
138
|
+
throw new Error("Catalog publication asset proposal targets another live parent.");
|
|
139
|
+
}
|
|
140
|
+
const targetIds = orderedUnique([...candidateIds, ...removals, ...assetEntityIds]);
|
|
141
|
+
if (canonicalJson(expected.map(({ entity_id: entityId }) => entityId)) !== canonicalJson(targetIds)) {
|
|
142
|
+
throw new Error("Catalog publication proposal must bind every targeted live Entity.");
|
|
143
|
+
}
|
|
144
|
+
const expectedAssetByKey = new Map(expectedAssets.map((binding) => [assetBindingKey(binding.entity_id, binding.role), binding]));
|
|
145
|
+
if (expectedAssetByKey.size !== expectedAssets.length ||
|
|
146
|
+
candidateAssets.some((asset) => {
|
|
147
|
+
const expectedBinding = expectedAssetByKey.get(assetBindingKey(asset.entity_id, asset.role));
|
|
148
|
+
return (!expectedBinding ||
|
|
149
|
+
expectedBinding.binding_event_id !== asset.expected_current_binding_event_id);
|
|
150
|
+
}) ||
|
|
151
|
+
expectedAssets.some((binding) => !candidateIds.includes(binding.entity_id) &&
|
|
152
|
+
!assetEntityIds.includes(binding.entity_id) &&
|
|
153
|
+
!removals.includes(binding.entity_id)) ||
|
|
154
|
+
removals.some((entityId) => expectedAssets.filter((binding) => binding.entity_id === entityId).length !== 1 ||
|
|
155
|
+
expectedAssets.find((binding) => binding.entity_id === entityId)?.binding_event_id === null) ||
|
|
156
|
+
expectedAssetByKey.size !== candidateAssets.length + removals.length) {
|
|
157
|
+
throw new Error("Catalog publication proposal must bind every exact current asset role.");
|
|
158
|
+
}
|
|
159
|
+
const { proposal_digest: proposalDigest, ...proposalCore } = proposal;
|
|
160
|
+
if (digest(catalogPublicationProposalCoreSchema.parse(proposalCore)) !== proposalDigest) {
|
|
161
|
+
throw new Error("Catalog publication proposal digest does not match its canonical input.");
|
|
162
|
+
}
|
|
163
|
+
return proposal;
|
|
164
|
+
}
|
|
165
|
+
export function planCatalogPublication(input) {
|
|
166
|
+
const proposal = buildCatalogPublicationProposal(input);
|
|
167
|
+
return {
|
|
168
|
+
proposal,
|
|
169
|
+
changeSet: deriveCatalogPublicationChangeSet({
|
|
170
|
+
proposal,
|
|
171
|
+
currentEntities: input.currentEntities,
|
|
172
|
+
currentAssetBindings: input.currentAssetBindings ?? [],
|
|
173
|
+
currentPolicies: input.currentPolicies,
|
|
174
|
+
currentContractAuthorityDigest: input.currentContractAuthorityDigest,
|
|
175
|
+
...(input.impactIndex ? { impactIndex: input.impactIndex } : {}),
|
|
176
|
+
}),
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
export function deriveCatalogPublicationChangeSet(input) {
|
|
180
|
+
const proposal = verifyCatalogPublicationProposal(input.proposal);
|
|
181
|
+
const current = entityMap(input.currentEntities);
|
|
182
|
+
const currentAssets = assetBindingMap(input.currentAssetBindings ?? []);
|
|
183
|
+
const expectedIds = new Set(proposal.expected_current_entities.map(({ entity_id }) => entity_id));
|
|
184
|
+
if ([...current.keys()].some((id) => !expectedIds.has(id))) {
|
|
185
|
+
throw new Error("Catalog publication planning received state outside its targeted live slice.");
|
|
186
|
+
}
|
|
187
|
+
for (const expected of proposal.expected_current_entities) {
|
|
188
|
+
const actual = current.get(expected.entity_id);
|
|
189
|
+
const actualDigest = actual ? digest(actual) : null;
|
|
190
|
+
if (actualDigest !== expected.snapshot_digest) {
|
|
191
|
+
throw new Error(`Catalog publication live vendor ${expected.entity_id} has advanced.`);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
const expectedAssetKeys = new Set(proposal.expected_current_asset_bindings.map((binding) => assetBindingKey(binding.entity_id, binding.role)));
|
|
195
|
+
if ([...currentAssets.keys()].some((key) => !expectedAssetKeys.has(key))) {
|
|
196
|
+
throw new Error("Catalog publication planning received asset state outside its targeted slice.");
|
|
197
|
+
}
|
|
198
|
+
for (const expected of proposal.expected_current_asset_bindings) {
|
|
199
|
+
const actual = currentAssets.get(assetBindingKey(expected.entity_id, expected.role));
|
|
200
|
+
if ((actual?.binding_event_id ?? null) !== expected.binding_event_id ||
|
|
201
|
+
(actual ? digest(actual) : null) !== expected.binding_digest) {
|
|
202
|
+
throw new Error(`Catalog publication live asset ${expected.entity_id}:${expected.role} has advanced.`);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const { revisionChanges, sourceChanges, routeChanges, publicAuthoringPaths } = analyzeCatalogCandidateChanges({
|
|
206
|
+
currentEntities: [...current.values()],
|
|
207
|
+
candidateEntities: publicationCandidateState({
|
|
208
|
+
current: [...current.values()],
|
|
209
|
+
candidates: proposal.candidate_entities,
|
|
210
|
+
removals: proposal.remove_entity_ids,
|
|
211
|
+
}),
|
|
212
|
+
});
|
|
213
|
+
const assetChanges = proposal.candidate_assets.map((candidate) => {
|
|
214
|
+
const currentBinding = currentAssets.get(assetBindingKey(candidate.entity_id, candidate.role));
|
|
215
|
+
return {
|
|
216
|
+
change: "upsert",
|
|
217
|
+
entity_id: candidate.entity_id,
|
|
218
|
+
role: candidate.role,
|
|
219
|
+
current_binding_event_id: currentBinding?.binding_event_id ?? null,
|
|
220
|
+
candidate_proposal_digest: candidate.proposal_digest,
|
|
221
|
+
current_asset_object_digest: currentBinding?.asset_object_digest ?? null,
|
|
222
|
+
candidate_asset_object_digest: candidate.asset.asset_object_digest,
|
|
223
|
+
current_served_digest: currentBinding?.served_digest ?? null,
|
|
224
|
+
candidate_served_digest: candidate.served_digest,
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
for (const entityId of proposal.remove_entity_ids) {
|
|
228
|
+
const currentBinding = currentAssets.get(assetBindingKey(entityId, "icon"));
|
|
229
|
+
if (!currentBinding) {
|
|
230
|
+
throw new Error(`Removed Catalog Entity ${entityId} lacks its exact current icon binding.`);
|
|
231
|
+
}
|
|
232
|
+
assetChanges.push({
|
|
233
|
+
change: "remove",
|
|
234
|
+
entity_id: entityId,
|
|
235
|
+
role: "icon",
|
|
236
|
+
current_binding_event_id: currentBinding.binding_event_id,
|
|
237
|
+
current_asset_object_digest: currentBinding.asset_object_digest,
|
|
238
|
+
current_served_digest: currentBinding.served_digest,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const currentPolicies = normalizePolicies(input.currentPolicies);
|
|
242
|
+
const contextChanges = policyChanges(currentPolicies, proposal.target_policies);
|
|
243
|
+
if (input.currentContractAuthorityDigest !== proposal.target_contract_authority_digest) {
|
|
244
|
+
contextChanges.push({
|
|
245
|
+
kind: "contract_authority",
|
|
246
|
+
current_digest: input.currentContractAuthorityDigest,
|
|
247
|
+
target_digest: proposal.target_contract_authority_digest,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
if (revisionChanges.length === 0 &&
|
|
251
|
+
sourceChanges.length === 0 &&
|
|
252
|
+
assetChanges.length === 0 &&
|
|
253
|
+
routeChanges.length === 0 &&
|
|
254
|
+
contextChanges.length === 0 &&
|
|
255
|
+
proposal.authority_proposals.length === 0) {
|
|
256
|
+
throw new Error("Catalog publication proposal has no semantic change against its live parent.");
|
|
257
|
+
}
|
|
258
|
+
const changedDependencyKeys = dependencyKeysForChanges({
|
|
259
|
+
revisionChanges,
|
|
260
|
+
sourceChanges,
|
|
261
|
+
assetChanges,
|
|
262
|
+
routeChanges,
|
|
263
|
+
contextChanges,
|
|
264
|
+
});
|
|
265
|
+
const impactIndex = input.impactIndex ?? new CatalogPublicationImpactIndex();
|
|
266
|
+
const impact = impactIndex.affected(changedDependencyKeys);
|
|
267
|
+
const requiredAuthorities = requiredAuthoritiesForChanges({
|
|
268
|
+
revisionChanges,
|
|
269
|
+
sourceChanges,
|
|
270
|
+
assetChanges,
|
|
271
|
+
routeChanges,
|
|
272
|
+
contextChanges,
|
|
273
|
+
authorityProposals: proposal.authority_proposals,
|
|
274
|
+
});
|
|
275
|
+
const currentContextDigest = digest({
|
|
276
|
+
policies: currentPolicies,
|
|
277
|
+
contract_authority_digest: input.currentContractAuthorityDigest,
|
|
278
|
+
});
|
|
279
|
+
const targetContextDigest = digest({
|
|
280
|
+
policies: proposal.target_policies,
|
|
281
|
+
contract_authority_digest: proposal.target_contract_authority_digest,
|
|
282
|
+
});
|
|
283
|
+
const core = catalogPublicationChangeSetCoreSchema.parse({
|
|
284
|
+
proposal_digest: proposal.proposal_digest,
|
|
285
|
+
live_parent_release_id: proposal.live_parent_release_id,
|
|
286
|
+
current_context_digest: currentContextDigest,
|
|
287
|
+
target_context_digest: targetContextDigest,
|
|
288
|
+
revision_changes: revisionChanges,
|
|
289
|
+
source_changes: sourceChanges,
|
|
290
|
+
asset_changes: assetChanges,
|
|
291
|
+
route_changes: routeChanges,
|
|
292
|
+
context_changes: contextChanges,
|
|
293
|
+
public_authoring_paths: publicAuthoringPaths,
|
|
294
|
+
changed_dependency_keys: changedDependencyKeys,
|
|
295
|
+
impact_index_digest: impactIndex.indexDigest,
|
|
296
|
+
dependency_lookups: impact.lookups,
|
|
297
|
+
affected_dependents: impact.dependents,
|
|
298
|
+
unaffected_dependents_proof_digest: digest({
|
|
299
|
+
impact_index_digest: impactIndex.indexDigest,
|
|
300
|
+
changed_dependency_keys: changedDependencyKeys,
|
|
301
|
+
affected_dependents: impact.dependents,
|
|
302
|
+
}),
|
|
303
|
+
required_authorities: requiredAuthorities,
|
|
304
|
+
});
|
|
305
|
+
return verifyCatalogPublicationChangeSet({ ...core, change_set_digest: digest(core) });
|
|
306
|
+
}
|
|
307
|
+
export function verifyCatalogPublicationChangeSet(input) {
|
|
308
|
+
const changeSet = catalogPublicationChangeSetSchema.parse(input);
|
|
309
|
+
const { change_set_digest: changeSetDigest, ...core } = changeSet;
|
|
310
|
+
if (digest(catalogPublicationChangeSetCoreSchema.parse(core)) !== changeSetDigest) {
|
|
311
|
+
throw new Error("Catalog publication Change Set digest does not match its derived impact.");
|
|
312
|
+
}
|
|
313
|
+
return changeSet;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* The sole semantic diff over targeted Catalog Entity snapshots. Git review,
|
|
317
|
+
* non-Git proposal adapters, evidence planning, and release composition derive
|
|
318
|
+
* their changed revision set from this function.
|
|
319
|
+
*/
|
|
320
|
+
export function analyzeCatalogCandidateChanges(input) {
|
|
321
|
+
const current = entityMap(input.currentEntities);
|
|
322
|
+
const candidates = entityMap(input.candidateEntities);
|
|
323
|
+
const revisionChanges = [];
|
|
324
|
+
const sourceChanges = [];
|
|
325
|
+
const routeChanges = [];
|
|
326
|
+
const publicAuthoringPaths = new Set();
|
|
327
|
+
for (const entityId of orderedUnique([...current.keys(), ...candidates.keys()])) {
|
|
328
|
+
const before = current.get(entityId) ?? null;
|
|
329
|
+
const after = candidates.get(entityId) ?? null;
|
|
330
|
+
let authoringChanged = false;
|
|
331
|
+
const entitySourceChanges = sourceChangesForEntity(entityId, before, after);
|
|
332
|
+
sourceChanges.push(...entitySourceChanges);
|
|
333
|
+
if (entitySourceChanges.length > 0)
|
|
334
|
+
authoringChanged = true;
|
|
335
|
+
const changedEntitySourceIds = new Set(entitySourceChanges.map(({ source_id }) => source_id));
|
|
336
|
+
const beforeEntries = before ? revisionEntries(compileEntity(before)) : new Map();
|
|
337
|
+
const afterEntries = after ? revisionEntries(compileEntity(after)) : new Map();
|
|
338
|
+
for (const entryKey of orderedUnique([...beforeEntries.keys(), ...afterEntries.keys()])) {
|
|
339
|
+
const currentEntry = beforeEntries.get(entryKey) ?? null;
|
|
340
|
+
const candidateEntry = afterEntries.get(entryKey) ?? null;
|
|
341
|
+
const citationChanges = symmetricDifference(currentEntry?.sourceIds ?? [], candidateEntry?.sourceIds ?? []);
|
|
342
|
+
const sourceChangeIds = orderedUnique([
|
|
343
|
+
...citationChanges,
|
|
344
|
+
...[...(currentEntry?.sourceIds ?? []), ...(candidateEntry?.sourceIds ?? [])].filter((sourceId) => changedEntitySourceIds.has(sourceId)),
|
|
345
|
+
]);
|
|
346
|
+
if (currentEntry?.revisionDigest !== candidateEntry?.revisionDigest ||
|
|
347
|
+
sourceChangeIds.length > 0) {
|
|
348
|
+
authoringChanged = true;
|
|
349
|
+
const entry = candidateEntry ?? currentEntry;
|
|
350
|
+
if (!entry)
|
|
351
|
+
throw new Error("Catalog publication revision entry disappeared.");
|
|
352
|
+
revisionChanges.push({
|
|
353
|
+
kind: entry.kind,
|
|
354
|
+
entity_id: entry.entityId,
|
|
355
|
+
target_id: entry.targetId,
|
|
356
|
+
change: currentEntry === null ? "added" : candidateEntry === null ? "removed" : "updated",
|
|
357
|
+
current_revision_digest: currentEntry?.revisionDigest ?? null,
|
|
358
|
+
candidate_revision_digest: candidateEntry?.revisionDigest ?? null,
|
|
359
|
+
semantic_paths: currentEntry && candidateEntry
|
|
360
|
+
? semanticJsonPointerChanges(currentEntry.content, candidateEntry.content)
|
|
361
|
+
: [],
|
|
362
|
+
source_change_ids: sourceChangeIds,
|
|
363
|
+
parent_changed: currentEntry?.parentId !== candidateEntry?.parentId,
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
if (currentEntry?.slug !== candidateEntry?.slug ||
|
|
367
|
+
canonicalJson(currentEntry?.aliases ?? []) !== canonicalJson(candidateEntry?.aliases ?? [])) {
|
|
368
|
+
authoringChanged = true;
|
|
369
|
+
const entry = candidateEntry ?? currentEntry;
|
|
370
|
+
if (!entry)
|
|
371
|
+
throw new Error("Catalog publication route entry disappeared.");
|
|
372
|
+
routeChanges.push({
|
|
373
|
+
kind: entry.kind,
|
|
374
|
+
entity_id: entry.entityId,
|
|
375
|
+
target_id: entry.targetId,
|
|
376
|
+
current_slug: currentEntry?.slug ?? null,
|
|
377
|
+
candidate_slug: candidateEntry?.slug ?? null,
|
|
378
|
+
added_aliases: difference(candidateEntry?.aliases ?? [], currentEntry?.aliases ?? []),
|
|
379
|
+
removed_aliases: difference(currentEntry?.aliases ?? [], candidateEntry?.aliases ?? []),
|
|
380
|
+
});
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
if (authoringChanged) {
|
|
384
|
+
if (before)
|
|
385
|
+
publicAuthoringPaths.add(authoringPath(before.entity.slug));
|
|
386
|
+
if (after)
|
|
387
|
+
publicAuthoringPaths.add(authoringPath(after.entity.slug));
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
return {
|
|
391
|
+
revisionChanges,
|
|
392
|
+
sourceChanges,
|
|
393
|
+
routeChanges,
|
|
394
|
+
publicAuthoringPaths: [...publicAuthoringPaths].sort(compareCanonicalStrings),
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
export function publicationSemanticInputDigest(proposal) {
|
|
398
|
+
const verified = verifyCatalogPublicationProposal(proposal);
|
|
399
|
+
return digest({
|
|
400
|
+
candidate_entities: verified.candidate_entities,
|
|
401
|
+
candidate_assets: verified.candidate_assets,
|
|
402
|
+
remove_entity_ids: verified.remove_entity_ids,
|
|
403
|
+
authority_proposals: verified.authority_proposals,
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
export function buildPublicationIngressReceipt(proposal, input) {
|
|
407
|
+
const core = publicationIngressReceiptCoreSchema.parse({
|
|
408
|
+
...input,
|
|
409
|
+
proposal_digest: proposal.proposal_digest,
|
|
410
|
+
semantic_input_digest: publicationSemanticInputDigest(proposal),
|
|
411
|
+
});
|
|
412
|
+
return verifyPublicationIngressReceipt({ ...core, receipt_digest: digest(core) });
|
|
413
|
+
}
|
|
414
|
+
export function verifyPublicationIngressReceipt(input) {
|
|
415
|
+
const receipt = publicationIngressReceiptSchema.parse(input);
|
|
416
|
+
const { receipt_digest: receiptDigest, ...core } = receipt;
|
|
417
|
+
if (digest(publicationIngressReceiptCoreSchema.parse(core)) !== receiptDigest) {
|
|
418
|
+
throw new Error("Publication ingress receipt digest does not match its immutable input.");
|
|
419
|
+
}
|
|
420
|
+
return receipt;
|
|
421
|
+
}
|
|
422
|
+
export function verifyCatalogPublicationInputClosure(input) {
|
|
423
|
+
const proposal = verifyCatalogPublicationProposal(input.proposal);
|
|
424
|
+
const changeSet = verifyCatalogPublicationChangeSet(input.changeSet);
|
|
425
|
+
const ingressReceipts = input.ingressReceipts
|
|
426
|
+
.map(verifyPublicationIngressReceipt)
|
|
427
|
+
.sort((left, right) => compareCanonicalStrings(left.receipt_digest, right.receipt_digest));
|
|
428
|
+
const semanticInputDigest = publicationSemanticInputDigest(proposal);
|
|
429
|
+
if (ingressReceipts.length === 0 ||
|
|
430
|
+
changeSet.proposal_digest !== proposal.proposal_digest ||
|
|
431
|
+
changeSet.live_parent_release_id !== proposal.live_parent_release_id ||
|
|
432
|
+
ingressReceipts.some((receipt) => receipt.proposal_digest !== proposal.proposal_digest ||
|
|
433
|
+
receipt.semantic_input_digest !== semanticInputDigest)) {
|
|
434
|
+
throw new Error("Catalog publication inputs do not close one proposal and live parent.");
|
|
435
|
+
}
|
|
436
|
+
if (new Set(ingressReceipts.map((receipt) => receipt.receipt_digest)).size !==
|
|
437
|
+
ingressReceipts.length) {
|
|
438
|
+
throw new Error("Catalog publication ingress receipts must be unique.");
|
|
439
|
+
}
|
|
440
|
+
return { proposal, changeSet, ingressReceipts };
|
|
441
|
+
}
|
|
442
|
+
export function catalogPublicationAdmittedInputDigests(input) {
|
|
443
|
+
const verified = verifyCatalogPublicationInputClosure(input);
|
|
444
|
+
return [
|
|
445
|
+
verified.proposal.proposal_digest,
|
|
446
|
+
verified.changeSet.change_set_digest,
|
|
447
|
+
...verified.ingressReceipts.map((receipt) => receipt.receipt_digest),
|
|
448
|
+
].sort(compareCanonicalStrings);
|
|
449
|
+
}
|
|
450
|
+
export function planAuthenticatedFormCatalogPublication(input, receipt) {
|
|
451
|
+
return planCatalogPublicationWithIngress(input, receipt);
|
|
452
|
+
}
|
|
453
|
+
export function planPaidAgentCatalogPublication(input, receipt) {
|
|
454
|
+
return planCatalogPublicationWithIngress(input, receipt);
|
|
455
|
+
}
|
|
456
|
+
export function planGovernedOpsCatalogPublication(input, receipt) {
|
|
457
|
+
return planCatalogPublicationWithIngress(input, receipt);
|
|
458
|
+
}
|
|
459
|
+
export function planScannerCatalogPublication(input, receipt) {
|
|
460
|
+
return planCatalogPublicationWithIngress(input, receipt);
|
|
461
|
+
}
|
|
462
|
+
export function planOperatorJobCatalogPublication(input, receipt) {
|
|
463
|
+
return planCatalogPublicationWithIngress(input, receipt);
|
|
464
|
+
}
|
|
465
|
+
export function planPolicyTransitionCatalogPublication(input, receipt) {
|
|
466
|
+
return planCatalogPublicationWithIngress(input, receipt);
|
|
467
|
+
}
|
|
468
|
+
function planCatalogPublicationWithIngress(input, receipt) {
|
|
469
|
+
const plan = planCatalogPublication(input);
|
|
470
|
+
return {
|
|
471
|
+
...plan,
|
|
472
|
+
ingressReceipt: buildPublicationIngressReceipt(plan.proposal, receipt),
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
function revisionEntries(entity) {
|
|
476
|
+
const values = [
|
|
477
|
+
{
|
|
478
|
+
kind: "entity",
|
|
479
|
+
entityId: entity.revision.entity_id,
|
|
480
|
+
targetId: entity.revision.entity_id,
|
|
481
|
+
revisionDigest: entity.revision.revision_digest,
|
|
482
|
+
content: entity.revision.content,
|
|
483
|
+
parentId: null,
|
|
484
|
+
sourceIds: entity.sources.map(({ source_id: sourceId }) => sourceId),
|
|
485
|
+
slug: entity.slug,
|
|
486
|
+
aliases: entity.slugAliases,
|
|
487
|
+
},
|
|
488
|
+
...entity.programs.map(({ revision, slug, slugAliases, sourceIds }) => ({
|
|
489
|
+
kind: "program",
|
|
490
|
+
entityId: revision.entity_id,
|
|
491
|
+
targetId: revision.program_id,
|
|
492
|
+
revisionDigest: revision.revision_digest,
|
|
493
|
+
content: revision.content,
|
|
494
|
+
parentId: revision.entity_id,
|
|
495
|
+
sourceIds,
|
|
496
|
+
slug,
|
|
497
|
+
aliases: slugAliases,
|
|
498
|
+
})),
|
|
499
|
+
...entity.offers.map(({ revision, slug, slugAliases, sourceIds }) => ({
|
|
500
|
+
kind: "offer",
|
|
501
|
+
entityId: revision.entity_id,
|
|
502
|
+
targetId: revision.offer_id,
|
|
503
|
+
revisionDigest: revision.revision_digest,
|
|
504
|
+
content: revision.content,
|
|
505
|
+
parentId: revision.program_id ?? revision.entity_id,
|
|
506
|
+
sourceIds,
|
|
507
|
+
slug,
|
|
508
|
+
aliases: slugAliases,
|
|
509
|
+
})),
|
|
510
|
+
];
|
|
511
|
+
return new Map(values.map((value) => [`${value.kind}:${value.targetId}`, value]));
|
|
512
|
+
}
|
|
513
|
+
function sourceChangesForEntity(entityId, current, candidate) {
|
|
514
|
+
const before = new Map(current?.sources.map((source) => [source.source_id, source.url]) ?? []);
|
|
515
|
+
const after = new Map(candidate?.sources.map((source) => [source.source_id, source.url]) ?? []);
|
|
516
|
+
return orderedUnique([...before.keys(), ...after.keys()]).flatMap((sourceId) => {
|
|
517
|
+
const currentUrl = before.get(sourceId) ?? null;
|
|
518
|
+
const candidateUrl = after.get(sourceId) ?? null;
|
|
519
|
+
if (currentUrl === candidateUrl)
|
|
520
|
+
return [];
|
|
521
|
+
return [
|
|
522
|
+
{
|
|
523
|
+
entity_id: entityId,
|
|
524
|
+
source_id: sourceId,
|
|
525
|
+
change: currentUrl === null
|
|
526
|
+
? "added"
|
|
527
|
+
: candidateUrl === null
|
|
528
|
+
? "removed"
|
|
529
|
+
: "updated",
|
|
530
|
+
current_url: currentUrl,
|
|
531
|
+
candidate_url: candidateUrl,
|
|
532
|
+
},
|
|
533
|
+
];
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
function semanticJsonPointerChanges(current, candidate, path = "") {
|
|
537
|
+
if (canonicalJson(current) === canonicalJson(candidate))
|
|
538
|
+
return [];
|
|
539
|
+
if (Array.isArray(current) || Array.isArray(candidate))
|
|
540
|
+
return [path];
|
|
541
|
+
if (isRecord(current) && isRecord(candidate)) {
|
|
542
|
+
return orderedUnique([...Object.keys(current), ...Object.keys(candidate)]).flatMap((key) => {
|
|
543
|
+
const childPath = `${path}/${escapePointerSegment(key)}`;
|
|
544
|
+
if (!(key in current) || !(key in candidate))
|
|
545
|
+
return [childPath];
|
|
546
|
+
return semanticJsonPointerChanges(current[key], candidate[key], childPath);
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
return [path];
|
|
550
|
+
}
|
|
551
|
+
function policyChanges(current, target) {
|
|
552
|
+
const before = new Map(current.map(({ key, digest: value }) => [key, value]));
|
|
553
|
+
const after = new Map(target.map(({ key, digest: value }) => [key, value]));
|
|
554
|
+
return orderedUnique([...before.keys(), ...after.keys()]).flatMap((key) => {
|
|
555
|
+
const currentDigest = before.get(key) ?? null;
|
|
556
|
+
const targetDigest = after.get(key) ?? null;
|
|
557
|
+
return currentDigest === targetDigest
|
|
558
|
+
? []
|
|
559
|
+
: [
|
|
560
|
+
{
|
|
561
|
+
kind: "policy",
|
|
562
|
+
key,
|
|
563
|
+
current_digest: currentDigest,
|
|
564
|
+
target_digest: targetDigest,
|
|
565
|
+
},
|
|
566
|
+
];
|
|
567
|
+
});
|
|
568
|
+
}
|
|
569
|
+
function normalizeAuthorityProposals(proposals) {
|
|
570
|
+
const normalized = proposals
|
|
571
|
+
.map((proposal) => ({ ...proposal }))
|
|
572
|
+
.sort((left, right) => compareCanonicalStrings(left.purpose, right.purpose) ||
|
|
573
|
+
compareCanonicalStrings(left.proposal_digest, right.proposal_digest));
|
|
574
|
+
if (new Set(normalized.map((proposal) => `${proposal.purpose}:${proposal.proposal_digest}`))
|
|
575
|
+
.size !== normalized.length) {
|
|
576
|
+
throw new Error("Catalog publication authority proposals must be unique.");
|
|
577
|
+
}
|
|
578
|
+
return normalized;
|
|
579
|
+
}
|
|
580
|
+
function normalizePolicies(policies) {
|
|
581
|
+
const normalized = policies
|
|
582
|
+
.map((policy) => publicationPolicyReferenceSchema.parse(policy))
|
|
583
|
+
.sort((left, right) => compareCanonicalStrings(left.key, right.key));
|
|
584
|
+
if (new Set(normalized.map(({ key }) => key)).size !== normalized.length) {
|
|
585
|
+
throw new Error("Catalog publication policy keys must be unique.");
|
|
586
|
+
}
|
|
587
|
+
return normalized;
|
|
588
|
+
}
|
|
589
|
+
function authoringPath(slug) {
|
|
590
|
+
return `entities/${slug.slice(0, 2)}/${slug}.yaml`;
|
|
591
|
+
}
|
|
592
|
+
function difference(left, right) {
|
|
593
|
+
const excluded = new Set(right);
|
|
594
|
+
return orderedUnique(left.filter((value) => !excluded.has(value)));
|
|
595
|
+
}
|
|
596
|
+
function symmetricDifference(left, right) {
|
|
597
|
+
return orderedUnique([...difference(left, right), ...difference(right, left)]);
|
|
598
|
+
}
|
|
599
|
+
function isRecord(value) {
|
|
600
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
601
|
+
}
|
|
602
|
+
function escapePointerSegment(value) {
|
|
603
|
+
return value.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
604
|
+
}
|
|
605
|
+
//# sourceMappingURL=publication.js.map
|